|
Hi Leppie!
I guess I could, but that would require some change to the remoting server, wouldn't it?
The problem is that - initially - x.dll on the Client and on the Server are identical (or at least compatible).
Now the server remains unchanged, but the client's x.dll is updated.
The new version has a method the old version doesn't have yet.
So everything will continue working as long as the new method is not used.
As soon as I use the new method at the client, the client gets a RemotingException saying that the method could not be resolved. Of course. The local type has the method, but the remote proxy doesn't.
I want to catch exactly this case before it happens, so I need a way to find out the assembly version of x.dll at the server _without_ modifying the server itself.
Any idea?
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
You could modify the client to obtain the version info about the assembly on the server, the remoting server wouldn't need to be modified at all.
Such as: FileInfo("\\RemotingServer\MyObject.dll")
Of course the obvious solution would be to not allow the the client and server assemblies to be modified seperately. Click-Once deployment is a big help in this if you can use it.
|
|
|
|
|
Hi Mark!
Thanks for the suggestion, but I'm dealing with an existing .NET 1.1 application (so no Click-Once is available and it doesn't help with the general possibility that the assemblies don't match).
To be able to get the FileInfo I'd have to have access to the server's directory, which I don't have.
Thanks anyway!
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Hello everybody,
I have a problem while trying to make a monitoring server with WMI. I have arround 400 check to do on 15 servers. After 5 minutes a lot of port on my server are un TIME_WAIT state, so I get a RCP-server not avalaible I've reduce the TIME_WAIT timeout but nothing change...
Is there a way to close the WMI connection, I'm using ManagementScope... Here's a part of my code
<br />
public WMIRequest(string Username, string Password, string IP)<br />
{<br />
<br />
aConnectionOptions = new ConnectionOptions();<br />
aConnectionOptions.EnablePrivileges = true;<br />
aConnectionOptions.Username = Username;<br />
aConnectionOptions.Password = Password;<br />
this.IP = IP;<br />
}<br />
public bool Connect()<br />
{<br />
aManagementScope = new ManagementScope(@"\\"+ IP + @"\root\cimv2", aConnectionOptions);<br />
aManagementScope.Connect();<br />
return aManagementScope.IsConnected;<br />
}<br />
<br />
public string Request(string Request)<br />
{<br />
aObjectQuery = new ObjectQuery(Request);<br />
aManagementObjectSearcher = new ManagementObjectSearcher(aManagementScope, aObjectQuery);<br />
aManagementObjectCollection = aManagementObjectSearcher.Get();<br />
string Result = "";<br />
<br />
foreach(ManagementObject aManagementObject in aManagementObjectCollection ) <br />
{<br />
if(aManagementObjectCollection.Count > 1)<br />
Result += "|#*#|";<br />
<br />
foreach (System.Management.PropertyData aPropertyData in aManagementObject.Properties)<br />
{<br />
if(aManagementObject.Properties.Count > 1)<br />
Result += "|#|";<br />
Result += aPropertyData.Name + "|*|" + System.Convert.ToString(aManagementObject[aPropertyData.Name]);<br />
}<br />
}<br />
return Result;<br />
}<br />
I hope somebody has already resolved this problem...
Thank you
Nicolas.
|
|
|
|
|
Hi,
I have a similar problem.
Did you solve this?
In that case I would really appreciate your help.
/M
|
|
|
|
|
The paint event is handled upon a form is loaded:
Panel.Paint += new System.Windows.Forms.PaintEventHandler(Panel_Paint);
And I have added the panel.Invalidate() method in the treeView1_AfterSelect event. There are unwanted text for the default node. But when I select another node and get back to the default node, the unwanted text is gone.
I tried to debug it and accidentally found that the paint event is handled even without the Invalidate() method (well, it works for the first few nodes but not the rest). I'm just wondering how does the program know when to paint those text - ie. when it is triggered to paint.
It seemed to me that only the text for the default node has been painted twice. So if I can understand how the paint event is triggered, that might help to confirm whether it has been painted twice.
-- modified at 3:40 Friday 23rd June, 2006
|
|
|
|
|
Hi all!
i am using now the TreeView control on a form and i have a problem, i do not see the tree, i mean i run on the elements of my XML and the tree node is filling up but i do not see nothing, a blank white square, this is the function:
treeView1 = new TreeView();
treeView1.BeginUpdate();
XmlNodeList elemList = xmldoc.GetElementsByTagName("title");
for (int i=0; i < elemList.Count; i++)
{
TreeNode newNode = new TreeNode();
newNode.Text = elemList[i].InnerXml;
treeView1.Nodes.Add(newNode);
}
Can you please help?
|
|
|
|
|
Hii All,
I m working on a Desktop Based Application in C#.
I need to bind the data in datagrid in the following format ->
|---------------------------------------------------------------------|
| Some Text in Link Button |
| some Text in a label |
| Some Text in lable ChekBox |
|---------------------------------------------------------------------|
| Then 2 nad Row and so on.... |
| |
| |
| |
|---------------------------------------------------------------------|
Thanx
Anuj
-- modified at 1:55 Friday 23rd June, 2006
|
|
|
|
|
Hi,
i have developed an asp.net application.In that application i am getting the user information.i have 2 button,one web control[ok button] and anpother html control [reset button].While entering the user information,when i press esc button it is calling reset button and all the fields values are resetted. how can avoid this problem? i have seen this problem in many of the sities.[Example - Rediff.com while creating new user]
Any ideas?
Thankz in advance.
With Regards
[S.P.Saravanan]
|
|
|
|
|
|
Just as all seems clear, something comes along that blows way one's fundemental assumptions about life etc.
How can an object determine the type of object by which it was instanced - essentially who done the new that bought me to life.
I assumed "this" was about the current instance, one of the things that annoys me about "this" it's baggage.
I wanted to know the context in which a particular class member (a set accessor) was being used, and I thought a'ha there must be something in all that "this" baggage that will give me the name of the instancing class - but I can't find it - it seems I can get lots of info about "who" I is, but precious little about "where" I is.
I thought I'd try walking the stack, but I can't find that either, not even 42.InstancingClass works
mad:
Squarks - PhilD
|
|
|
|
|
You probably want to know about reflection. http://my.execpc.com/~gopalan/dotnet/reflection.html .
This is a pointer to the current object. It's not baggage because it is useful for all sorts of function calls referring to the object itself (among other things the compiler must have it for).
"I wanted to know the context in which a particular class member (a set accessor) was being used, and I thought a'ha there must be something in all that "this" baggage that will give me the name of the instancing class - but I can't find it - it seems I can get lots of info about "who" I is, but precious little about "where" I is."
Do you mean you want to know which class was calling this object? That's more difficult, and usually if your using reflection, it means you did something wrong anyways. Try redesigning your code to avoid it.
J
Did I post well? Rate it! Did I post badly? Rate that too!
|
|
|
|
|
Totally agree, a member should not need to know its instancing class - what I have to do is to log events based on the values of the objects properties, the most sensible place to do that is in the object set accessor. In addition to logging the objects properties, I am also required to log the event context, what better way than to include the instancing class tree, the defining class tree is of little consequence in this scenario. And we'd prefer that the instancing classes not know that the objects are being monitored.
The annoying thing is that I can see all the information I want- its in the stack window.
I'll read Gopalan's article - I've been trying to avoid knowing about Reflection, not on principle, but because my brain has a limited learning capacity, on the threshold of which I currently exist.
Thanks for your response - rgds PhilD
|
|
|
|
|
Hi,
you are looking for the StackTrace[^] class. Just create a new instance and will contain all information you need.
Robert
|
|
|
|
|
Thank you robert - I knew it had to be there somewhere MS rarely let developers down
|
|
|
|
|
Why don't you have the instantiating class supply the necessary data to the instance? Unless it's methods that you're after, that if needed to be shared could be in another class and/or static.
this only provides a reference to the current instance of the class. It will only access members of that instance.
Generally speaking, a class holds necessary data, and performs necessary functions based on that data, to represent a finite piece of the problem domain. If you're class doesn't have all the data it needs, you have a design problem. It shouldn't need to look elsewhere for what it needs.
Try code model generation tools at BoneSoft.com.
|
|
|
|
|
I have a struct that I am serializing in C++ so I don't have access to the .Net architecture (and I can't change that). I'm using winsock to transmit it over to a C#. How can I correctly serialise and receive this? All of the serialisation techniques I have seen in .Net are for objects also serialised in .net, or, I'm worried that if I use some sort of binary formatter I am going to get the packing of the struct wrong for my c++ struct.
Suggestions anyone?
Did I post well? Rate it! Did I post badly? Rate that too!
|
|
|
|
|
I am building a touch screen solution. Currently I have 4 forms, one for each piece I am trying to collect. However I have an "Enter your Name" with a textbox and a keypad on the Touch screen.
Form2 frm=new Form2(this.txtFName.Text);
frm.Show();
This is what I am doing for all my forms. Is there a way to keep it on 1 form and just change the controls without having to go to a different form?
Thanks
|
|
|
|
|
Hi,
you could design a Form with your keypad and add a panel to it. Then redesign all your other forms to be user controls instead. Then you can just add/remove those to/from the panel:
private void ShowNextControl(Control control) {
_panel.Clear();
control.Dock = DockStyle.Fill;
_panel.Controls.Add(control);
}
You could also make a base form with the keypad and inherit all other forms from this. The only issue with this is that the Visual Studio designer sometimes shows weird behaviour when working with inherited forms.
|
|
|
|
|
What language are touch screen applications ussualy written in? Should I attempt to write this app in Flash? Is having multiple forms bad software development?
So my base should be the keaboard and the empty space above it would be the actual text boxes. Do inherited forms behave weirldy at run time once the project is developmed?
Thanks for your insight.
|
|
|
|
|
oskardiazdeleon wrote: What language are touch screen applications ussualy written in?
Don't know. Haven't written one yet .
oskardiazdeleon wrote: Is having multiple forms bad software development?
In general not. I've just made a suggestion on how to solve your problem.
oskardiazdeleon wrote: Do inherited forms behave weirldy at run time once the project is developmed?
No its just a designer issue. Once everything is compiled no more weird behaviour. With 'weird' I mean that sometimes the designer moves controls around or is just removing them completely. I haven't found out when this happens but as I do rather complex GUIs at work it happens somehow regulary (probably 1-2 times per month). It seems to be related with the content of the inheriting form...
Robert
|
|
|
|
|
I have a FileBackup application which has a StatusBar and includes 2 StatusBarPanels.
When I minimize the FileBackup window and subsequently maximize it, the StatusBar status stops updating. This also occurs if another window takes focus and then focus is returned to the FileBackup window.
I have tried various things but as yet have not found out how to get the StatusBar to resume displaying updates.
Status messages fire a StatusBarEvent:
private void StatusBarEvent(object sender, FileBackup.StatusEventParams e)
{
if (e.Panel == 1)
{
statusBarPanel1.BeginInit();
statusBarPanel1.Text = e.Text;
statusBarPanel1.EndInit();
}
}
Any ideas?
|
|
|
|
|
|
I was under the impression that doing updates between a BeginInit and EndInit improved performance.
|
|
|
|
|