|
how do you get rid of invlalid resX input errors. they occur when i try to open up someone elses project solution file.
i tried copy pasting all the code from each form file( in c#) into my new project... but that didnt do the trick.
|
|
|
|
|
Hello,
Does anyone know of a method to keep the .NET Framework updated automatically/programatically similar to how Windows updater works?
I know that dotfx.exe can be downloaded and ran, but this cotains a large amount of files. If there anything at there that can detect just which files have changed and allow my program to install just those files?
Does C# have any built in functions to perform checks and updates on the framework?
Thanks
|
|
|
|
|
|
I had .NET Framework 1.0 and VS.NET 2002. I normally invoke VS.NET via Start -> Run -> devenv and it opened fine.
Of late, I installed .NET Framework 1.1 and now when I say Start -> Run -> devenv, it opens a Command Prompt and then opens VS.NET (the command prompt closes itself automatically anyway).
When I made a small investigation of what is happening, I found, just typing devenv now, opens devenv.com and then opens devenv.exe.
Why has this mapping changed in my machine automatically? Any fix or solution available?
Thanks...
Deepak Kumar Vasudevan
http://deepak.portland.co.uk/
|
|
|
|
|
I am doing .NET remoting hosted in Windows service. I want to be able to check if the port number i requested is available, if not I'll use another number. I will do this until I find a port which is not used. The problem is I try to use try/catch to catch the exception if the port number is occupied. But neither
ChannelServices.RegisterChannel(chan) or
Activator.GetObject(typeof(remoteObj),
"http://localhost:portNumber/remoteObj.rem");
can catch any exception if the port is used.
What can I do to deal with this issue?
Thx.
|
|
|
|
|
When you call Activator.GetObject the Activator create Proxies on a client side but not yet contacts the server.
You won't get exception if port is in use until you connect the server (until you call any method on a remote object).
From the other hand, remoting normally chooses an available port for a client.
If you want to check if port is in use, you suppose to do that on the
server side.
Again, with remoting you normally don't hardcode settings, you use configuration files instead. It's matter of a few seconds to change the port number in configuration file.
"...hasn't really been well accepted ... as the ratings tell us so far " - Nishant S
|
|
|
|
|
How do I check and change the port number in server side?
I guess I can put RegisterChannel in try/catch at server side, it should give me exception if the port is in use, is it right? how can I do in config file?
|
|
|
|
|
No, RegisterChannel doesn't make any check if port is in use or not and, therefore, doesn't throw the exception in this case.
Just use config files to easy change configuration settings, you don't have to check if port is in use or not programmatically.
"...hasn't really been well accepted ... as the ratings tell us so far " - Nishant S
|
|
|
|
|
Do you mean when client failed, then use config file to change port number?
I cannot do that. I need something to automatically detect and change the port number. any way?
|
|
|
|
|
Yes, this is that I mean and is that as it normally works.
I think there is a way to detect if port is in use, but not the way you tried. No one from functions you use to register channel or obtain reference on a remote proxy won't throw exception in this case.
Only when client will try to connect server, exception will be thrown.
But there is one question:
first server should find free port. Let's imagine that server did. But HOW DOES CLIENT KNOW WHICH PORT IS CHOOSEN BY SERVER IF YOU DON'T USE CONFIG FILE?
"...hasn't really been well accepted ... as the ratings tell us so far " - Nishant S
|
|
|
|
|
The solution that seems to be used (or at least that I used ) is to specify a range of port for your server (ex: 2001->2005).
The client can try the next one in the range if one fails.
Gilles
NB: usually the client knows on which port the server is listening for q specific service: 80<->HTTP, 21<->FTP, ...
an din our case 2001<->your service
|
|
|
|
|
I put an assembly up in the GAC and I am having trouble simple removing it. For whatever reason Windows Installer is holding onto it and I am really not sure why? Could anyone explain why this is happening? I manually added it to the GAC and really did nothing special.
Steve
|
|
|
|
|
|
|
I actually installed MSN Messenger 6 on the same day started to have problems. Thanks for the tip.
Steve
|
|
|
|
|
I have a ASP.net application written in VB.Net which is the main application. I have another ASP.net application written in C#. I want to integrate the C# project files into the VB.net project ( without having to convert C# code to VB.net ) . The C# project contains few aspx pages and couple of C# utility classes.
What would be the best way to integrate the C# files into VB.net project and run these successfully within the ASP.net app?
Thanks
Madhuri Mittal
|
|
|
|
|
|
Hi
I need component for embedding to my .NET application for WinXP (Tablet PC Edition). This component must can draw graphic primitives (lines, rectangles and other, for drawing simple plan of houses) maybe like MS Visio, but more simple .
Can you recommend components for this?
thanks
|
|
|
|
|
Two simple questions:
1. Why "__property"? What does it offer that regular "method" does not?
2. When instantiating managed class..
SomeClass MyInstance; (illegal, if "SomeClass" is a managed class.
SomeClass* pInstance = new SomeClass (legal)
Why did they design it as such? Is there any purpose behind this?
Here's a short code to illustrate the point:
__gc class Dummer
{
protected:
int m_nValue;
//Keep track of how many times a propert has been accessed.
int nCountRead;
int nCountWrite;
public:
Dummer() { nCountRead=0; nCountWrite=0; }
//Property - public. But what's the use exactly? How's this different from a member function?
__property int get_Val()
{
nCountRead++;
return m_nValue;
}
__property int set_Val(int nVal)
{
nCountWrite++;
m_nValue=nVal;
return 1;
}
};
// This is the entry point for this application
int _tmain(void)
{
// TODO: Please replace the sample code below with your own.
Console::WriteLine(S"Hello World");
//QUESTION 1: What's the purpose of "__property"?? What's the difference between "__propery" and "method"??
Dummer * Tom = new Dummer;
Console::WriteLine(Tom->get_Val());
//QUESTION 2: Error C3149 here. You must declared John as a "pointer" - but why did the .NET team assert that all managed class instance must be "pointer" to the class at hand??
/*
Dummer John;
John.m_nValue = 10;
*/
return 0;
}
norm
|
|
|
|
|
norm wrote:
2. When instantiating managed class..
SomeClass MyInstance; (illegal, if "SomeClass" is a managed class.
SomeClass* pInstance = new SomeClass (legal)
Why did they design it as such? Is there any purpose behind this?
It just makes object instantiation more consistant across .NET languages.
norm wrote:
//QUESTION 1: What's the purpose of "__property"?? What's the difference between "__propery" and "method"??
Dummer * Tom = new Dummer;
Console::WriteLine(Tom->get_Val());
Actually a property is referenced slightly different, and similar to field access. You would call:
Dummer * Tom = new Dummer();
Console::WriteLine(Tom->Val);
norm wrote:
//QUESTION 2: Error C3149 here. You must declared John as a "pointer" - but why did the .NET team assert that all managed class instance must be "pointer" to the class at hand??
/*
Dummer John;
John.m_nValue = 10;
*/
return 0;
}
Declare the type as a __gc struct. Then behaviour is like a struct, but it can contain members. You can look into __value types too, AFAIK these are allocated on the C++ heap and not the .NET heap, and hence are accessable from both.
leppie::AllocCPArticle(Generic DFA State Machine for .NET);
|
|
|
|
|
norm wrote:
1. Why "__property"? What does it offer that regular "method" does not?
I am not a fan of properties myself - I think that a function should have a syntax of a function, but anyway in .NET all accessor methods should be implemented as properties. Just learn to live with it
norm wrote:
2. When instantiating managed class..
SomeClass MyInstance; (illegal, if "SomeClass" is a managed class.
SomeClass* pInstance = new SomeClass (legal)
Why did they design it as such? Is there any purpose behind this?
Because in C++ the first version would create MyInstance on stack, and gc objects can go only to managed heap.
|
|
|
|
|
Nemanja Trifunovic wrote:
I am not a fan of properties myself - I think that a function should have a syntax of a function, but anyway in .NET all accessor methods should be implemented as properties. Just learn to live with it
It has a number of benefits. For instance, if you wanted to increment a value by 1, with a property you could do this:
Object.Property++;
rather than
Object.setProperty(Object.getProperty()+1);
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Yes it is easier to type
However, properties's syntax hide the fact that they are functions, not data members, and I don't like it. In ideal world nobody would use public data members and then I wouldn't mind. However, too many people use public members, and sometimes it is not obvious whether
Person.Name = "Joe";
refers to property or member data.
|
|
|
|
|
Yeah, that's true. The guidelines I go by are: If it's essentially going to set some member data and then do some things that should be done when that value changes, then it should be declared as a property. But if it's going to do more than that - say, setting some value outside of the class it's in, then it should be a method. I also noticed that a number of the framework classes go by this rule, too.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
__gc class A
{
protected:
String* m_sobj_name;
int m_nCountRead;
...
...
public:
__property String* get_name() {
m_nCountRead++; //Keep count.
bArth=Authorize(); //Do other stuff.
if(bArth==false) {return "error";}
return m_sobj_name; //Then, return protected property in the end.
}
...
...
};
_tmain(..)
{
...
A *pObj = new A;
String* sName = pObj->name; //simpler syntax, yes.
};
norm
|
|
|
|