microsoft.public.dotnet.framework.clr Archive - June 2002
Post a message to this list
Messages
Page: 1
Windows Service - memory release (4 replies)
microsoft.public.dotnet.framework.clr
Hi, Having problems running the code below as a Windows Service. On my computer with 256 MB RAM, the service consumes about 100 MB. On our Server with 1GB RAM the Service uses between 200 400 MB! It seems like it eats all memory that is available. I've tried forcing garbage collection with GC.collect, closing everything, set objects to nothing but nothing helps. What am I missing? The service is c...
Reflection scenario: possible? (6 replies)
microsoft.public.dotnet.framework.clr
Here's a scenario that I would like to know is (or isn't possible). Let's say... I have a type that has a few fields. Some of the fields are value types, and others are reference to a custom type. e.g.: public class MyClass { public int someInt; public MyField myField1 new MyField(); public MyField myField2 new MyField(); } I instantiate the type and then pass it to a builder to complete some of t...
Programmatically changing configuration (2 replies)
microsoft.public.dotnet.framework.clr
I am writing test cases for a library I've built. Some classes require configuration parameters to be present (via the appSettings section of the .config file). I want to test for appropriate failures when the different configuration parameters are not present or invalid, but I don't want to have to stop the test, edit the .config file, and rerun the test for each scenario. The ConfigurationSettin...
AdjustTokenPrivileges Equivalent? (3 replies)
microsoft.public.dotnet.framework.clr
Is there an equivalent to AdjustTokenPrivileges in the CLR? I've dug around in System.Security but there seems no equivalent. I want to look up the current account name/SID (WindowsIdentity.GetCurrent) and add an SE * privilege to the running process/Appdomain. I suspect there might be something in SecurityPermissions, but it's not jumping out at me.
ManagementBaseObject threw an exception (4 replies)
microsoft.public.dotnet.framework.clr
Hi, I'm getting an exception when running on some NT systems and Windows 98. "The type initializer for "System.Management.ManagementBaseObject" threw an exception." It works fine on Windows 2000, XP and many NT systems. This is the code that is getting the problem: ManagementClass disks new ManagementClass ("Win32 LogicalDisk"); ManagementObjectCollection moc disks.GetInstances (); Does anyone hav...
Running code on a specific thread (3 replies)
microsoft.public.dotnet.framework.clr
I created a Windows Form app in C#, and have an options window that allows you to change settings. I set up a Global class to hold the settings for the options window to write to and the main form to read. This works fine. The problem is applying the settings. I have the following code: private void Customize Click(object sender, System.EventArgs e) { Global.Height board.Height; Global.Width board...
Reading fields from a structure at runtime (4 replies)
microsoft.public.dotnet.framework.clr
Hi I'm trying to read the fields from a structure at runtime. I'm using the following code public structur myStruct dim num as integer dim str as string dim val as decimal End Structure Dim aStcFields() As System.Reflection.FieldInfo Dim oVal As Object Dim fl As System.Reflection.FieldInfo aStcFields myStruct.GetType.GetFields For Each fl In aStcFields oVal fl.GetValue(myStruct) MessageBox.Show( o...
Convert.ToBoolean bug ? (2 replies)
microsoft.public.dotnet.framework.clr
Hi, I m trying to set the value of a boolean variable depending of the value of an XML node. The code below causes an error with the following message: "String was not recognized as a valid Boolean.". blnTrata Convert.ToBoolean(.ChildNodes (int32Passagem).SelectSingleNode ("inicio recalculo").InnerText) This kind of node always have "0" or "1" value to indicate whether to do something or not. Is t...
IDispose (3 replies)
microsoft.public.dotnet.framework.clr
Hi. I have a struct with one of the field in the struct referencing an object instance. The object inherits from the IDisposable interface so that it can be called by the GC when its no longer referenced. However, when the struct goes out of scope, the object that was referenced by the struct does not get invoked with the Dispose() even though no other struct (or object) references it. Shouldn't t...
What happens when an unhandled exception is thrown in a C# Destructor (2 replies)
microsoft.public.dotnet.framework.clr
Hi All, What will happen if an unhandled exception is thrown in a destructor. I want to know if GC is cleaning up the object whose Finalise() has thrown an unhandled exception. And what will happen to the other objects in the freachable queue. But it is interesting to know that the main thread is not terminated. C# Spec Sec 16.3 "Exceptions that occur during destructor execution are worth special ...
Get the filename of the DLL (2 replies)
microsoft.public.dotnet.framework.clr
I'm not sure this is the right group, but I hope it is... I want from inside a dll to know where it is located and what it's name is. I tried with Environment.GetCommandLine but it show's the exe's file. I wan't to use it to read from a file named .dll.config from the same directory. Basicly I want the assambleys name. /Andrei
Aborting Asynchronous Calls (4 replies)
microsoft.public.dotnet.framework.clr
I am calling a lengthy function asynchronously using delegates: IAsyncResult ar myDelegate.BeginInvoke(params, null, null); .... do stuff result myDelegate.EndInvoke(ar); My question is how do I prematurely abort the asynchronous call if I need to. For example my async call involes transfering a 10MB across the net but my user decides to abort this operation. I can just not call EndInvoke() but th...
starting app from a url ignores config file (5 replies)
microsoft.public.dotnet.framework.clr
To make deployment of my application easier, users start the windows application from a URL on a webserver. This works fine, except that the config file is ignored. It seems that the CLR only uses the config file when starting the exe directly from a directory ? Is their a way to force the reading of the application config file ?
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com