VB6 App Referencing VB.NET DLL Debug Nightmare
HI All,
I have a VB6 App and a VB.NET DLL. The VB.NET DLL Is used to call a
web service.
When I compile the app is works fine but when I try to debug the VB6
Code I get this error message:
"File or assembly name GetGantnerTxns, or one of its dependancies, was
not found."
GetGantnerTxns is the name of the VB.NET DLL
This is making the debugging difficult as I have to use msgbox's and
recompile. Its driving me nuts!
Can anyone tell me if I can sort this out so I can debug properly?
Thanks for any help
Fred Tag: Visual Studion & .NET 2.0 Framework Tag: 116180
remoting in 2.0 and credentials
I can access a remote object that is hostet on my own machine in IIS if
I
supply default credentials.
If I supply the same account data explicitly I run into a 401.
Is there something wrong?
--------------------------------------------------
IRemotingFacade remFacade;
string result = string.Empty;
BinaryServerFormatterSinkProvider serverProvider = new
BinaryServerFormatterSinkProvider();
serverProvider.TypeFilterLevel =
System.Runtime.Serialization.Formatters.TypeFilterLevel.Full;
BinaryClientFormatterSinkProvider clientProvider = new
BinaryClientFormatterSinkProvider();
Hashtable props = new Hashtable();
props.Add("port", 0);
//this works
props.Add("useDefaultCredentials", true);
// 1. doesnt work if useDefaultCredentials is set to
false
//ICredentials login = new NetworkCredential("mfritsch",
"mypassword", "mydomain");
//props.Add("credentials", login);
// 2. doesnt work
//props.Add("UserName", "mfritsch");
//props.Add("Password","myPassword")
//props.Add("Domain", "mydomain");
HttpChannel channel = new HttpChannel(props,
clientProvider, serverProvider);
ChannelServices.RegisterChannel(channel);
remFacade =
(IRemotingFacade)Activator.GetObject(typeof(IRemotingFacade),
"http://localhost/RemotingServer/RemotingType.rem");
object result = remFacade.SaveData(myData );
ChannelServices.UnregisterChannel(channel);
--------------------------------------------------
regards
Mathias Tag: Visual Studion & .NET 2.0 Framework Tag: 116174
dotNet 1.1 compatibility with 2.0
I have a .Net 1.1 application that starts through internet explorer and
uses webservice for data-retrieval.
It is an application that runs for 3 years now (so it was first created
with 1.0 framework and later compiled with 1.1). To get it running i had
to add it to the trusted sites and set security settings of dotnet to
full trust.
It all worked fine, but now there is a problem with the 2.0 framework.
It seems that when i run the application it no longer uses the 1.1
framework, but the 2.0 one, but this causes some SecurityExceptions.
I'll post the error below.
When i adjust security settings for 2.0 framework (set to full trust
like i did with 1.1), the application will start, but there are still
some securityerrors that come up in the program itself.
Problem is that it is computer dependant, my old pc and our terminal
server don't have the problem, my new pc and my clean win xp + sp2 on
vmware do have the problem.
second problem is that the .net 2.0 configuration is only available when
vs2005 is installed, so on my vmware i can't even adjust the settings...
need some help with this...
here is the exception:
************** Exception Text **************
System.Security.SecurityException: Request for the permission of type
'System.Security.Permissions.SecurityPermission, mscorlib, Version=
2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
at ToerStTruiden.mdiMainApp.PreLoad()
at anaXis.dotNet.ObjLib.aXbaseForm.aXbaseForm_Load(Object sender,
EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage
(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&
m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
The action that failed was:
InheritanceDemand
The type of the first permission that failed was:
System.Security.Permissions.SecurityPermission
The Zone of the assembly that failed was:
Trusted
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
IEExecRemote
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/IEExecRemote/2.0.0.0
__b03f5f7f11d50a3a/IEExecRemote.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0
__b77a5c561934e089/System.dll
----------------------------------------
ToerStTruiden
Assembly Version: 1.0.0.0
Win32 Version: n/a
CodeBase: http://www.eyes-e-
tools.net/sinttruiden/application/ToerStTruiden.EXE
----------------------------------------
anaXis.eBoX.ObjLib
Assembly Version: 1.0.1.1
Win32 Version: n/a
CodeBase: http://www.eyes-e-
tools.net/sinttruiden/application/anaXis.eBoX.ObjLib.DLL
----------------------------------------
anaXis.dotNet.ObjLib
Assembly Version: 1.0.1.1
Win32 Version: n/a
CodeBase: http://www.eyes-e-
tools.net/sinttruiden/application/anaXis.dotNet.ObjLib.DLL
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0
__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0
__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0
__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
anaXis.dotNet.ClassLib
Assembly Version: 1.0.1.1
Win32 Version: n/a
CodeBase: http://www.eyes-e-
tools.net/sinttruiden/application/anaXis.dotNet.ClassLib.DLL
----------------------------------------
anaXis.eBoX.ClassLib
Assembly Version: 1.0.1.1
Win32 Version: n/a
CodeBase: http://www.eyes-e-
tools.net/sinttruiden/application/anaXis.eBoX.ClassLib.DLL
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0
__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0
__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Data
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0
__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Web.Services
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Web.Services/2.0.0.0
__b03f5f7f11d50a3a/System.Web.Services.dll
----------------------------------------
8v_hwxt_
Assembly Version: 1.0.1.1
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0
__b77a5c561934e089/System.dll
----------------------------------------
qcpbhwwv
Assembly Version: 1.0.1.1
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0
__b77a5c561934e089/System.dll
----------------------------------------
3xoy4vzn
Assembly Version: 1.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0
__b77a5c561934e089/System.dll
----------------------------------------
ccp96s8j
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0
__b77a5c561934e089/System.dll
----------------------------------------
wewo-q42
Assembly Version: 1.0.1.1
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0
__b77a5c561934e089/System.dll
---------------------------------------- Tag: Visual Studion & .NET 2.0 Framework Tag: 116173
Convert RTF to PDF (C#)
I got the following problem: an RTF is loaded and stored in memory in a form
of a byte array. I need to convert it to a PDF without the necessety to store
it on the disk (i.e. I need either byte array or a stream). I tried to use
TX Text Control which works fine except that it does not convert the barcode
that appears in RTF to the PDF correctly. TX Text Control support said that
it is a serious issue and they are working on it. Meanwhile I need a
solution. Most of the converters that I found were either applications of
themselves, or tools that can be used from the code but require actual
physical files. Could anyone please recommend a tool that can be used from
C# and can convert an RTF to PDF without storing files on the disk.
Thanks Tag: Visual Studion & .NET 2.0 Framework Tag: 116171
Partial classes not good OO design
Does Microsoft even bother involving developers anymore in their process of
developing new "features"?
I've spent about four hours with VS2005 now and can't believe the list of
problematic improvements I've generated in that short time.
Then I run across this partial class feature. What a mind bending stupid
idea. This isn't an object oriented concept at all - it's very much akin to
using a preprocessor to insert code.
The ability to "hide" code is pretty much covered by the OO model - it's
called encapsulation. Hiding UI code is the reason given for this
"innovation". What happened to patterns such as MVC? Even a UI helper class
would be a better idea. UI code could have been placed in a generated class
which is then included as a member in the developer's "business" logic class.
At least there would be a clear separation of function with this approach.
Splitting code for a single class into multiple files is such an obvious,
bad, hack. It seems to me the last resort to solving a programming problem is
to change the underlying language specification. What a horrible precedent
to set. Microsoft language "architects" ought to be really ashamed of
themselves for permitting this feature to be added to the .Net language
syntax.
IMHO,
Mike O'Shea
Logicalis Tag: Visual Studion & .NET 2.0 Framework Tag: 116168
Problems using Directory.GetFiles
Hello,
I am having some difficulties using Directory.GetFiles. I have a directory
with contains:
file1.fmt
file2.fmt
file3.fmt
file4.fmt_
file5.fmt_
When i use Directory.GetFile(directory, "*.fmt") i returns all the filenames
instead of just the .fmt files.
Is there a function i can call that only returns the filenames with the
extension i specify?
Thank you Tag: Visual Studion & .NET 2.0 Framework Tag: 116162
Collections: Does 'Add' make a deep copy?
Hi All,
When I 'Add' an 'object' to a System.Collection (ArrayList, HashTable,...)
does it just put a 'reference' to the object in the Collection, or is it a
'deep copy' (a new instance of the object)?
SteveH Tag: Visual Studion & .NET 2.0 Framework Tag: 116157
Running an exe from another application
I need to start execution of an exe in a command line fashion from a Windows
application. Is there a way to do this using the framework, or do I have to
instantiate the WScript.Shell somehow? Tag: Visual Studion & .NET 2.0 Framework Tag: 116155
2.0 Configuration. How do I abstract usage of WebConfigurationManager vs ConfigurationManager?
Why did MSFT feel they had to separate the two? What if I am writing a
class in an assembly that could be used by either an ASP.Net app or a
Winforms app? I don't want to have each look for the data in different
ways. I want to abstract that. Couldn't they have used a factory that
returns an IConfigurationManager or something like that?
Thanks
CZ Tag: Visual Studion & .NET 2.0 Framework Tag: 116154
IPC security problem (.NET remoting)
I have a problem for my IpcClient to connect to my IpcServer.
I get "Access denied" message.
It appears that the solution is to write this:
dict["authorizedGroup"] = "Everyone";
This works fine on my computer at work.
The problem is this is not working on my home computer. It is a Windows XP
french edition. The group "Everyone" does not exists.
Isn't it possible to remove security from the Ipc engine so it will allow
access to every group ? Tag: Visual Studion & .NET 2.0 Framework Tag: 116146
Deployment problem
Hi
When I added a shortcut to the desktop folder it did work but the icon is
not the icon of the application is there a way to change that
T.Y.
Sam Tag: Visual Studion & .NET 2.0 Framework Tag: 116142
Serialize List of objects as XML
Hello,
I have a list of objects that I want to serialize as XML and save it as
user setting. The objects are of type of the following class.
[Serializable]
public class SourceFolder
{
public SourceFolder(string path, bool controlled, bool
includesSub)
{
this.path = path;
this.controlled = controlled;
this.includesSub = includesSub;
}
public string Path
{
get
{
return path;
}
set
{
path = value;
}
}
public bool Controlled
{
get
{
return controlled;
}
set
{
controlled = value;
}
}
public bool IncludesSub
{
get
{
return includesSub;
}
set
{
includesSub = value;
}
}
private string path;
private bool controlled;
private bool includesSub;
}
In my settings object, I have a property of type List<SourceFolder>
that I assign my object list before saving. Unfortunately, the only
output in the file user.config is the following:
<setting name="SourceFolders" serializeAs="Xml">
<value />
</setting>
When I add the attribute
SettingsSerializeAs(SettingsSerializeAs.Binary) to the settings
property, it works, but the list is serialized binary what I do not
want.
Visual Studio 2005 help states that .NET framework is able to serialize
lists of any object to XML stream. What am I doing wrong that it does
not work for me? When I use List<string> instead of List<SourceFolder>,
it works fine, but not with my class.
Regards, Jens Tag: Visual Studion & .NET 2.0 Framework Tag: 116141
Binding HttpListener to a free port
Hi,
When providing the HttpListener with a list of 'prefixes' to respond to
there doesn't appear to be an option for binding to an arbitrary freely
available port, and if there is then there doesn't seem to be a
mechanism for discovering that port by the calling code.
I'm happy to be proven wrong here but given this situation, the obvious
approach now would be to programatically query the OS for a list of
used and/or available ports, and to pick one of the available ones.
This may introduce the problem of a port being allocated in the time
between querying the OS and binding to the port, but I can handle that
exception and keep trying until a successful bind occurs (hopefully!).
Am I going about this the right way? Is there an alternative to
HttpListener? I suppose I could revert to using HttpListener and
perhaps re-using the provided HTTP classes for handling the HTTP
protocol?
Thanks in advance for any help,
Colin Green Tag: Visual Studion & .NET 2.0 Framework Tag: 116139
TransparencyKey vb.net 2005 on form works only on developing machine.
Hi all,
Setting the transparency key on vb.net 2005 form (I randomly chose the
color yellow), works great on my machine, meaning i set the form's
background color to yellow as well, and it becomes transperent.
Deploying my app on 3 other machines, i fould out the yellow background
shows on their app.
I was reading about the the color quality bug (16,24,32 bit), and
thought of it has a problem. But checking all machines, all including
mine were set to 32 bit. So why does it not work, and is there a
workaround.
Thanks in advance,
Eli Tag: Visual Studion & .NET 2.0 Framework Tag: 116138
ConfigrationManager Problem
Hi, I am trying to call the new ConfigurationManager class but all I get is
"does not exist in the current context".
I can substitute with System.Configuration.ConfigurationSettings.AppSettings
and all seems to be fine.
Any ideas? here is the actual code
protected string ConnectionString {
get {
if (ConfigurationManager.ConnectionStrings["Timer"] == null)
throw (new NullReferenceException("Invalid Connection"));
string connectionString =
ConfigurationManager.ConnectionStrings["Timer"].ConnectionString;
if (String.IsNullOrEmpty(connectionString))
throw (new NullReferenceException("Invalid Connection attempt")
else
return (connectionString);
}
}
Thanks
Steve Tag: Visual Studion & .NET 2.0 Framework Tag: 116136
XSD.EXE vs System.Xml.Serialization problems
I'm using the System.Xml.Schema and System.Xml.Serialization objects to
generate XSD dynamically and then the CSharpCodeProvider to generate
classes. When using xsd.exe with the "/dataset" switch it generates just
what I want. When I do it through the framework I get the equivalent of
xsd.exe with the "/classes" switch.
I don't seem to be able to find where I can programatically set the option
for class vs dataset. This must be possible, this is surely how xsd.exe is
doing its work. What am I missing? Tag: Visual Studion & .NET 2.0 Framework Tag: 116135
Connection is busy with results for another hstmt
Hello:
I'm using a connection in a web page to connect to SQL Server throught an
ODBC driver, but from time to time and witthout using DataReaders (I return
data in Datatables) I get an error like this:
[Microsoft][ODBC SQL Server Driver]Connection is busy with results for
another hstmt
Anyone can help me?
The connection is unique for each page I call.
Thanks Tag: Visual Studion & .NET 2.0 Framework Tag: 116129
TextRenderer problem
Hi,
I'm creating a control that overrides ListView and so I'm working on
redrawing everything myself with some changes here and there...
But I'm having a problem with drawing the text inside the rectangle on
LargeIcon mode... I thought I'd finally discovered the solution with
TextRenderer but this still doesn't give the correct results.
Here's the code I'm trying to use (item is a ListViewItem)
Rectangle text_rect = item.GetBounds(ItemBoundsPortion.Label);
TextFormatFlags formatFlags = TextFormatFlags.WordBreak |
TextFormatFlags.HorizontalCenter | TextFormatFlags.Top |
TextFormatFlags.EndEllipsis;
if (item.Text != null && item.Text.Length > 0)
TextRenderer.DrawText(dc, item.Text, item.Font, text_rect,
item.ForeColor, item.BackColor, formatFlags);
The problem is that its still not exactly what the original ListView
displays... ie
I'm displaying:
___________
| some |
| really long |
original ListView displays:
___________
| some really |
| long text |
Surely it should fit inside the bounding box if its using the GDI draw
method and I'm using the bounding box thats returned to me from the
ListViewItem itself? Any ideas?
thanks
Kris Wragg Tag: Visual Studion & .NET 2.0 Framework Tag: 116124
Getting a file's ContentType
I would like to be able to get the ContentType of a file programmatically
(for example, I want *.txt files to return "text/plain"). I could not find a
way to do this using VB.NET's classes, but I am also somewhat new to using
the System.IO namespace for anything other than text files and the pure
basics, so I could very well have missed it. Any help would be appreciated.
Thanks.
--
Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/ Tag: Visual Studion & .NET 2.0 Framework Tag: 116115
Customization In Web Application
All,
Using VS 2005, C#.NET, SQL Server 2005, W2K3.
We are developing a web application that would be shared by numerous
customers for information management. Some of those customers want
variations on the usual form layout.
For example, we have a form where the user can enter their dependents
information (parents, siblings, spouse, kids, etc.), but we know one of our
customers wants to include additional information on that form that none of
the other customers would use (company specific insurance coverage).
Based on our experience with our C/S version of the product, we can expect
to see many more requests like this.
There are 3 ways to do this that I see.
1. Create a separate web application for that customer and host it on a
different web server.
2. Add the custom fields to the single web application but hide the extras
based on the customer using it.
3. Allow the customer to add the fields themselves and store them for just
that customer.
Pros and cons that I see.
1. Quick to implement, but costly in new infrastructure, and would end up
difficult to maintain.
2. Still relatively quick to develop, and uses existing infrastructure, but
would create complex forms.
3. Difficult to develop, but would use existing infrastructure and wouldn't
need extra maintenance.
Personally, I'd like to use 3. That is... Design the application so that
each form includes standard fields, but a customer can add new labels,
textboxes, drop-down combos, lists, etc., themselves and doing so doesn't
require us to change any code or the database schema.
While this would be a no-brainer in an C/S application, it gets a little
more difficult in a web app since the only client they use is a browser.
Any thoughts? Tag: Visual Studion & .NET 2.0 Framework Tag: 116111
Re: Graphics.PageUnit problem... (spelling checked.. ;-(
I have to do some WYSIWIG rendering.
Because I need to know exactly where is what and have to have the same
output on both the screen and the printer I decided to change my Page unit
to Inches.
As I was testing my first thought was to draw red outline of some relevant
rectangle.
And here I had my 1st encouter with those infamous Windows strangeness....
Even though I had set my line width to 0, GDI+ draw 1 inch thick
rectangles...
What's that?
How could I fix that?
Below is a code sample showing the problem,
just try it: big rectangle:
==========================
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
e.Graphics.PageUnit = GraphicsUnit.Inch;
using (Pen pen = new Pen(Color.Red, 0))
{
pen.Width = 0;
e.Graphics.DrawRectangle(Pens.Red, 0, 0, 8.5f, 11);
e.Graphics.DrawRectangle(Pens.Red, 1.5f, 1.25f, 5.5f, 8.5f);
}
} Tag: Visual Studion & .NET 2.0 Framework Tag: 116107
Graphics.PageUnit problem...
I have to do some WYSIWIG rendering.
Bacause I need exactly where is what and have the same output on the printer
I decided to change my Page unit to Inch.
As I was testing my first though was to draw read outline of some relevant
rectangle.
And here I had my 1st encouter with those infamouse Windows strangeness....
Even though I had set my line width to 0, GDI draw me 1 inch thick rectangle
borders...
What's that?
How could I fix that?
Below is a code sample:
=======================
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
e.Graphics.PageUnit = GraphicsUnit.Inch;
using (Pen pen = new Pen(Color.Red, 0))
{
pen.Width = 0;
e.Graphics.DrawRectangle(Pens.Red, 0, 0, 8.5f, 11);
e.Graphics.DrawRectangle(Pens.Red, 1.5f, 1.25f, 5.5f, 8.5f);
}
} Tag: Visual Studion & .NET 2.0 Framework Tag: 116106
How install cab file on background based in mobile device?
Dear experts,
I try to install a cab file by code, I use P/Invoke can do it.But its a
problem , if the programe has installed in Pcoket PC,there is a prompt saying
"An older version of the application already exists. Do you want to
reinstall?". Is there some method to let this messagebox dont show?This is
say that the setup screen does not display.
My os is windows mobile 5.0
Thanks and Regards,
collysun Tag: Visual Studion & .NET 2.0 Framework Tag: 116105
Rewrite ...
This post is mostly for discussion. Why rewrite in .NET? Just a general
discussion not related to any specific details. I was just looking to see
what reasons developers are looking to, to help decide whether they should
rewrite their app in .NET.
What are the trends being observed of Microsoft when it comes to .Net?
How much longer will COM objects live on?
How stable is the Framework?
If the goal is to maintain a software package for the next 10 years, would
that make a differnce on the decision?
What if a rewrite would take approximately 2 years, would that affect when
you decided to do a rewrite?
Are their any security benefits?
I am looking for opinions, but also links to facts that can help support
your case. I'm hoping this can become a good discussion.
Thanks Tag: Visual Studion & .NET 2.0 Framework Tag: 116103
How install cab file on background based in mobile device
Dear experts,
How install cab file on background based in mobile device? This is say that
Setup screen does not display.
Os is windows mobile 5.0
Thanks and Regards,
collysun Tag: Visual Studion & .NET 2.0 Framework Tag: 116102
??? MethodInfo Props are Wrong (or Docs are Wrong) ???
Hi everyone,
I hope you can comment on this -- I'm pretty darned sure that either
some of the MethodInfo properties are wrong or the Microsoft
documentation is wrong.
Please have a look at the program below. It attempts to print out the
accessibility (i.e., "visibility") of each method in the class. I've
included the program along with its output.
The Microsoft documentation for MethodInfo tells us that the IsAssembly
property "Gets a value indicating whether this method can be called by
other classes in the same assembly." Okay, great. Public methods can
certainly be called from other classes in the same assembly, right? Not
according to the program below. The output indicates a public method
cannot be called from other classes within its assembly because the
IsAssembly property is false.
There are other inconsistencies in the output as well - for example, an
internal method cannot be called from a subclass in the same assembly.
Read the Microsoft documentation very carefully. You'll see that the
IsPrivate and IsPublic properties refer to the accessibility of the
member itself. For example, m.IsPublic indicates whether or not m is
public.
In contrast, IsFamily, IsAssembly, IsFamilyAndAssembly and
IsFamilyOrAssembly indicate whether the method in question can be
called from a method with that accessibility. For example, m.IsAssembly
indicates whether m can "be called by other classes in the same
assembly". This is distinctly different from saying that m has internal
accessibility. So, certainly any public method can "be called by other
classes in the same assembly", right? Not according to the output
below.
It's very inconsistent and the property values are inconsistent with
what the documentation says they should be.
I guess you can look at this as either the MethodInfo properties are
wrong or the Microsoft documentation is wrong. I guess I'm just a
stickler.
---------------------
using System;
using System.Reflection;
class Program {
private static void Main(string[] args) {
Type t = typeof(Program);
MemberInfo[] members = t.GetMembers(BindingFlags.Public |
BindingFlags.Instance |
BindingFlags.NonPublic |
BindingFlags.DeclaredOnly);
foreach (MemberInfo mi in members) {
Console.WriteLine(mi);
MethodInfo methodInfo = mi as MethodInfo;
if (methodInfo != null) {
Console.WriteLine(" Private: " + methodInfo.IsPrivate);
Console.WriteLine(" Public: " + methodInfo.IsPublic);
Console.WriteLine(" Assm: " + methodInfo.IsAssembly);
Console.WriteLine(" Fam: " + methodInfo.IsFamily);
Console.WriteLine(" Fam & Assm: " +
methodInfo.IsFamilyAndAssembly);
Console.WriteLine(" Fam | Assm: " +
methodInfo.IsFamilyOrAssembly);
}
Console.WriteLine();
}
} // main()
protected void ProtMethod() {}
internal void InternalMethod() {}
public void PublicMethod() {}
protected internal void ProtInternalMethod() {}
} // Program()
------ OUTPUT ----------
Void ProtMethod()
Private: False
Public: False
Assm: False
Fam: True
Fam & Assm: False
Fam | Assm: False
Void InternalMethod()
Private: False
Public: False
Assm: True
Fam: False
Fam & Assm: False
Fam | Assm: False
Void PublicMethod()
Private: False
Public: True
Assm: False
Fam: False
Fam & Assm: False
Fam | Assm: False
Void ProtInternalMethod()
Private: False
Public: False
Assm: False
Fam: False
Fam & Assm: False
Fam | Assm: True
Void .ctor() Tag: Visual Studion & .NET 2.0 Framework Tag: 116099
Outlook Mail Drag & DRop
It's so simple to get an attachment from Outlook by drag & drop. Why
shouldn't be the case with a complete mail.
Has some one an idea what's in the Drag & Drop Data behalve a unuseful
filename, and some headers that interest nobody.
How can we retrieve the message file of the dropped item ? As items are
converted into .MSG files when dropping messages into the explorer.
Thanks
Laurent Tag: Visual Studion & .NET 2.0 Framework Tag: 116098
Overridden GetProperties() of ExpandableObjectConverter not called!
In a custom ExpandableObjectConverter I have overridden GetPropertiesSupported
(always returns true) and GetProperties. The class to which this
TypeConverter is applied has only public properties and it should be accessed
via a PropertyGrid.
However, GetProperties is never called!
By overriding some more methods and setting breakpoints inside those overrides
I have found out that all overrides are being called correctly, except for
the one GetProperties. Trying to catch any first chance exceptions doesn't
come up with any results, since there aren't any exceptions thrown.
Thus the desired expanding and minimizing of the object's properties isn't
possible.
Any ideas how to make GetProperties being called?
Thanks Tag: Visual Studion & .NET 2.0 Framework Tag: 116096
Script for building/debugging services
I have found services debugging to be a big pain. One reason is because
the play button in VS is worthless for this kind of application.
So I wrote this scripts that will execute for an app whose name ends on
Service, it will lookup the debug directory, Stop the service copy the
executables and restart the service. Now there is a lot of room for
improvement. But I thought I'd share and maybe someone out there will
improve on it. It also executes when the app has just been built, so
you only need to attach to the process instead of hitting the arrow.
Or maybe I am missing something; and there is no need for this at all.
To make this work you need to open the Macro editor on the menu it is:
"Tools/Macros/Macro IDE ...". There you can edit the MyMacros template.
Public Module EnvironmentEvents
#Region "Automatically generated code, do not modify"
Private Sub BuildEvents_OnBuildDone(ByVal Scope As
EnvDTE.vsBuildScope, ByVal Action As EnvDTE.vsBuildAction) Handles
BuildEvents.OnBuildDone
Debug.main()
End Sub
End Module
Public Module Debug
Private fullexepath As String = "C:\Program Files\My company\My
app"
Sub main()
Dim _project As EnvDTE.Project
_project = DTE.Solution.Projects.Item(1)
If
_project.Properties.Item("Title").Value.ToString.EndsWith("Service")
Then
Dim _process As Diagnostics.Process
_process =
Diagnostics.Process.Start("C:\Windows\system32\cmd.exe", "/c ""net stop
TNAEventService""")
_process.WaitForExit()
Dim OutputPath As String
OutputPath =
_project.Properties.Item("LocalPath").Value.ToString()
OutputPath +=
_project.ConfigurationManager.ActiveConfiguration.Properties.Item("OutputPath").Value
For Each OutputPath In Directory.GetFiles(OutputPath)
Dim fi As FileInfo = New FileInfo(OutputPath)
Dim vFileStream As FileStream
If File.Exists(fullexepath + "\" + fi.Name) Then
If Not Directory.Exists(fullexepath + "\old") Then
Directory.CreateDirectory(fullexepath + "\old")
End If
File.Move(fullexepath + "\" + fi.Name, fullexepath
+ "\old\" + fi.Name + "." + Now.ToString("yyyymmdd hhmm"))
End If
File.Copy(OutputPath, fullexepath + "\" + fi.Name)
Next
_process =
Diagnostics.Process.Start("C:\Windows\system32\cmd.exe", "/c ""net
start TNAEventService""")
_process.WaitForExit()
End If
End Sub
End Module Tag: Visual Studion & .NET 2.0 Framework Tag: 116093
Effort/Time in migrating 1.1 to 2.0
Hi, wanted to know what people have experienced in terms of effort+time in
migrating your apps to 2.0 from 1.1?
Are there any case studies on msdn? I couldn't find any..
how well did it go with you all? days? weeks? months?
we have a mid sized external app using mcms, a small asp.net app for internal
use, a small console app, and a webservice..
we will migrate if it's a relatively small investment.. otherwise, we will
stick with 1.1 for at least a year more as we have lots of integration projects
coming up.. my idea is that upgrading now will be cheaper than doing the
upgrade AFTER making the apps larger.. but that's me..
thank you Tag: Visual Studion & .NET 2.0 Framework Tag: 116086
windows media player
Hi,
How can I (remotly) control my windows media player.
like the logitech software.
like:
windows media player is playing a list of songs.
run my exe, and the next song is player.
I can't find some information about it.
thank you Tag: Visual Studion & .NET 2.0 Framework Tag: 116085
Aborting startup of a Windows Service
I'm in the process of writing a Windows service, however I've encountered an
odd problem.
In my service class in the overridden OnStart method I want to abort the
startup of the service should some error be encountered.
I've tried throwing an exception and tried calling the default OnStop
method, but the service controller still reports the status as Running.
What is the correct way to abort or exit the startup of a service ?
Thanks in advance
Steve Tag: Visual Studion & .NET 2.0 Framework Tag: 116074
.NET 2.0 MMC Config problems
I have 2 windows 2000 Server and 1 windows 2003 Server machines used for IIS
apps. All 3 have the .NET 2.0 Framework.
On my local workstation I have a ".NET Framework 2.0 Configuration" MMC
snap-in.
One none of the above servers (and Im logged in as a member of the
Administrators group) does that snap-in show or is there something similar in
the Administration tools - although there is a 1.1 utility.
I saw a posting to remove a registry key and then run aspnet_iis, but that
didnt make a difference.
And I need to access the GAC through the utility.
Thanks, Mark Tag: Visual Studion & .NET 2.0 Framework Tag: 116072
Create System.Console from a winforms app
Is there a way to create a System.Console from code. I periodically have a
WinForms app that needs to open a console window for progress tracking.
Thanks,
Mike Ober. Tag: Visual Studion & .NET 2.0 Framework Tag: 116070
problem with COM Object Wrapper or with Remoting... which one?
Hi,
I have a web project in VS 2005 and I'm using a wrapper to work with a COM
object. this object must work in a remoting environment. So we've done a
simple console app to give us the access to the remote object.
In our test web app, everything works fine... if we copy paste all the code
from the test app to the real app so we can have exactly the same thing in
each one, the real application raise an exception on the first call I do
after the "new MyObject()" line. My first guess would be that the problem
comes from the remoting, but I use exactly the same config file than the
test app.
The wrapper was in Framework 1.1, so I converted it to 2.0, I don't know if
it can change something, but for now, it does not work.
Does someone have an idea of what it would be? I mean, even with the same
code and the same config file. Is there a setting or something like it that
could cause the problem?
Thanks
ThunderMusic Tag: Visual Studion & .NET 2.0 Framework Tag: 116068
GAC - What's using my assembly
How can I determine what is consuming a particular assembly that's in
the GAC.
(There's an assembly of ours that's not letting me delete it from the
GAC. It's COM exposed and so could be used be either COM or .NET) Tag: Visual Studion & .NET 2.0 Framework Tag: 116066
DateTime Ticks/Milliseconds Question (possibly Thread.Sleep () related - ?)
Hi,
Slightly dim question, possibly. I dunno. When i run the following c#:
for (int i = 0; i < 100; i++)
{
System.Diagnostics.Debug.WriteLine
(DateTime.Now.Millisecond.ToString ());
System.Threading.Thread.Sleep (1);
}
I would expect the output to increment by at least 1 every line (since
I am asking my thread to sleep for 1 millisecond).
The output generated, however, looks like this:
627
409
409
409
424
424
440
440
440
456
456
456
456
(etc)
surely this is impossible?
I also noticed a similar thing when using Ticks instead of Milliseconds
Is there something im missing? I thought maybe it was something i hadnt
encountered before to do with thread scheduling (ie: none others to be
scheduled, so its not sleeping), but if i change the interval to 100ms
there is a visible (and seemigly regular) pause, and the output number
increments by slightly more than 100 each time round.
If anyone can shed some light on this i would be grateful - I'm now
wondering if its something to do with the clock speed of my PC...?
Thanks,
Chris Tag: Visual Studion & .NET 2.0 Framework Tag: 116061
capture application output
Hi,
How can I capture the text output of a console app?
For example, I would like to capture the outpur of "qwinsta"
Thanks. Tag: Visual Studion & .NET 2.0 Framework Tag: 116059
How to kill a terminal server session (VB.NET)
Hi,
Is there a way to kill a Terminal Server session from vb.net?
I have to constantlly access our servers to reset ureser that get hung. I
would like to have a web interfave that I can access via my PDA/Phone. It
dose not have to be a wab page that does this. I could write to a queque
that is read by a windows servrice on the TS server and then reset the user.
Thanks.
George. Tag: Visual Studion & .NET 2.0 Framework Tag: 116058
PadLeft ? What difference it make if the argument to this function carries an integer whose value is less than the length of the string object
Hi,
I came across a doubt on the String.PadLeft Method.The doubt is this --
What's difference it make if the argument to this function carries an
integer whose value is less than the length of the string object
For example in the sample code below(VB.NET) I could not see any difference
Dim str As String
str = "BBQ and Slaw"
Console.WriteLine(str.PadLeft(5)) ' Displays "BBQ and Slaw".
Console.WriteLine(str.PadLeft(15)) ' Displays " BBQ and Slaw".
I could not notice any difference with the output of str.PadLeft(5) and
the original str string.Both carries the same message "BBQ and Slaw"
Can any one tell me what is the use of this particular function if the
padleft paramater is less than the length of the string.
Reny Tag: Visual Studion & .NET 2.0 Framework Tag: 116056
Maintaining Sessions HttpWebRequest
I'm having problems to maintain a session with a remote server using
HttpWebRequest in .NET v2
I read a page using, which gives me data and holds it in a session.
(classic ASP)
The second request I need to use data from that session with the new
data I provide from ASP.NET.
My problem is that both requests appear to have a seperate Session;
asp.net <- classic asp session-related data (session 1)
asp.net -> classic asp session-related data + asp.net data (session 2
opened)
Instead of sharing one;
asp.net <- asp session-related data (session 1)
asp.net -> asp session-related data + asp.net data (session 1)
Is there a way to force the same session being used by the ASP.NET
page?
The code I currently am using, but isn't hooking back to the first
session:
public class Remote
{
public static string GetRemoteHTML(string ContentURL)
{
try
{
// Get HTML data
HttpWebRequest wreq =
(HttpWebRequest)HttpWebRequest.Create(ContentURL);
wreq.KeepAlive = true;
if (HttpContext.Current.Cache["ASPSESSION"] != null)
{
//string Cache =
HttpContext.Current.Cache["ASPSESSION"].ToString();
//string CName = Cache.Substring(0,
Cache.IndexOf("="));
//string CValue =
Cache.Substring(Cache.IndexOf("=") + 1, Cache.IndexOf(";") -
Cache.IndexOf("=") - 1);
//CookieContainer Cookies = new CookieContainer();
//Cookie Cookie = new Cookie(CName, CValue);
//Cookie.Path = "/";
//Cookie.Domain = ContentURL.Substring(0,
ContentURL.IndexOf("/",8));
//Cookies.Add(Cookie);
//wreq.CookieContainer = Cookies;
wreq.Headers.Add("Set-Cookie",
HttpContext.Current.Cache["ASPSESSION"].ToString());
}
HttpWebResponse wres =
(HttpWebResponse)wreq.GetResponse();
System.Web.HttpContext.Current.Cache.Insert("ASPSESSION",
wres.Headers["Set-Cookie"].ToString());
Stream streamResponse = wres.GetResponseStream();
StreamReader streamRead = new
StreamReader(streamResponse);
string responseString = streamRead.ReadToEnd();
streamResponse.Close();
streamRead.Close();
return responseString;
}
catch(Exception e)
{
throw e;
}
}
}
Is there something I'm overlooking?
Tim Tag: Visual Studion & .NET 2.0 Framework Tag: 116054
QUERY: Adding more JS/DOM attributes to DataGrids
I know that JavaScript lets us add:
ondragenter, ondragover, ondragleave, ondrop
events to normal HTML table td tags. This lets us do highlighting of
table cells/rows, and capture drag & drop events. So to handle
ondrop we can use JavaScript:
this.OnDrop = function(obj) {
obj.parentElement.style.backgroundColor = "white";
var strData = window.event.dataTransfer.getData("text");
this.InsertRow(obj.parentElement.rowIndex, strData);
window.event.cancelBubble = true;
}
The obj is the object that was dropped onto. So obj.parentElement is
the tr element, etc. Does all tr elements implicitly have a rowIndex
member which contains the row number of the table?
What am wondering is how can one add the ondrop="" attribute to a
table which was generated from a DataGrid? If it is not possible
adding JavaScript/DOM attributes to DataGrid's generated tables, then
is there any way to capture these window.events and knowing exactly
which DataGrid table row/cell it was dragged onto?
I was told to look for "DataGrid Overviews" at 4guysfromrolla.com but
could not find anything about it. Not even google.com could help. Is
there no drag and dropping support for ASP.NET datasource tables? Tag: Visual Studion & .NET 2.0 Framework Tag: 116053
Managed Component on IIS
Hi,
What is exactly a Managed component on IIS? I don't really know what this
IIS has to do with the Managed Components. Do you always need IIS for
Managed components? Are there other ways? Won't it be bad for performance
using IIS?
Thanks for any help our hints,
Pieter Tag: Visual Studion & .NET 2.0 Framework Tag: 116052
Regular epressions with .net forward slash "/" character
Afternoon all,
Can somone help with this regular expression problem VB sample below
Dim RegexObj As Regex = New Regex("")
RegexObj.IsMatch( "<start field=fred col=2 />", "\x2f" )
Returns false with no match.
This is a simplified example trying to end my capture onthe "/>" but the
forward slash seems not be working.
Thanks Tag: Visual Studion & .NET 2.0 Framework Tag: 116048
RadioButtonList .NET 2.0 Breaking Change
Can anyone shed any light on this issue.
We were generating HTML outside of a HttpContext in 1.0 and 1.1 by
building a control structure the calling RenderControl on the parent.
There has been a change to RadioButtonList Render method that causes a
null reference exception when Render is run without a HttpContext.
if (!base.DesignMode && !this.Context.Request.Browser.Tables)
This isn't listed in the breaking changes and I have never read that
you can't render controls without a Context.
Anyone know a work around for this? Is it a bug or by design? Tag: Visual Studion & .NET 2.0 Framework Tag: 116046
web pages help
Hi,
I'm a developing a web application. One of it's requirements is that if the
users try to downlaod the web apges, they shouldn't get the relevnt css files
of the web page.. how can I acheive this?
any good sites????. Tag: Visual Studion & .NET 2.0 Framework Tag: 116045
web pages help
Hi,
I'm a developing a web application. One of it's requirements is that if the
users try to downlaod the web apges, they shouldn't get the relevnt css files
of the web page.. how can I acheive this?
any good sites????. Tag: Visual Studion & .NET 2.0 Framework Tag: 116044
tool window & shortcut keys
In my application I have some tool window.
some of these tool window do accept key input.
yet I would like key shortcut (CTRL+S, F2, etc...) to be handled by the main
menus of my main window.
how could I achieve somethink like that? Tag: Visual Studion & .NET 2.0 Framework Tag: 116040
"Infospy" <Infospy@discussions.microsoft.com> wrote in message
news:BC130F90-7F52-4DC5-8272-0FE584F15694@microsoft.com...
>I Have Visual Studio .NET 2003
>
> Is is upgradable for 2.0 Framework?