Common Language Runtime ForumDiscuss issues regarding the very core of .NET: Security, performance, hosting, base classes, interop, reliability, debugging, GC, and profiling are example topics.© 2009 Microsoft Corporation. All rights reserved.Sun, 29 Nov 2009 05:23:33 Z79d315f8-1308-498d-98ac-b200954bffddhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/734c8b73-beb0-4706-b126-cd6ed43f4813http://social.msdn.microsoft.com/Forums/en-US/clr/thread/734c8b73-beb0-4706-b126-cd6ed43f4813John Aschenbrennerhttp://social.msdn.microsoft.com/Profile/en-US/?user=John%20AschenbrennerAssembly.Load file and unloadingHi all,<br/><br/>One might think that using Assembly.Load to create an Assembly refernce in your program would get unloaded after the Assembly goes out of scope but from what I have read I am not so sure.  So given the code below does the Assembly get unloaded when the Assembly asm variable goes out of scope?<br/><br/> <pre lang="x-c#"> public AnamTest ReturnTest(string testType) { AnamTest test = null; Assembly asm = Assembly.LoadFile(&quot;C:\\!!CodeDOM\\TestTypes_20091128_11_22_22_693.dll&quot;); Type derivedType = asm.GetType(&quot;TestFactory.TestTypes.&quot; + testType); if (derivedType != null) { // if the type was found then create an instance of it test = (AnamTest)Activator.CreateInstance(derivedType); } return test; } </pre> <br/><br/>What I am thinking might be a good practice is to load the assembly into memory (byte[]) and make it only available from a Singleton.  Would that be a good practice?<br/><hr class="sig">Thanks, -ja Sat, 28 Nov 2009 19:50:34 Z2009-11-29T02:33:46Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/40c98fb3-71d5-47a3-8d67-cb1129346625http://social.msdn.microsoft.com/Forums/en-US/clr/thread/40c98fb3-71d5-47a3-8d67-cb1129346625pirshhttp://social.msdn.microsoft.com/Profile/en-US/?user=pirshI'm getting Fatal Execution Engine error (0x7927f206) when i start on the screen eppeares &quot;Fatal execution engine error&quot; (0x7027f206) &amp; clicking OK I got Problem Scan failed to start=-2147467259; clicking OK I got Process id=0x84(132), Thread id=0x94(148). Can youhelp me to get rid of this problem?Fri, 27 Nov 2009 05:34:38 Z2009-11-29T02:25:27Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/f6508259-fbfe-42ee-a9f1-dc4ccf56f64bhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/f6508259-fbfe-42ee-a9f1-dc4ccf56f64bchris1975http://social.msdn.microsoft.com/Profile/en-US/?user=chris1975Media Center not working anymore, something's wrong with .NET configurationHi, <br/> I am desperately trying to start Media Center again. <br/> The problems began as I updated Windows. After that I couldn't use the TV/Video function of Media Center anymore. <br/> I tried to google the error notification and it said that something is wrong with .NET. So I installed .NET 2.0, and after that did not work, I installed .NET 3.5. After that I cannot even open Media Center at all. <br/> The following messages appear: <br/> &quot;Fatal Execution Engine Error (0x7927f206)&quot;, after clicking &quot;OK&quot;: <br/> &quot;Application has generated an exception that could not be handled. Process id=0xf94 (3988), Thead id= 0x380 (896). Click CANCEL to debug the application&quot;.<br/> Having done that it says: <br/> &quot;Registered JIT debugger is not availabe. Error code of 0x2 (2). Pls check computer settings. cordbg.exe !a 0xf94)&quot; <br/> Anyone an idea what to do???<br/> Many thanks.<br/> ChrisSat, 28 Nov 2009 21:03:00 Z2009-11-28T21:03:03Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/e79deea5-9cbc-4f15-a0d7-7bbe0f96b9efhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/e79deea5-9cbc-4f15-a0d7-7bbe0f96b9efAjit Porlekarhttp://social.msdn.microsoft.com/Profile/en-US/?user=Ajit%20PorlekarHow to Get All Executed MethodsHello Masters,<br/> <br/>  I want to make one Exe which will help me to find out which are the Methods are getting Executed by the application.<br/> In this I will attach the Process(another exe) and from my Exe I have to get all the methos executed by that exe.<br/> Is it possible??<br/> <br/> Thanks <br/> Ajit<br/>Fri, 27 Nov 2009 13:34:43 Z2009-11-28T16:56:46Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/3325cb32-371b-4f3e-965f-6ca88538dc3ehttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/3325cb32-371b-4f3e-965f-6ca88538dc3eMarkus Lederhttp://social.msdn.microsoft.com/Profile/en-US/?user=Markus%20LederThreadPool deadlock? Throttling issue?<font size=2> <p>We are in the process of setting up a new project, using WCF. However, we found out that the problem we experience below is related to the CLR ThreadPool and most certainly not to WCF - that's why I'm posting it here.</p> <p align=left> </p> <p>Our application has the following layout:</p> <p>[Clients (1-70)] calls [WCF Service (workflow and service orchestrations)] calls [WCF Service (basic hardware device controlling)]</p> <p align=left> </p> <p>We are running custom load tests which are (request/response and one-way) sending random data to the services for now.</p> <p> </p> <p align=left>If a certain amount of load is reached, the services stop responding. No more service calls are dispatched to service instances (</font><font face="Courier New" size=2>InstanceContextMode = </font><font face="Courier New" color="#2b91af" size=2>InstanceContextMode</font><font face="Courier New" size=2>.PerSession, ConcurrencyMode = </font><font face="Courier New" color="#2b91af" size=2>ConcurrencyMode</font><font face="Courier New" size=2>.Multiple)). NetTcp / message security. Windows XP SP2 or Vista. Framework 3.5.</p></font><font size=2> <p><font color="#ff0000">Operation calls are hanging for up to 12 seconds (average 3-5). 0% CPU activity. Process thread count going up 2 / sec. WCF outstanding calls increasing.</font></p> <p>Then the CPU% will go up to 100% and after that the processing will continue normally.</p> <p align=left> </p> <p>The problem is independent of the distribution of the services across machines.</p> <p>It'll happen on a single machine as well as on a distributed system with one machine per process.</p> <p>The problem will not happen if there is no call to the second service, i.e. when there is only one service. No garbage collection, WCF/TCP throttling or custom code deadlock issues.</p> <p> </p> <p align=left>The problem is load dependent. It will happen when about 40 requests per second are running. Message sizes 50 - 500000 bytes.</p> <p align=left> </p></font><font face=Arial size=2> <p><font color="#ff0000">We replaced the CLR thread pool by IDesign's (Juval's) ThreadPoolSynchronizer (100) as the WCF service SynchronizationContext and the &quot;blocking&quot; is gone!</font></p> <p align=left><font color="#ff0000"></font> </p> <p align=left>Our ideas were that the problem arises with the CLR thread pool throttling (adding &quot;only&quot; 2 threads per second to pool, where the created threads are getting consumed by new pending operation calls immediately).</p> <p align=left> </p> <p align=left>-&gt; Any ideas, what's wrong with the CLR ThreadPool, especially under WCF high performance situations?</p> <p align=left>-&gt; What is the recommende best practice?</p> <p align=left> </p> <p align=left>Thanks,</p> <p align=left>Markus</font></p>Tue, 04 Mar 2008 13:53:07 Z2009-11-28T01:30:06Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/bdbc67fd-a908-48ff-8f6f-7f55782ed3ebhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/bdbc67fd-a908-48ff-8f6f-7f55782ed3ebDynamichttp://social.msdn.microsoft.com/Profile/en-US/?user=DynamicHow to Catch the Application_Error in a Windows Service?I have created a Windows Service which has start and stop methods and some other functionalities. <div><br/></div> <div>I need to capture the Application_Error globally throughout the windows service when it happens. Is that possible?</div> <div><br/></div> <div>Something like Application_Error in global.ascx file of an ASP.NET app.</div>Tue, 24 Nov 2009 15:10:07 Z2009-11-27T23:45:35Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/78ea033d-b111-412d-9511-b06837223b81http://social.msdn.microsoft.com/Forums/en-US/clr/thread/78ea033d-b111-412d-9511-b06837223b81Amit Popathttp://social.msdn.microsoft.com/Profile/en-US/?user=Amit%20PopatUnloadable Plugin ArchitectureThis is my first question here, so apologies if I have made a mistake.<br/> <br/> I am developing a collection of small games using WPF with C# but have been having real difficulty in being able to load and unload each game into my main viewer application.<br/> <br/> The structure of my program is I have a main view application <strong>GameViewer.EXE</strong> which basically consists of a Frame object to view pages.<br/> Each game is a custom class GamePage.CS, shown below:<br/> <br/> <strong><span style="text-decoration:underline">GameLibrary.DLL</span> </strong> <br/> <br/> namespace GameLibrary<br/> {<br/>  public class GamePage : Page<br/>     {<br/>         public Guid GameID;<br/>         public string GameName;<br/>         public string Description;<br/>         public virtual void PauseGame(){}<br/> <br/>        public event GameEndArgsEventHandler GameEnd;<br/> <br/>         protected void OnGameEnd(GameEndArgs e)<br/>         {<br/>             if (GameEnd != null)<br/>                 GameEnd(this, e);<br/>         }<br/>    }<br/> <br/>  public class GameEndArgs : EventArgs<br/>     {<br/>         public double Score;<br/>         public bool Finished;<br/>         public int Level = 1;<br/>     }<br/> }<br/> <br/> <br/> I also have a <strong>ControlLibrary.DLL</strong> , which contains a collection of stylized controls, i.e. customs, sliders, etc., which is used in all games and the main interface GameViewer.EXE.<br/> <br/> The structure of the application is:<br/> <br/> Home\<br/>          GameViewer.EXE<br/>          GameLibrary.DLL<br/>          ControlLibrary.DLL<br/>  <br/>         Games\<br/>                   Game1\<br/>                              game1.DLL<br/>                              game1Dependency1.DLL<br/>                              game1Dependency2.DLL<br/>                   Game2\<br/>                             game2.DLL<br/>                   Game3\<br/>                             game3.DLL<br/>                             image\<br/>                      ...<br/>                  Game n<br/> <br/> <br/> My trouble is being able to load then successfully unload each game DLL into my main viewer. I have been reading dozen of threads, but I cannot seem to get anything to work. I am trying to create a new AppDomain load the assembly in there and create the GamePage object.<br/> - I can then unload the appdomain when the game is finished, but on repeated opening and closing the game I see the memory usuage shoot up, so something is going wrong.<br/> - I have also tried creating a separate loader, using the MarshalByRefObject, but on returning a GamePage I am told that GamePage is not Serializable.<br/> <br/> This is my current attempt:<br/> <br/> In the GameLibrary.DLL I have:<br/> <br/> namespace GameLibrary<br/> {<br/>      [Serializable]<br/>       public class Factory<br/>       {<br/>           public GamePage CreateGamePageObject(string path, string typename)<br/>           {<br/>               return Activator.CreateInstanceFrom(path, typename).Unwrap() as GamePage;<br/>            }<br/>       }<br/> }<br/> <br/> Then in the my app I have:<br/> <br/>         private AppDomain domain  =null;<br/> <br/>          void LoadGame(string GameFile)<br/>           {<br/>                 domain = AppDomain.CreateDomain(&quot;Remote Load&quot;);<br/> <br/>                 ObjectHandle oh = domain.CreateInstance(&quot;GameLibrary&quot;, &quot;GameLibrary.Factory&quot;);<br/>                 Object obj = oh.Unwrap();<br/>                 GameLibrary.Factory f = obj as GameLibrary.Factory;<br/>                 GameLibrary.GamePage addIn=null;<br/> <br/>                 FileInfo fi = new FileInfo(GameFile);<br/>                addIn =f.CreateGamePageObject(fi.FullName, fi.Name.Substring(0, fi.Name.Length - 4) + &quot;.Page1&quot;);<br/> <br/>                 MainFrame.Content = addIn;<br/>           }<br/>          void UnloadGame()<br/>          {<br/>                MainFrame.Content = null;<br/>                AppDomain.Unload(domain);<br/>          }<br/> <br/> <br/> The trouble with this is the memory leak.<br/> <br/> I would greatly appreciate any help and suggestions.<br/>Thu, 26 Nov 2009 13:03:13 Z2009-11-27T17:29:19Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/08f25d30-5af5-43a5-a762-134879f25b25http://social.msdn.microsoft.com/Forums/en-US/clr/thread/08f25d30-5af5-43a5-a762-134879f25b25a_halanhttp://social.msdn.microsoft.com/Profile/en-US/?user=a_halanw3wp.exe high mem usage, hangHi,<br/>I have windows 2003 server standard edition SP2 running with IIS services. On starting, the w3wp.exe process consumes about 12-16000 K of memory as shown in the task manager After few hours of running the w3wp.exe process when the memory usages reaches 29-30000 K, the process hangs the server. the only possible solution is to either restart the server where all the users have to relogin or another aption is to kill the process. On killing the process, the w3wp.exe starts automatically immediately. I tried replacing the w3wp.exe file from another server and also isolated &amp; scanned the whole server for viruses, but the problem still persists. please help resolving this issue.Fri, 27 Nov 2009 12:32:35 Z2009-11-27T13:07:42Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/0fcb5bb1-0cd8-40e4-96d9-f0cb8b6cdbdfhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/0fcb5bb1-0cd8-40e4-96d9-f0cb8b6cdbdfBajarehttp://social.msdn.microsoft.com/Profile/en-US/?user=BajareSoftware crash: faulting module mscorwks.dll, version 1.1.4322.2379Hi,<br/> <br/> I am working on software which crashes in 5-10mins after starting it. The software is built with .Net framework 1.1 as target. .Net framework 2.0, 3.0, 3.5 is also installed on the machine. I am logging exceptions in the Windows event viewer in the catch block at every possible location in the code. I have subscribed to UnhandledException also. But, when the software crashes, no exception is caught. <br/> <br/> The software crashes only on Windows Server 2003 and works fine on Windows XP.<br/> <br/> Sometimes, error event is logged by .Net Runtime as follow:<br/> <br/> ----------------------------------------------<br/> Event Type:    Information<br/> Event Source:    Application Error<br/> Event Category:    (100)<br/> Event ID:    1004<br/> Date:        11/3/2009<br/> Time:        11:23:53 AM<br/> User:        N/A<br/> Computer:    &lt;Machine Name&gt;<br/> Description:<br/> Faulting application &lt;Software Name&gt;, version &lt;Software Version&gt;, faulting module mscorwks.dll, version 1.1.4322.2379, fault address 0x00007f2c.<br/> ----------------------------------------------<br/> <br/> <br/> It was looking like there is some .Net Runtime error/bug which is causing the problem. So, I rebuilt the software with .Net framework 2.0 as target. Still, software crashes and Runtime logs the same kind of exception.<br/> <br/> ----------------------------------------------<br/> Event Type:    Error<br/> Event Source:    .NET Runtime<br/> Event Category:    None<br/> Event ID:    1023<br/> Date:        11/4/2009<br/> Time:        10:12:45 PM<br/> User:        N/A<br/> Computer:    &lt;Machine Name&gt;<br/> Description:<br/> .NET Runtime version 2.0.50727.3053 - Fatal Execution Engine Error (7A097706) (80131506)<br/> <br/> <br/> Event Type:    Error<br/> Event Source:    .NET Runtime 2.0 Error Reporting<br/> Event Category:    None<br/> Event ID:    1000<br/> Date:        11/4/2009<br/> Time:        10:13:12 PM<br/> User:        N/A<br/> Computer:    &lt;Machine Name&gt;<br/> Description:<br/> Faulting application &lt;Software Name&gt;, version &lt;Software Version&gt;, stamp 4af1822b, faulting module mscorwks.dll, version 2.0.50727.3053, stamp 4889dc18, debug? 0, fault address 0x0000c214<br/> ----------------------------------------------<br/> <br/> I also tried to get the dumps using WinDbg and DebugDiag, but both WinDbg and DebugDiag do not get a chance to dump when software crashes. DebugDiag logged some First Chance Exceptions... some common stack traces are as follows:<br/> <br/> 1) <br/>  <br/> <table class=mycustomText border=0 cellspacing=0 cellpadding=0> <tbody> <tr> <th>Function</th> <th>    Arg 1</th> <th>    Arg 2</th> <th>    Arg 3</th> <th>  Source</th> </tr> <tr> <td>mscorwks!gc_heap::update_brick_table+86</td> <td>    <span style="font-family:courier new">020600c4</span></td> <td>    <span style="font-family:courier new">000018c0</span></td> <td>    <span style="font-family:courier new">b98dcd28</span></td> <td>  </td> </tr> <tr> <td>mscorwks!gc_heap::plan_phase+3cb</td> <td>    <span style="font-family:courier new">00000000</span></td> <td>    <span style="font-family:courier new">00000000</span></td> <td>    <span style="font-family:courier new">00000000</span></td> <td>  </td> </tr> <tr> <td>mscorwks!gc_heap::gc1+9c</td> <td>    <span style="font-family:courier new">00000000</span></td> <td>    <span style="font-family:courier new">00000000</span></td> <td>    <span style="font-family:courier new">00000000</span></td> <td>  </td> </tr> <tr> <td>mscorwks!gc_heap::garbage_collect+1bf</td> <td>    <span style="font-family:courier new">00000000</span></td> <td>    <span style="font-family:courier new">00000000</span></td> <td>    <span style="font-family:courier new">00000000</span></td> <td>  </td> </tr> <tr> <td>mscorwks!GCHeap::GarbageCollectGeneration+11b</td> <td>    <span style="font-family:courier new">00000000</span></td> <td>    <span style="font-family:courier new">00000000</span></td> <td>    <span style="font-family:courier new">00000028</span></td> <td>  </td> </tr> <tr> <td>mscorwks!gc_heap::allocate_more_space+13a</td> <td>    <span style="font-family:courier new">0015dcc0</span></td> <td>    <span style="font-family:courier new">00000028</span></td> <td>    <span style="font-family:courier new">00000000</span></td> <td>  </td> </tr> <tr> <td>mscorwks!GCHeap::Alloc+5f</td> <td>    <span style="font-family:courier new">0015dcc0</span></td> <td>    <span style="font-family:courier new">00000028</span></td> <td>    <span style="font-family:courier new">00000002</span></td> <td>  </td> </tr> <tr> <td>mscorwks!Alloc+3a</td> <td>    <span style="font-family:courier new">00000028</span></td> <td>    <span style="font-family:courier new">00000000</span></td> <td>    <span style="font-family:courier new">00040000</span></td> <td>  </td> </tr> <tr> <td>mscorwks!AllocateArrayEx+161</td> <td>    <span style="font-family:courier new">00f91022</span></td> <td>    <span style="font-family:courier new">0012eec4</span></td> <td>    <span style="font-family:courier new">00000001</span></td> <td>  </td> </tr> <tr> <td>mscorwks!JIT_NewArr1+bb</td> <td>    <span style="font-family:courier new">021394f0</span></td> <td>    <span style="font-family:courier new">00000002</span></td> <td>    <span style="font-family:courier new">038e58bc</span></td> <td>  </td> </tr> <tr> <td>0x038e5963</td> <td>    <span style="font-family:courier new">014a0190</span></td> <td>    <span style="font-family:courier new">0000000b</span></td> <td>    <span style="font-family:courier new">01492f98</span></td> <td>  </td> </tr> <tr> <td>0x0563761e</td> <td>    <span style="font-family:courier new">0012f238</span></td> <td>    <span style="font-family:courier new">056ab7a8</span></td> <td>    <span style="font-family:courier new">0012f3c8</span></td> <td>  </td> </tr> <tr> <td>0x056370c3</td> <td>    <span style="font-family:courier new">0012f3c8</span></td> <td>    <span style="font-family:courier new">014dcb64</span></td> <td>    <span style="font-family:courier new">01ce62a4</span></td> <td>  </td> </tr> <tr> <td>0x056aaf61</td> <td>    <span style="font-family:courier new">01ce62a4</span></td> <td>    <span style="font-family:courier new">014dcb64</span></td> <td>    <span style="font-family:courier new">01ce62a4</span></td> <td>  </td> </tr> <tr> <td>system_windows_forms_7b810000+726b1</td> <td>    <span style="font-family:courier new">00000001</span></td> <td>    <span style="font-family:courier new">00100000</span></td> <td>    <span style="font-family:courier new">00000000</span></td> <td>  </td> </tr> <tr> <td>system_windows_forms_7b810000+134b0</td> <td>    <span style="font-family:courier new">7b822a5b</span></td> <td>    <span style="font-family:courier new">7b822a3c</span></td> <td>    <span style="font-family:courier new">00000000</span></td> <td>  </td> </tr> <tr> <td>system_windows_forms_7b810000+13036</td> <td>    <span style="font-family:courier new">000a02f6</span></td> <td>    <span style="font-family:courier new">00000202</span></td> <td>    <span style="font-family:courier new">00000000</span></td> <td>  </td> </tr> <tr> <td>user32!InternalCallWinProc+28</td> <td>    <span style="font-family:courier new">0582997e</span></td> <td>    <span style="font-family:courier new">000a02f6</span></td> <td>    <span style="font-family:courier new">00000202</span></td> <td>  </td> </tr> <tr> <td>user32!UserCallWinProcCheckWow+151</td> <td>    <span style="font-family:courier new">00000000</span></td> <td>    <span style="font-family:courier new">0582997e</span></td> <td>    <span style="font-family:courier new">000a02f6</span></td> <td>  </td> </tr> <tr> <td>user32!DispatchMessageWorker+327</td> <td>    <span style="font-family:courier new">0012f5b0</span></td> <td>    <span style="font-family:courier new">00000000</span></td> <td>    <span style="font-family:courier new">0012f5e4</span></td> <td>  </td> </tr> <tr> <td>user32!DispatchMessageW+f</td> <td>    <span style="font-family:courier new">0012f5b0</span></td> <td>    <span style="font-family:courier new">000a02f6</span></td> <td>    <span style="font-family:courier new">0012f5b0</span></td> <td>  </td> </tr> <tr> <td>0x038604ca</td> <td>    <span style="font-family:courier new">00000000</span></td> <td>    <span style="font-family:courier new">ffffffff</span></td> <td>    <span style="font-family:courier new">016078d0</span></td> <td>  </td> </tr> <tr> <td>system_windows_forms_7b810000+1dbea</td> <td>    <span style="font-family:courier new">0143efc8</span></td> <td>    <span style="font-family:courier new">015cc644</span></td> <td>    <span style="font-family:courier new">01607890</span></td> <td>  </td> </tr> <tr> <td>system_windows_forms_7b810000+1d905</td> <td>    <span style="font-family:courier new">0143efc8</span></td> <td>    <span style="font-family:courier new">00000000</span></td> <td>    <span style="font-family:courier new">015cc644</span></td> <td>  </td> </tr> <tr> <td>system_windows_forms_7b810000+418e4</td> <td>    <span style="font-family:courier new">0012f7b4</span></td> <td>    <span style="font-family:courier new">7923e0bc</span></td> <td>    <span style="font-family:courier new">0012f6f0</span></td> <td>  </td> </tr> <tr> <td>mscorwks!CallDescrWorker+30</td> <td>    <span style="font-family:courier new">0012f6f0</span></td> <td>    <span style="font-family:courier new">00000000</span></td> <td>    <span style="font-family:courier new">0012f6c8</span></td> <td>  </td> </tr> <tr> <td>mscorwks!MethodDesc::CallDescr+1b8</td> <td>    <span style="font-family:courier new">00cc5a3b</span></td> <td>    <span style="font-family:courier new">00163e90</span></td> <td>    <span style="font-family:courier new">0012f7e0</span></td> <td>  </td> </tr> <tr> <td>mscorwks!MethodDesc::CallDescr+4f</td> <td>    <span style="font-family:courier new">00cc5a3b</span></td> <td>    <span style="font-family:courier new">00163e90</span></td> <td>    <span style="font-family:courier new">00705a42</span></td> <td>  </td> </tr> <tr> <td>mscorwks!MethodDesc::Call+97</td> <td>    <span style="font-family:courier new">0012f928</span></td> <td>    <span style="font-family:courier new">00000000</span></td> <td>    <span style="font-family:courier new">0015dc88</span></td> <td>  </td> </tr> <tr> <td>mscorwks!ClassLoader::CanAccess+207</td> <td>    <span style="font-family:courier new">00cc5a40</span></td> <td>    <span style="font-family:courier new">00000001</span></td> <td>    <span style="font-family:courier new">00000000</span></td> <td>  </td> </tr> <tr> <td>mscorwks!ClassLoader::ExecuteMainMethod+49d</td> <td>    <span style="font-family:courier new">00163e90</span></td> <td>    <span style="font-family:courier new">00000000</span></td> <td>    <span style="font-family:courier new">003a1394</span></td> <td>  </td> </tr> <tr> <td>mscorwks!Assembly::ExecuteMainMethod+21</td> <td>    <span style="font-family:courier new">00000000</span></td> <td>    <span style="font-family:courier new">0012fd70</span></td> <td>    <span style="font-family:courier new">00000000</span></td> <td>  </td> </tr> <tr> <td>mscorwks!SystemDomain::ExecuteMainMethod+421</td> <td>    <span style="font-family:courier new">00000000</span></td> <td>    <span style="font-family:courier new">00000001</span></td> <td>    <span style="font-family:courier new">0012ffe0</span></td> <td>  </td> </tr> <tr> <td>mscorwks!ExecuteEXE+1ce</td> <td>    <span style="font-family:courier new">8013141b</span></td> <td>    <span style="font-family:courier new">00000000</span></td> <td>    <span style="font-family:courier new">00000000</span></td> <td>  </td> </tr> <tr> <td>mscorwks!_CorExeMain+59</td> <td>    <span style="font-family:courier new">00000000</span></td> <td>    <span style="font-family:courier new">791b0000</span></td> <td>    <span style="font-family:courier new">0012fff0</span></td> <td>  </td> </tr> <tr> <td>mscoree+11b5f</td> <td>    <span style="font-family:courier new">00000000</span></td> <td>    <span style="font-family:courier new">00000000</span></td> <td>    <span style="font-family:courier new">7ffda000</span></td> <td>  </td> </tr> <tr> <td>kernel32!BaseProcessStart+23</td> <td>    <span style="font-family:courier new">79011b2b</span></td> <td>    <span style="font-family:courier new">00000000</span></td> <td>    <span style="font-family:courier new">78746341</span></td> <td> </td> </tr> </tbody> </table> <br/> <br/> 2)<br/> <br/> <br/> <table class=myCustomText border=0 cellspacing=0 cellpadding=0> <tbody> <tr> <td>Entry point</td> <td>  <strong>mscorwks!Thread::intermediateThreadProc</strong></td> </tr> <tr> <td>Create time</td> <td>  <strong>11/3/2006 6:10:13 PM</strong></td> </tr> <tr> <td>Time spent in user mode</td> <td>  <strong>0 Days 0:0:0.421</strong></td> </tr> <tr> <td>Time spent in kernel mode</td> <td>  <strong>0 Days 0:0:0.62</strong></td> </tr> </tbody> </table> <br/> <br/> <table class=mycustomText border=0 cellspacing=0 cellpadding=0> <tbody> <tr> <th>Function</th> <th>    Arg 1</th> <th>    Arg 2</th> <th>    Arg 3</th> <th>  Source</th> </tr> <tr> <td>mscorwks!Object::GetAppDomain+2</td> <td>    <span style="font-family:courier new">77e670b2</span></td> <td>    <span style="font-family:courier new">00000000</span></td> <td>    <span style="font-family:courier new">00000000</span></td> <td>  </td> </tr> <tr> <td>mscorwks!CallFinalizer+225</td> <td>    <span style="font-family:courier new">01c23fac</span></td> <td>    <span style="font-family:courier new">00000000</span></td> <td>    <span style="font-family:courier new">00000000</span></td> <td>  </td> </tr> <tr> <td>mscorwks!GCHeap::FinalizerThreadStart+c2</td> <td>    <span style="font-family:courier new">00000000</span></td> <td>    <span style="font-family:courier new">80911708</span></td> <td>    <span style="font-family:courier new">7ffdd000</span></td> <td>  </td> </tr> <tr> <td>mscorwks!Thread::intermediateThreadProc+44</td> <td>    <span style="font-family:courier new">001626c0</span></td> <td>    <span style="font-family:courier new">00000000</span></td> <td>    <span style="font-family:courier new">00000000</span></td> <td>  </td> </tr> <tr> <td>kernel32!BaseThreadStart+34</td> <td>    <span style="font-family:courier new">791ced9f</span></td> <td>    <span style="font-family:courier new">001626c0</span></td> <td>    <span style="font-family:courier new">00000000</span></td> <td>  </td> </tr> </tbody> </table> <br/> <br/> <br/> Thanks in Adavance.<br/> <br/> Regards,<br/> Bajare<br/> <br/>Wed, 11 Nov 2009 09:27:47 Z2009-11-27T10:32:52Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/dc791197-c59d-4dfe-839e-79ef162026achttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/dc791197-c59d-4dfe-839e-79ef162026acJoost van den Boomhttp://social.msdn.microsoft.com/Profile/en-US/?user=Joost%20van%20den%20BoomProblem marshalling byte[] to COM objectI have a legacy COM library that defines a couple of classes, one of them having a method ReadBytes(int nrOfBytes, byte* data), where bytes is a pointer to the memory location where the bytes should be placed.<br/> <br/> When referenced in my C# project, the generated method wrapper becomes ReadBytes(int nrOfBytes, ref byte data). This won't work.<br/> <br/> I tried disassembling the dll, changing the signature and assembling back to a dll. I couldn't make it work.<br/> <br/> I tried using Marshal.AllocHGlobal to allocate unmanaged memory, but couldn't find a way to pass a pointer to the method.<br/> <br/> Any suggestions?Wed, 18 Nov 2009 13:58:21 Z2009-11-27T08:15:47Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/c2344b2a-0efb-43b0-83ec-f78b4f53585bhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/c2344b2a-0efb-43b0-83ec-f78b4f53585bGreg Hardin VGEhttp://social.msdn.microsoft.com/Profile/en-US/?user=Greg%20Hardin%20VGEIssue with EventLog under Vista/7 and Dev Web Server<p>Since we upgraded all of our developer boxes to Windows 7, we've had trouble executing our web projects locally under Cassini. <br/><br/>I've seen this issue in Vista, too, I believe.<br/><br/>What happens is that any attempt to write to the event log running under Cassini results in an Win32Exception with the error message &quot;The parameter isincorrect.&quot; So far, I can only get this code to run when running as an Administrator. I'm not sure why writing to the event log should require elevation, but it seems to.<br/><br/>Here's the code:<br/><br/>Public Class EventLogger<br/>    Public Const EVENTLOGGER_SOURCE As String = &quot;My Web App&quot;</p> <p>    Public Shared Sub CheckLogSource()<br/>        If Not System.Diagnostics.EventLog.SourceExists(EVENTLOGGER_SOURCE) Then<br/>            System.Diagnostics.EventLog.CreateEventSource(EVENTLOGGER_SOURCE, &quot;Application&quot;)<br/>        End If<br/>    End Sub</p> <p>    Public Shared Sub LogInformationalMessage(ByVal message As String)<br/>        System.Diagnostics.EventLog.WriteEntry(EVENTLOGGER_SOURCE, message, System.Diagnostics.EventLogEntryType.Information)<br/>    End Sub</p> <p>End Class<br/><br/>Calling LogInformationalMessage with any value causes the exception.<br/><br/>To get around this, for the time being, I've commented out the call to WriteEntry...but I don't think that's a long term solution. Does anybody know what I need to do to get this working?</p>Tue, 03 Nov 2009 16:51:39 Z2009-11-27T07:43:52Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/b08634a4-f432-47d0-aa57-d35ebfac998chttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/b08634a4-f432-47d0-aa57-d35ebfac998cMariaBJShttp://social.msdn.microsoft.com/Profile/en-US/?user=MariaBJSPublisher Configuration Printer<span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small"><span style="font-size:xx-small"> Hello, when I open a Publisher document, I can go to  File-&gt; Printer Configuration and change the Size (A4, A3, etc). I would like to change the value of this field by code.</span> The printer object (of Publisher) has a property which is PageSize but it is only of reading and It doesn't allow me to change the value. As you can see in the code, It's possible to change the document size but I need to change the printer configuration size.  ¿Could somebody help me,please? Regards and thanks<br/><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small"><br/>Imports</span></span><span style="font-size:x-small"><span style="color:#000000"> Microsoft.Office.Interop.Publisher</span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small"><span style="font-size:x-small"> <p>......</p> </span><br/>Dim</span></span></span><span style="font-size:xx-small">  </span></span></span><span style="font-size:xx-small"><span style="font-size:x-small">pbPrinter, pbMyPrinter </span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">As</span></span></span><span style="font-size:x-small"><span style="font-size:xx-small"> Printer</span><span style="font-size:x-small"> <span style="font-size:x-small"><font size=2> <p> </p> </font></span></span> <p> </p> <p> </p> </span><span style="font-size:xx-small"><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">Dim</span></span><span style="font-size:x-small"> appDoc </span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">As</span></span><span style="font-size:x-small"> </span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">New</span></span></span><span style="font-size:x-small"><span style="font-size:xx-small"> Microsoft.Office.Interop.Publisher.Document</span><span style="font-size:x-small"> <span style="font-size:x-small"><font size=2> <p> </p> </font></span></span></span><span style="font-size:xx-small"><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">Dim</span></span><span style="font-size:x-small"> appPub </span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">As</span></span><span style="font-size:x-small"> Microsoft.Office.Interop.Publisher.Application = </span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">New</span></span></span><span style="font-size:x-small"><span style="font-size:xx-small"> Microsoft.Office.Interop.Publisher.Application</span><span style="font-size:x-small"> <p>appDoc = appPub.Open(</p> </span></span> <p> </p> <p><span style="font-size:xx-small"><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">My</span></span><span style="font-size:x-small">.Application.Info.DirectoryPath &amp; </span><span style="color:#a31515;font-size:x-small"><span style="color:#a31515;font-size:x-small">&quot;\Publi.pub&quot;</span></span><span style="font-size:x-small">, </span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">False</span></span><span style="font-size:x-small">, </span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">False</span></span></span><span style="font-size:x-small"><span style="font-size:xx-small">, PbSaveOptions.pbDoNotSaveChanges)</span><span style="font-size:x-small"> <span style="font-size:x-small"><font size=2> <p>appPub.ActiveWindow.Visible =</p> </font></span></span></span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small"><span style="font-size:xx-small">True<br/></span></span></span></p> <p> </p> <span style="font-size:x-small"><span style="font-size:x-small"> <p>appPub.ActiveDocument.PageSetup.PageHeight = appPub.MillimetersToPoints(55.7)</p> <p>appPub.ActiveDocument.PageSetup.PageWidth = appPub.MillimetersToPoints(39.4)</p> </span></span><span style="color:#008000;font-size:x-small"><span style="color:#008000;font-size:x-small">.....<br/></span></span>Thu, 26 Nov 2009 11:42:01 Z2009-11-27T02:22:59Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/01e2d840-4581-4fa5-93c0-3bb25ffbf857http://social.msdn.microsoft.com/Forums/en-US/clr/thread/01e2d840-4581-4fa5-93c0-3bb25ffbf857CSharpNooblethttp://social.msdn.microsoft.com/Profile/en-US/?user=CSharpNoobletEnable JIT debuggingHello,<br/> <br/> I am running an obfuscated executable, which is proving a nightmare to debug.<br/> Anyway, it would be helpful if JIT debugging would work as intended, or if my brain would at least work as intended.<br/> <br/> I have enabled JIT debugging through VS (tools&gt;options etc) which is running it admin mode.<br/> I have also added the line   &lt;system.windows.forms jitDebugging=&quot;true&quot;/&gt; in the &lt;configuration&gt; section of my app.config file.<br/> <br/> Both these solutions still pop up the standard unhandled exception dialog that gives me the stack trace and how to enable JIT debugging.<br/> <br/> I have run the application as admin and still get the same result.<br/> <br/> I have added the   &lt;system.windows.forms jitDebugging=&quot;true&quot;/&gt; line to machine.config and the build does not work &quot;configuration system failed to initialize.&quot;<br/> <br/> Any thoughts? <br/> <br/> Thanks!Thu, 26 Nov 2009 02:53:00 Z2009-11-26T20:30:12Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/2ad5a456-035c-4df3-9575-eb72d109d9d6http://social.msdn.microsoft.com/Forums/en-US/clr/thread/2ad5a456-035c-4df3-9575-eb72d109d9d6Palinghttp://social.msdn.microsoft.com/Profile/en-US/?user=PalingRemove Resource managerI created an multilanguage application. This is done with the resource manager in C#. Now I'm having a lot of problems with different clients that run the application because of the resource manager and their version of Windows. Is it possible to delete the resource manager easily and return to a single language application?Thu, 26 Nov 2009 11:36:56 Z2009-11-26T16:51:17Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/0950aace-510b-4ca9-963c-00ceb8c8203chttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/0950aace-510b-4ca9-963c-00ceb8c8203cDennis Cheunghttp://social.msdn.microsoft.com/Profile/en-US/?user=Dennis%20%20CheungHow I get securityexception when I am running my .NET 3.5 SP1 application from network drive?<p>My C# application (.NET 3.5 SP1) works very well when if execeuted from local drive.</p> <p>However, if I run it from a network drive, it execute (IT IS .NET 3.5 SP1), but failed to read a file located on the same network drive, during <strong>File.ReadAllText</strong>.</p> <p>If it matter, the folder structure is like the following</p> <pre class=prettyprint><code><span class=pun>\\</span><span class=pln>server</span><span class=pun>\</span><span class=pln>myshare</span><span class=pun>\</span><span class=pln>ABC</span><span class=pun>\</span><span class=pln>app</span><span class=pun>.</span><span class=pln>exe  </span><span class=pun>\\</span><span class=pln>server</span><span class=pun>\</span><span class=pln>myshare</span><span class=pun>\</span><span class=pln>DEF</span><span class=pun>\</span><span class=pln>xxx</span><span class=pun>.</span><span class=pln>txt  </span></code></pre> <p>I guess this is some security feature applied by .NET, they remove the &quot;execution&quot; limit since SP1 but the rights is not as exactly as a local application, still.</p> <p>I've search around but I cannot find what's happening and what the limits are if you run it remotely.</p> <p>It is a CONSOLE APPLICATION with command line argument, if it matter.</p>Thu, 26 Nov 2009 01:52:52 Z2009-11-26T15:31:02Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/ab52afa1-6f0a-4882-a28e-af22f630e625http://social.msdn.microsoft.com/Forums/en-US/clr/thread/ab52afa1-6f0a-4882-a28e-af22f630e625GregJFhttp://social.msdn.microsoft.com/Profile/en-US/?user=GregJFGabage Collection and my classesFolks<br/> if I write a class with one method that class has a base of System.Object. which has a Finalie protected method.<br/> When I use that class as an instance, does Gabage Collection place that object in the finalize queue, even though it never uses unmanaged code or large members?<br/> <br/> Also can anybody explain what happens to small objects that have a long life (5 mins) in the garbage collection process.<br/> <br/> <br/> regards<br/> <br/> GregJFThu, 19 Nov 2009 10:13:20 Z2009-11-27T08:38:32Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/12b75853-622a-4a9f-b3bd-f0f6cb8579bchttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/12b75853-622a-4a9f-b3bd-f0f6cb8579bccme0848http://social.msdn.microsoft.com/Profile/en-US/?user=cme0848How to pass a character array by tracking referenceI have an unmanaged COM object that I converted to a .NET wrapper using Tlbimp.exe so I could use it with a CLR C++ console application. The prototype for 'GetCOMServerNameAndVersion(signed char %name, float %version)'.<br/><br/>1) How do i pass a character array by tracking reference(%)? The example below fails to compile resulting in &quot;<span style="font-size:xx-small">cannot convert parameter 1 from 'char' to 'signed char %' &quot;</span><br/>2) Perhaps there's an easier way to declare my class thus gaining access to my methods. Any suggestions here would be appreciated as well.<br/><br/> <pre>using namespace System; using namespace COMSERVERLib; int main(array&lt;System::String ^&gt; ^args) { COMSERVERLib::DataClass ^ m_pIData; m_pIData = gcnew COMSERVERLib::Data; int nGroups; int nItems; char nName[100]; float fVersion; m_pIData-&gt;GetNumberOfGroups(nGroups ); m_pIData-&gt;GetNumberOfDataItems(0,nItems); m_pIData -&gt;GetCOMServerNameAndVersion(nName, &amp;fVersion); Console::WriteLine(&quot;The number of groups is &quot;+ nGroups.ToString() + &quot; and items is &quot; + nItems.ToString()); Console::ReadKey(); return 0; }</pre> Thank You,<br/>CraigWed, 25 Nov 2009 22:02:50 Z2009-11-26T13:22:25Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/384d74d4-a5c0-4fea-b91a-e8a16d046a69http://social.msdn.microsoft.com/Forums/en-US/clr/thread/384d74d4-a5c0-4fea-b91a-e8a16d046a69davejp21http://social.msdn.microsoft.com/Profile/en-US/?user=davejp21excel locking files<p>Hello,<br/><br/>I have written an app that saves data to a .csv. If I open the .csv file in Excel, I can no longer acces the same .csv file from my application. This is ok, but is there some way of knowing before I try to access it that it is locked by Excel. Obviously I know its locked because an exception is generated. I was jsut wondering how I could tell if it was locked or not before I try to access. If not I can always just use the exception that is thrown.<br/><br/>Thanks<br/><br/>-David P</p>Thu, 26 Nov 2009 09:01:53 Z2009-11-26T20:44:16Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/6cdf1f76-bf3e-45b7-9c3a-fd4aef731063http://social.msdn.microsoft.com/Forums/en-US/clr/thread/6cdf1f76-bf3e-45b7-9c3a-fd4aef731063Boing3000http://social.msdn.microsoft.com/Profile/en-US/?user=Boing3000Pinned array of struct with charHello there,<br/> <p class=MsoNormal><br/> The runtime seems to be treating Char with much more &quot;respect&quot; as Int16 (although a close friend :-). I stumble on that fact in a generic code that was pinning array of &lt;T&gt; where T : struct.</p> <p class=MsoNormal> </p> <p class=MsoNormal>I was really expecting to be able to deal with pure-struct (not including ref type) in a generic way, but yet again I was wrong. An array of simple struct with two char is not pinnable. (Althouh two Int16 will be ok for GCHandle.Alloc(.. Pinned))</p> <p class=MsoNormal> </p> <p class=MsoNormal>In the quest of understanding what is a Primitive or Blittable or Pinnable or fixe’able, <span> </span> I try all values type with reflection. I even test the “blittablility” of those array with Buffer.BlockCopy() which seems to be even more restrictive that GCHandle and <span class=identifier><span>UnsafeAddrOfPinnedArrayElement.</span> </span></p> <p class=MsoNormal><span class=identifier><span> </span> </span></p> <p class=MsoNormal><span class=identifier><span>So I can </span> </span> pin array of char (hint) or int16,</p> <p class=MsoNormal>So I can pin array of struct { int16 }</p> <p class=MsoNormal>So I can NOT pin array of struct { char <span> </span> }, but why ? (especially considering that (hint) is OK)</p> <p class=MsoNormal><span lang=FR-BE> </span></p> <p class=MsoNormal><span lang=FR-BE>(trying various StructLayout did not help me to understand)</span></p> <p class=MsoNormal><span lang=FR-BE> </span></p> <p class=MsoNormal><span lang=FR-BE> </span></p> <p class=MsoNormal><span lang=FR-BE> </span></p> <p class=MsoNormal><span lang=FR-BE>Thanks in advance</span></p>Thu, 05 Nov 2009 07:47:38 Z2009-11-26T08:17:55Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/fa92606b-7828-43a4-97b7-9526fd517fa5http://social.msdn.microsoft.com/Forums/en-US/clr/thread/fa92606b-7828-43a4-97b7-9526fd517fa5makhihttp://social.msdn.microsoft.com/Profile/en-US/?user=makhiError Encryption appSettings section<p><span style="font-size:x-small;color:#0000ff">&lt;appSettings&gt;<br/>  &lt;add key=&quot;SmtpServer&quot; value=&quot;SMTP.CBCINTERNAL.COM&quot;/&gt;<br/>  &lt;add key=&quot;ErrorEmailEnabled&quot; value=&quot;1&quot;/&gt;<br/>  &lt;add key=&quot;ErrorSqlEnabled&quot; value=&quot;1&quot;/&gt;<br/>  &lt;add key=&quot;ErrorEmailFrom&quot; value=&quot;<a href="mailto:FeeRefund@citizensbanking.com&quot;/">FeeRefund@citizensbanking.com&quot;/</a>&gt;<br/>  &lt;add key=&quot;ErrorEmailTo&quot; value=&quot;<a href="mailto:jeff.seed@citizensbanking.com;scott.eason@citizensbanking.com;&quot;/">jeff.seed@citizensbanking.com;scott.eason@citizensbanking.com;&quot;/</a>&gt;<br/>  &lt;add key=&quot;ErrorEmailSubject&quot; value=&quot;FeeRefund Error - Dev&quot;/&gt;<br/>  &lt;add key=&quot;Domain&quot; value=&quot;CBCINTERNAL.COM&quot;/&gt;<br/>  &lt;add key=&quot;AdServiceAccountDistinguished&quot; value=&quot;(memberOf=CN=FEEREFUND_USERS,OU=APP_SECURITY_GROUPS,OU=GROUPS,DC=CBCINTERNAL,DC=COM)&quot;/&gt;  <br/>  &lt;add key=&quot;AdUsername&quot; value=&quot;FEEREFUND_SERVICES&quot;/&gt;<br/>  &lt;add key=&quot;AdPassword&quot; value=&quot;F33r3fun&quot;/&gt;<br/>  &lt;add key=&quot;FullUsersPath&quot; value=&quot;<a>LDAP://CN=%LoginId%</a>, OU=CBC_USERS, DC=CBCINTERNAL, DC=COM&quot;/&gt;  <br/>  &lt;add key=&quot;FullPathDomain&quot; value=&quot;<a>LDAP://CBCINTERNAL.COM/DC=CBCINTERNAL,DC=COM&quot;/</a>&gt;<br/>  &lt;add key=&quot;Title&quot; value=&quot;Fee Refund - Dev&quot;/&gt;<br/>  &lt;add key=&quot;ConnectwareID779&quot; value=&quot;C779673&quot; /&gt;<br/>  &lt;add key=&quot;ConnectwarePW779&quot; value=&quot;fr062909&quot; /&gt;<br/>  &lt;add key=&quot;VendorId&quot; value=&quot;GJL767&quot; /&gt;<br/>  &lt;add key=&quot;EncryptConnectionString&quot; value=&quot;true&quot;/&gt;<br/>  &lt;add key=&quot;AdFeeRefundGroup&quot; value=&quot;FEEREFUND_USERS&quot;/&gt;<br/>  &lt;add key=&quot;EmailHost&quot; value=&quot;smtp.cbcinternal.com&quot;/&gt;<br/>  &lt;add key=&quot;NotifySubject&quot; value=&quot;Fee refund Request -reqId- has been submitted &quot;/&gt;<br/>  &lt;add key=&quot;ActionSubject&quot; value=&quot;ACTION REQUIRED - Fee Refund Request - reqId - has been submitted &quot;/&gt;<br/>  &lt;add key=&quot;CancelledSubject&quot; value=&quot;Fee Refund Request - reqId - has been canceled &quot;/&gt;<br/>  &lt;add key=&quot;ProcessedSubject&quot; value=&quot;Fee Refund Request - reqId - has been processed &quot;/&gt;<br/>  &lt;add key=&quot;ProcessedWithModSubject&quot; value=&quot;Fee Refund Request - reqId - has been processed with modifications &quot;/&gt;<br/>  &lt;add key=&quot;EmailDomain&quot; value=&quot;@citizensbanking.com&quot;/&gt;<br/>  &lt;add key=&quot;ApplicationName&quot; value=&quot;FeeRefundSystem&quot;/&gt;<br/>  &lt;add key=&quot;OnLineDollarUrl&quot; value=&quot;<a href="https://xmlgateway.metavante.org/ConnectwareWS/DPOnlnDolrWSV1&quot;/">https://xmlgateway.metavante.org/ConnectwareWS/DPOnlnDolrWSV1&quot;/</a>&gt;<br/>  &lt;add key=&quot;DPACCTINQUrl&quot;     value=&quot;<a href="https://xmlgateway.metavante.org/ConnectwareWS/DPAcctInqWSV2&quot;/">https://xmlgateway.metavante.org/ConnectwareWS/DPAcctInqWSV2&quot;/</a>&gt;<br/>  &lt;add key=&quot;DPPriorDayInqUrl&quot; value=&quot;<a href="https://xmlgateway.metavante.org/ConnectwareWS/DPPriorDayInqWSV2&quot;/">https://xmlgateway.metavante.org/ConnectwareWS/DPPriorDayInqWSV2&quot;/</a>&gt;<br/>  &lt;add key=&quot;DPTxnInqIntraUrl&quot; value=&quot;<a href="https://xmlgateway.metavante.org/ConnectwareWS/DPTxnInqIntraWSV1&quot;/">https://xmlgateway.metavante.org/ConnectwareWS/DPTxnInqIntraWSV1&quot;/</a>&gt;<br/>  &lt;add key=&quot;Debug&quot; value=&quot;true&quot;/&gt;<br/>  &lt;add key=&quot;TestEmail&quot; value=&quot;false&quot;/&gt;<br/>  &lt;add key=&quot;TestBank&quot; value=&quot;779&quot;/&gt;<br/>  &lt;add key=&quot;ISTestBank&quot; value=&quot;true&quot;/&gt;<br/>  &lt;add key=&quot;RequestSummaryPage&quot; value=&quot;<a href="http://webdev2/FeeRefund/RequestSummary.aspx?       RequestID=&quot;/">http://webdev2/FeeRefund/RequestSummary.aspx? <br/>      RequestID=&quot;/</a>&gt;<br/>  &lt;add key=&quot;RequestPendingPage&quot; value=&quot;<a href="http://webdev2/FeeRefund/PendingRequest.aspx?   RequestID=&quot;/">http://webdev2/FeeRefund/PendingRequest.aspx?<br/>   RequestID=&quot;/</a>&gt;<br/>  &lt;add key=&quot;HighDolAnalysisLimitTrue&quot; value=&quot;500&quot;/&gt;<br/>  &lt;add key=&quot;HighDolAnalysisLimitFalse&quot; value=&quot;250&quot;/&gt;<br/>  &lt;add key=&quot;FileProcessedODR&quot; value=&quot;ODR Annual Fee Report File&quot;/&gt;<br/>  &lt;add key=&quot;FileProcessedStd&quot; value=&quot;Fee Reversal Data Dump File&quot;/&gt;<br/>  &lt;/appSettings&gt;<br/><br/><strong>Code to encrypt the above section in session start of global.aspx<br/></strong><br/>public static void CheckConncetionStringEncryption()<br/>                {<br/>                    System.Configuration.Configuration config = <br/>                 WebConfigurationManager.OpenWebConfiguration  <br/>                   (HttpContext.Current.Request.ApplicationPath);<br/>                    //ConfigurationSection section = config.GetSection(&quot;connectionStrings&quot;);<br/>                    ConfigurationSection section = config.GetSection(&quot;appSettings&quot;);<br/>             </span></p> <p><span style="font-size:x-small;color:#0000ff">                    if ((section.SectionInformation.IsProtected) &amp;&amp; (!AppConfig.EncryptConnectionString()))<br/>                    {<br/>                        section.SectionInformation.UnprotectSection();<br/>                        config.Save(System.Configuration.ConfigurationSaveMode.Modified);<br/>                        System.Configuration.ConfigurationManager.RefreshSection(&quot;appSettings&quot;);<br/>                    }</span></p> <p><span style="font-size:x-small;color:#0000ff">                    if ((!section.SectionInformation.IsProtected) &amp;&amp; (AppConfig.EncryptConnectionString()))<br/>                    {<br/>                        //section.SectionInformation.ProtectSection(&quot;DataProtectionConfigurationProvider&quot;);<br/>                        string provider = &quot;RSAProtectedConfigurationProvider&quot;;<br/>                        section.SectionInformation.ProtectSection(provider);</span></p> <p><span style="font-size:x-small;color:#0000ff">                        config.Save(System.Configuration.ConfigurationSaveMode.Modified);<br/>                        System.Configuration.ConfigurationManager.RefreshSection(&quot;appSettings&quot;);<br/>                        <br/>                    }<br/>                 }<br/><br/><strong>Got back the Error Below:<br/></strong>Unrecognized attribute 'configProtectionProvider'. <br/>Note that attribute names are case-sensitive. <br/>(C:\\Documents and Settings\\c400\\My Documents\\Visual Studio 2008\\Projects\\FeeRefund\\NET 3.5\\PresentationLayer\\Configuration\\Dev.App.config line 1)&quot;}<br/><br/><strong>If i restart the IIS</strong>, there is no error, seems like refeshing is not working. Any clue why this happening</span></p>Fri, 20 Nov 2009 16:10:02 Z2009-11-26T06:20:23Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/b6d36c6a-f6ae-496c-b672-c99474d1b469http://social.msdn.microsoft.com/Forums/en-US/clr/thread/b6d36c6a-f6ae-496c-b672-c99474d1b469fivegghttp://social.msdn.microsoft.com/Profile/en-US/?user=fivegghow to marshal VARIANT* pArray(which pArray is array of IDynamicProperty objects)?I have to marshal this interface in my C# code:<br/> <div style="color:Black;background-color:White"> <pre>IPropertySource : <span style="color:Blue">public</span> IUnknown<br/> {<br/> STDMETHOD(GetProperties)(THIS_ <span style="color:Green">/*[in]*/</span> IUnknown* pObject, <span style="color:Green">/*[out,<br/> retval]*/</span> VARIANT *pPropertyArray) PURE;<br/> };<br/> </pre> </div> Here is the document of GetProperties():<br/> The pProperties array contains pointers to IDynamicProperty instances that<br/> describe additional properties of the object. If the property source object<br/> does not generate any dynamic properties, pProperties can be VT_EMPTY or an<br/> empty array.<br/> <br/> I wrapped in C# like this:<br/> <div style="color:Black;background-color:White"> <pre>[Guid(<span style="color:#a31515">&quot;61D0A8E3-C792-4956-8E96-594315B95902&quot;</span> )]<br/> [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]<br/> [ComVisible(<span style="color:Blue">true</span> )]<br/> <span style="color:Blue">public</span> <span style="color:Blue">interface</span> IPropertySource <span style="color:Green">// cannot list any base interfaces here </span> <br/> {<br/> [<span style="color:Blue">return</span> : MarshalAs(UnmanagedType.SafeArray,SafeArraySubType=VarEnum.VT_UNKNOWN)]<br/> Object[] GetProperties([In,MarshalAs(UnmanagedType.IUnknown)] Object pObject);<br/> }<br/> </pre> </div> but when  GetProperties() called by other module,the returned array didn't work.I have searched lots of docs,all about marshal Safearray ,but not doc about pointer to safearray.<br/> It most likely the pPropertyArray-&gt;pparray or pPropertyArray-&gt;parray (I'm not sure) pointed the Safearray of  IDynamicProperty,so pPropertyArray maybe created by VT_ARRAY | VT_BSTR.<br/> How to marshal this interface?<br/> Thanks for help!<br/>Thu, 26 Nov 2009 02:19:07 Z2009-11-26T02:19:08Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/7fd857bf-fb26-496c-b871-324df35abba7http://social.msdn.microsoft.com/Forums/en-US/clr/thread/7fd857bf-fb26-496c-b871-324df35abba7tomfairhttp://social.msdn.microsoft.com/Profile/en-US/?user=tomfairProgrammatically modifying a file on Windows Server 2008 (Web Ed.)<div class=container> <div class=body> <div class=post-text> <p>I have written a .NET 2008 application (Windows Forms), incorporating Microsoft.Office.Interop.Excel, that modifies an existing Excel 2007 spreadsheet. It works perfectly on my WinXP development computer.</p> <p>When I upload the app to a Microsoft Web Server 2008, it opens the file and reads from the file, but when the app tries to save the file, it throws this exception:</p> <p>&quot;System.Runtime.InteropServices.COMException (0x800A03EC): 'july2009.xlsx' is read-only. To save a copy, click OK, then give the workbook a new name in the Save As dialog box.&quot;</p> <p>The file is NOT read-only, nor is it opened by any other user or app. The app and the Excel file both reside on the D: (data-only) drive.</p> <p>My first instinct was to look at file permissions. When nothing else worked, I literally created a temporary Group, added EVERY user and security entity to it and granted the group full control of the entire D: drive. No luck.</p> <p>Then I tried manually elevating the permission by running my app as administrator. No luck.</p> <p>Next, I disabled UAC. Nope.</p> <p>Finally, I copied the file to my XP development computer and ran the app there. Of course it worked perfectly.</p> <p>Can anyone please tell me how to give my program permission to edit a file on Server 2008?</p> <p>Thanks!</p> </div> </div> </div>Tue, 24 Nov 2009 15:56:27 Z2009-11-26T00:11:27Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/684cc1ef-8fc4-408d-85b3-5da95447ead8http://social.msdn.microsoft.com/Forums/en-US/clr/thread/684cc1ef-8fc4-408d-85b3-5da95447ead8Andsterhttp://social.msdn.microsoft.com/Profile/en-US/?user=AndsterInteroperability from C++ 6.0 to a C# COM component<p>Hi,<br/>I have a big legacy c++ 6.0 application that I want to access some C# code. <br/><br/>I have made the c# code into a COM component. I have the C++ code initializing COM, importing the COM component, and successfully creating an instance of the COM component.<br/><br/>However, when I make my first call to the COM component, it returns an Invalid Pointer error. The call includes a string parameter that the COM component is to change. I have tried searching MSDN for information and tried several of  the methods I have come across, but they all result in an Invalid Pointer. I would appreciate any help on this, or a link to information about it.<br/><br/>The C++ code looks like this: <br/><br/>    int nResult;<br/>    long nComResult = 0;<br/>    long TasRetVal = 0;<br/>    BOOL bRetVal = SUCCESS;<br/>    CHAR LogMsg[255] = {0};    <br/>    BSTR sTasResult = SysAllocString(L&quot;&quot;);<br/>    CComBSTR bstrXMLResult;</p> <p>    STRING sContextPath = &quot;&quot;;<br/>    STRING sXMLResult = &quot;&quot;;</p> <p>    CTasContextProvider OTasContextProvider;</p> <p>    EXTLOG(&quot;Inside CreateTasAdjustment&quot;);</p> <p>    if (BAL_ROLE::TasEnginePtr != NULL)<br/>    {<br/>        EXTLOG(&quot;About to call Start engine of TAS&quot;);<br/>        nComResult = BAL_ROLE::TasEnginePtr-&gt;Start(AdjstId, &amp;TasRetVal, &amp;sTasResult);<br/>        if (nComResult != 0)<br/>       {<br/>           sprintf(LogMsg,&quot;TasEnginePtr-&gt;Start has returned error &lt;%ld&gt;. Aborting the adjustment.&quot;, nComResult);<br/>           EXTLOG(LogMsg);<br/>           IDT_ROLE::ShowMessage(SEVERITY_INFO, &quot;The adjustment service failed, Please try the adjustment again.&quot;);</p> <p>           goto Cleanup;<br/>       } <br/>       ...<br/><br/>The definition of the function in the COM component is:<br/><br/><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">      public</span></span><span style="font-size:x-small"> </span><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">void</span></span><span style="font-size:x-small"> Start(</span><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">int</span></span><span style="font-size:x-small"> adjID, </span><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">out</span></span><span style="font-size:x-small"> </span><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">int</span></span><span style="font-size:x-small"> retValue, </span><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">out</span></span><span style="font-size:x-small"> </span><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">string</span></span><span style="font-size:x-small"> resultData)</span><span style="font-size:x-small;color:#008000"><span style="font-size:x-small;color:#008000">//iteration-4</span></span></p> <span style="font-size:x-small"> <p>      {<br/><br/>Thanks.</p> </span>Fri, 06 Nov 2009 16:46:58 Z2009-11-25T23:12:18Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/ad3d9641-55cb-4682-86a2-41ed4c179718http://social.msdn.microsoft.com/Forums/en-US/clr/thread/ad3d9641-55cb-4682-86a2-41ed4c179718Kanojwar vhttp://social.msdn.microsoft.com/Profile/en-US/?user=Kanojwar%20vunable to find a version of the runtime to run this application .net framework initialization errorHi <br/> <br/> I have an .exe  file built on vb.net, when tried to run this application i get an error as &quot;unable to find a version of the runtime to run this application .net framework initialization error&quot;. I tried to reinstall the framework as well as i have upgraded the framework to the latest but in vein. still the same error.<br/> <br/> If at all i reinstall the application it starts in the first time and when ever i close the application and then restart the application then the error comes back and the application doesn't start. it ends with the same error.<br/> <br/> plz help me out with this <br/> <br/> thanks<br/> <br/> <br/>Wed, 25 Nov 2009 21:18:30 Z2009-11-25T21:59:50Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/4a7bbe9b-eb9d-4221-9825-3daf157f6e6dhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/4a7bbe9b-eb9d-4221-9825-3daf157f6e6dMystagoguehttp://social.msdn.microsoft.com/Profile/en-US/?user=MystagogueC++/CLI as x64 loading x86 native library<p>I've checked the documentation, <a href="http://msdn.microsoft.com/en-us/library/k8d11d4s.aspx">http://msdn.microsoft.com/en-us/library/k8d11d4s.aspx</a>, and it makes the following terribly ambiguous statement:<br/><br/>&quot;To ensure that a safe image continues to run when it loads a 32-bit image on a 64-bit operating system, you must use <span><a href="http://msdn.microsoft.com/en-us/library/31zwwc39.aspx">/CLRIMAGETYPE (Specify Type of CLR Image)</a></span> to change the metadata (.corflags), marking it to be run under WOW64. A sample command line follows (substitute your own entry symbol)&quot;<br/><br/>Is it saying that a 64bit safe app can be made to successfully load a 32 bit image, so that x64 and x86 are interoperating, or is it saying that the safe app will be downgraded to become a 32bit app, so that it can load the 32 bit image? </p><hr class="sig">-Brent AriasWed, 25 Nov 2009 20:44:28 Z2009-11-25T21:48:43Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/7a6b7064-8914-46e2-b4eb-0e4a60b8ad22http://social.msdn.microsoft.com/Forums/en-US/clr/thread/7a6b7064-8914-46e2-b4eb-0e4a60b8ad22PJTVhttp://social.msdn.microsoft.com/Profile/en-US/?user=PJTVPerformanceCounterCategory.Exists error<p>I am getting FormatException when calling PerformanceCounterCategory.Exists(&quot;XYZ&quot;) -&gt; &quot;Input string was not in a correct format.&quot;<br/><br/>I have read somewhere that this should be a regional setting issue, I have tried to change and return back but without success.<br/>Are there any news regarding this issue ?<br/><br/>I am using: Win XP Professional SP3, .NET Framework 3.5 SP1, VS 2008.<br/><br/>Thanks for your help<br/>JT<br/><br/><br/>The callstack is:<br/>   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer&amp; number, NumberFormatInfo info, Boolean parseDecimal)<br/>   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)<br/>   at System.Int32.Parse(String s, IFormatProvider provider)<br/>   at System.Diagnostics.PerformanceCounterLib.GetStringTable(Boolean isHelp)<br/>   at System.Diagnostics.PerformanceCounterLib.get_NameTable()<br/>   at System.Diagnostics.PerformanceCounterLib.get_CategoryTable()<br/>   at System.Diagnostics.PerformanceCounterLib.CategoryExists(String machine, String category)<br/>   at System.Diagnostics.PerformanceCounterCategory.Exists(String categoryName, String machineName)<br/>   at System.Diagnostics.PerformanceCounterCategory.Exists(String categoryName)</p>Mon, 16 Nov 2009 23:01:55 Z2009-11-25T17:26:48Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/1bdd3677-4a9b-4940-bc41-5421b9eb1b24http://social.msdn.microsoft.com/Forums/en-US/clr/thread/1bdd3677-4a9b-4940-bc41-5421b9eb1b24xlathttp://social.msdn.microsoft.com/Profile/en-US/?user=xlatUri.TryCreate Method unescapes relativeUri -- Why?<p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:Calibri;font-size:small">I am using System.Uri.TryCreate (</span><a href="http://msdn.microsoft.com/en-us/library/ms131573.aspx"><span style="font-family:Calibri;font-size:small">http://msdn.microsoft.com/en-us/library/ms131573.aspx</span></a><span style="font-family:Calibri;font-size:small">) to create a URL from a base URL and a relative URL.  I just want to do the same thing that the browser does when it tries to resolve an anchor tag.</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:Calibri;font-size:small"> </span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:Calibri;font-size:small">My specific values are:</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:Calibri;font-size:small">  baseUri: </span><span style="font-family:Calibri;color:#0000ff;font-size:small">http://localhost:36695/Default.aspx</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:Calibri;font-size:small">  relativeUri: Foo/Bar_11<span style="background:yellow">%2F</span>13<span style="background:yellow">%2F</span>2009<span style="background:yellow">%20</span>(5156)</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:Calibri;font-size:small"> </span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:Calibri;font-size:small">  returnValue: </span><span style="font-family:Calibri;color:#0000ff;font-size:small">http://localhost:36695/Foo/Bar_11<span style="background:yellow">/</span>13<span style="background:yellow">/</span>2009</span><span style="font-family:Calibri;font-size:small"> (5156)</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:Calibri;font-size:small"> </span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:Calibri;font-size:small">What is baffling me is that it seems the second URL is getting decoded before appending to the first URL.  Do you know if this is a bug in .Net, or if there is another API I can use to get what I want?  What I want is this:</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:Calibri;font-size:small"> </span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-size:small"><span style="font-family:Calibri"><span style="color:#0000ff">http://localhost:36695/</span><span style="color:#000000">Foo/Bar_11<span style="background:yellow">%2F</span>13<span style="background:yellow">%2F</span>2009<span style="background:yellow">%20</span>(5156)<br/><br/>Thanks.</span></span></span></p>Mon, 23 Nov 2009 21:49:01 Z2009-11-25T16:49:22Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/f02d83b7-5553-483e-9ac8-02310354bee0http://social.msdn.microsoft.com/Forums/en-US/clr/thread/f02d83b7-5553-483e-9ac8-02310354bee0niklaihttp://social.msdn.microsoft.com/Profile/en-US/?user=niklaiMemory leak in managed-unmanaged mixed mode app<p align=left>Hi,</p> <p> </p> <p align=left>I've developed an application in C++ .NET using Visual Studio 2005. The application consist in a managed project which uses a unmanaged DLL (native C++).</p> <p align=left> </p> <p align=left>I have a pretty serious memory leak issue. I understand that memory allocated in the managed part is the garbage collector's job, and I ensured to free every ressources properly in my native DLL.</p> <p align=left> </p> <p align=left>That DLL needs to allocate a lot of memory (it can go up to 1.5 GB per sequence, but I release everything at the beginning of each sequence).</p> <p align=left> </p> <p align=left>I did'nt use any memory profiling tool yet, but I've seen some strange behaviours in the task manager of Windows. </p> <p align=left>In the tab &quot;Process&quot;, the &quot;Mem Usage&quot; colomn indicates that the application (.exe) frees correctly the ressources. However, if I check in the &quot;Performance&quot; tab, I can see that the &quot;PF Usage&quot; do not decrease enough.</p> <p align=left> </p> <p align=left>e.g. The application allocate 403 mb, then frees 196 mb and leak 207 mb</p> <p align=left>       The application allocate 351 mb, then frees 174 mb and leak 177 mb</p> <p align=left>       The application allocate 144 mb, then frees 70 mb and leak 74 mb</p> <p align=left> </p> <p align=left>It seem to always have an approximatly 50/50 ratio of free/leak.</p> <p align=left> </p> <p align=left>After that, I created I simple console program which is entirely in unmanaged C++ (Win32) and which reproduce the job of my unmanaged DLL, without all the managed code surrounding. After several tests, I got no memory leak!</p> <p align=left> </p> <p align=left>So... I'm pretty confused. Does anyone already experienced a similar issue from a managed/unmanaged mixed mode application?</p> <p align=left> </p> <p align=left>Does the garbage collector is supposed to free the memory allocate by the unmanaged DLL (I would have said no)?</p> <p align=left>If yes, does it is possible that the garbage collector &quot;forget&quot; about the half of the ressources to free?? (It seem pretty irrealistic...)</p> <p align=left> </p> <p align=left>Well, if anyone has a suggestion that can help me resolve this problem, it would be much appreciated!</p> <p align=left> </p> <p align=left>Thank you.</p> <p align=left>Nicolas Paradis</p>Thu, 29 Nov 2007 15:31:09 Z2009-11-25T16:41:06Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/29c27c4a-5f6b-4dee-a4f1-17020dcb9415http://social.msdn.microsoft.com/Forums/en-US/clr/thread/29c27c4a-5f6b-4dee-a4f1-17020dcb9415Dynamichttp://social.msdn.microsoft.com/Profile/en-US/?user=DynamicHow to Identify When Someone has Loggedin to Windows using a Windows Service?I need to find the domain and NTAccount of the person who has logged in to Windows. <div><br/></div> <div>I have created a Windows Service which runs under Local System account. My understanding is that generally windows services when set to start automatically, start before any user has logged on to Windows.</div> <div><br/></div> <div>How can I identify which user has logged in to Windows from inside my Windows Service?</div> <div><br/></div> <div>Is there any event for that such as OnLoggedOn(...)?</div> <div><br/></div> <div>Any help is much appreciated.</div>Tue, 24 Nov 2009 11:50:34 Z2009-11-25T17:41:18Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/3288b3fd-021b-43ac-b90e-5fc2226e60a0http://social.msdn.microsoft.com/Forums/en-US/clr/thread/3288b3fd-021b-43ac-b90e-5fc2226e60a0Ggoutam7http://social.msdn.microsoft.com/Profile/en-US/?user=Ggoutam7Interop C++ dll from vb.net<div> <div>Hi,</div> <div><br/></div> <div>I am writing this only after exhausting effort to search and find the solution was unsuccessful. </div> <div><br/></div> <div>I am using Visual Studio 2005. The Test123 function written in C++ should be called from vb.net by using Interop Services. The Testing.dll is a CLR module.</div> <div><br/></div> <div>Below is a simplified version of the C++ structure :</div> <div><br/></div> <div>typedef struct TEST_STRUCT</div> <div>{</div> <div>   long lTotal;</div> <div>   int nRow;</div> <div>   int nCol;</div> <div>   CString sName;</div> <div>   BOOL bFound;</div> <div>  <span style="white-space:pre"> </span>int item[100];</div> <div>} TEST;</div> <div><br/></div> <div>Below is a simplified version of the structure declared in vb.net :</div> <div><br/></div> <div>    &lt;StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Ansi)&gt; _</div> <div>    Public Structure TEST_STRUCT</div> <div>        ' ''&lt;System.Runtime.InteropServices.FieldOffsetAttribute(0)&gt; _</div> <div>        Public lTotal As Integer</div> <div>        Public nRow As Integer</div> <div>        Public nCol As Integer</div> <div>        &lt;System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)&gt; _</div> <div>        Public sName As String</div> <div>        &lt;System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.Bool)&gt; _</div> <div>        Public bFound As Boolean</div> <div><br/></div> <div>        '&lt;System.Runtime.InteropServices.MarshalAsAttribute _</div> <div>        '(System.Runtime.InteropServices.UnmanagedType.SafeArray, SafeArraySubType:=Runtime.InteropServices.VarEnum.VT_I4)&gt; _</div> <div>        &lt;System.Runtime.InteropServices.MarshalAsAttribute _</div> <div>        (System.Runtime.InteropServices.UnmanagedType.LPArray, SizeConst:=100)&gt; _</div> <div>            Public Item() As Integer</div> <div>    End Structure</div> <div><br/></div> <div>    Public Declare Auto Function Test123 Lib &quot;Testing.dll&quot; () As TEST_STRUCT</div> <div>    </div> <div>    What can work :</div> <div>    1) I can call the module Test123 from vb.net and it can run.</div> <div>    2) I can interop data for lTotal, nRow and nCol and receive at vb.net without any problem.</div> <div>    </div> <div>    What my questions are :</div> <div>    1) How to interop data for sName, bFound and item[100]? </div> <div>    2) Which part I am wrong? </div> <div>    3) How should I declare the structure in vb.net to interop these data?</div> <div>    4) Can Interop support CString directly?</div> <div>    5) Is there any indirect way of marshaling which can work, such as doing the Interop in C# and then call from vb.net?</div> <div>    </div> <div>    Your guidance on solving this problem is very much appreciated.</div> <div>    </div> <div>    Thanks,</div> <div>    Goutam</div> <div><br/></div> </div>Fri, 13 Nov 2009 04:27:34 Z2009-11-25T09:37:39Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/34cfa915-7bd2-46df-b0fb-575076e8d880http://social.msdn.microsoft.com/Forums/en-US/clr/thread/34cfa915-7bd2-46df-b0fb-575076e8d880Baburajpvhttp://social.msdn.microsoft.com/Profile/en-US/?user=BaburajpvInvoke a method in a module using Reflection in VB.NETHi,<br/><br/>I have a module in a .NET Project.  I could load the module using reflection, in the dll.  I need to know how to invoke, a method in the module. <br/><br/>Thanks in advance,<br/>BaburajWed, 25 Nov 2009 06:46:58 Z2009-11-25T17:42:43Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/bb690853-b6f2-4c3f-b0c4-350f671e0b55http://social.msdn.microsoft.com/Forums/en-US/clr/thread/bb690853-b6f2-4c3f-b0c4-350f671e0b55KurtasBhttp://social.msdn.microsoft.com/Profile/en-US/?user=KurtasBI know C#, Employer wants VB.NET, will I struggle?I've developed using C#.NET for 4 years in both Desktop and Web applications. I have worked very lightly with VB6. <div><br/></div> <div>I have a second interview for a job this week, and I'm 90% sure they will make an offer. However they code using VB.NET only. The hiring IT manager was not concerned that I don't know the VB.NET syntax, and was confident that I could transition easily. I am nervous that I will struggle, and the existing VB.NET developers there will not be pleased to work with me. <div><br/></div> <div>For consistency, he did not want to mix C# and VB in the same project.</div> <div><br/></div> <div>This might even be risky, if I am under performing - I may be let go early. Thoughts anyone? Has anyone made a similar transition?</div> </div>Mon, 23 Nov 2009 13:52:44 Z2009-11-24T23:39:30Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/02371584-5874-4822-8d32-b73e8fbab003http://social.msdn.microsoft.com/Forums/en-US/clr/thread/02371584-5874-4822-8d32-b73e8fbab003OmriSelahttp://social.msdn.microsoft.com/Profile/en-US/?user=OmriSelaWindows service hangs on starting after reboot when starting IIS application pools<span style="font-size:10pt;font-family:'Arial', 'sans-serif'"> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal">Hi,</p> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">I have encountered a strange situation where starting an application pool from a windows service (written in C#, set to &quot;Automatic&quot; startup) using WMI or ADSI immediately after the server reboots hangs. </span></p> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">I'll describe the issue: </span></p> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">We are developing a large application (Windows 2003 Server SP2, IIS 6.0) which contains the following main processes (these processes are invoked &amp; initialized using a windows service startup procedure when the application is started): </span></p> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">1) XServer1.exe, XServer2.exe - These processes are native COM-Exe servers, contains some logics, but mainly supplies COM objects to other processes via DCOM (mainly .NET2COM interOp calls &amp; pure COM calls). For example, some of the classic ASP &quot;Application Scope static objects&quot; (w3wp.exe) are COM objects which &quot;live&quot; inside these processes.</span></p> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">2) dllhost.exe - this is a COM+ application. Some of our DLLs are loaded into this process which acts as a &quot;state server&quot; (the same idea as the ASP.NET out-of-proc sessions server, but for classic ASP pages). </span></p> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">3) 3 different IIS application pools (we'll call them appPool1\2\3) - containers of our ASP pages, ASP.NET pages, WCF services etc. Code (native C++ COM dlls &amp; C#) in these application pools (w3wp.exe's) usually makes DCOM calls to the processes described in (1) &amp; (2). Only appPool1 can be configured as a Web Garden. </span></p> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">In order to Start\Stop our application we have written a windows Service (C#) which controls these procedures. Our service process is called XWinService.exe. The service depends on the following windows services (the list began with the first 4 services, ongoing tries made the list like this...): </span></p> <p class=MsoNormal style="margin:0in 0in 12pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">W3SVC <br/>aspnet_state <br/>COMSysApp <br/>DcomLaunch <br/>winmgmt <br/>lanmanserver <br/>lanmanworkstation <br/>seclogon <br/>Browser <br/>TermService </span></p> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">The summary of the Stop procedure of the application (implemented by the service): </span></p> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">1) Stop all 3 IIS application pools (appPool1\2\3) - This is done to prevent w3wp.exe processes to jump alive when the application is shut-down. This is implemented with WMI from C# (system.Management.dll) <br/>2) Stop XServer1\2.exe <br/>3) Stop the COM+ application (dllhost.exe). </span></p> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">The summary of the Start procedure of the application (implemented by the service): </span></p> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">1) Execute the Stop procedure - This ensures that no HTTP hits will wake a w3wp.exe process before it's time. </span></p> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">2) Invokes &amp; Initializes the XServer1\2.exe COM-Exe servers - Initialization is required prior to any w3wp.exe invocation. Only after some object had been initialized, w3wp.exe's can access these servers. This is implemented by .NET2COM InterOp (eventually DCOM). </span></p> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">3) Invokes &amp; initialized the dllhost.exe (COM+ application) process - This is implemented by the ComAdmin Catalog API (C#). </span></p> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">4) Starts our 3 application pools - This allows incoming HTTP hits to wake w3wp.exe processes and start serving requests.<br/><br/></span></p> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">This is the C# code which is responsible to start\stop application pools (WMI). This code runs in our service processes (XWinService.exe):<br/></span><strong><span style="text-decoration:underline"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">Now the issue: </span></span></strong></p> <pre lang="x-c#">ConnectionOptions co = new ConnectionOptions(); ManagementScope scope = new ManagementScope( @&quot;\\localhost\root\MicrosoftIISV2&quot;, co); foreach (string appPool in AppPools) { string objPath = string.Format( &quot;IISApplicationPool.Name='W3SVC/AppPools/{0}'&quot;, appPool); using (ManagementObject mc = new ManagementObject(objPath)) { mc.Scope = scope; if (Operation.ToLower() == &quot;start&quot;) { mc.InvokeMethod(&quot;Start&quot;, null, null); // ### The problematic line of code ### } else if (Operation.ToLower() == &quot;stop&quot;) { mc.InvokeMethod(&quot;Stop&quot;, null, null); } else if (Operation.ToLower() == &quot;recycle&quot;) { mc.InvokeMethod(&quot;Recycle&quot;, null, null); } } } </pre> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"> </p> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">Prior to rebooting the server, starting the service manually (from the services.msc tool) succeeds without any problems. also, stopping it is OK. We have set the service to start &quot;Automatic&quot;, that is, will start when the server (Win2K3 SP2) starts and rebooted the server. When the server started (the login screen appeared), our service was &quot;stuck&quot; (status = &quot;Starting&quot;) and will NEVER (it hang for 2 days!) start. </span></p> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">Analyzing the processes reveled the following: </span></p> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">1) The XWinService.exe process was stuck on the problematic line of code (### above ###). This hanged for 2 days until we killed the process. Please note: Shutting down the application pools (the Start procedure begins with a Stop procedure) did not hang! No w3wp.exe process was invoked.</span></p> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">2) From a DUMP file taken (with DebugDiag tool) from XWinService.exe during this &quot;hang&quot; we can see the thread which is waiting. This is the (native) stack trace of it: </span></p> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"> </p> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><strong><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">Thread 6 - System ID 2784</span></strong></p> <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0> <tbody> <tr> <td style="width:183pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=244> <p class=MsoNormal><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">Entry point</span></p> </td> <td style="width:285pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=380> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><strong><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">mscorwks!Thread::intermediateThreadProc</span></strong></p> </td> </tr> <tr> <td style="width:183pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=244> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">Create time</span></p> </td> <td style="width:285pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=380> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><strong><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">11/19/2009 1:40:05 PM</span></strong></p> </td> </tr> <tr> <td style="width:183pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=244> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">Time spent in user mode</span></p> </td> <td style="width:285pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=380> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><strong><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">0 Days 00:00:00.078</span></strong></p> </td> </tr> <tr> <td style="width:183pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=244> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">Time spent in kernel mode</span></p> </td> <td style="width:285pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=380> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><strong><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">0 Days 00:00:00.781</span></strong></p> </td> </tr> </tbody> </table> <p class=MsoNormal style="margin:0in 0in 12pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'"><br/><br/>This thread is making a COM call to <strong>multi-threaded apartment (MTA)</strong> in <strong>process 884</strong></span></p> <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0> <tbody> <tr> <td style="width:386.95pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=516> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal;text-align:center" align=center><strong><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">Function</span></strong></p> </td> <td style="width:45.05pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=60> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal;text-align:center" align=center><strong><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">Source</span></strong></p> </td> </tr> <tr> <td style="width:386.95pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=516> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">ntdll!KiFastSystemCallRet</span></p> </td> <td style="width:45.05pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=60> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'"> </span></p> </td> </tr> <tr> <td style="width:386.95pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=516> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">ntdll!NtRequestWaitReplyPort+c</span></p> </td> <td style="width:45.05pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=60> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'"> </span></p> </td> </tr> <tr> <td style="width:386.95pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=516> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">rpcrt4!LRPC_CCALL::SendReceive+230</span></p> </td> <td style="width:45.05pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=60> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'"> </span></p> </td> </tr> <tr> <td style="width:386.95pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=516> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">rpcrt4!I_RpcSendReceive+24</span></p> </td> <td style="width:45.05pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=60> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'"> </span></p> </td> </tr> <tr> <td style="width:386.95pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=516> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">ole32!ThreadSendReceive+138</span></p> </td> <td style="width:45.05pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=60> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'"> </span></p> </td> </tr> <tr> <td style="width:386.95pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=516> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">ole32!CRpcChannelBuffer::SwitchAptAndDispatchCall+112</span></p> </td> <td style="width:45.05pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=60> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'"> </span></p> </td> </tr> <tr> <td style="width:386.95pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=516> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">ole32!CRpcChannelBuffer::SendReceive2+d3</span></p> </td> <td style="width:45.05pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=60> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'"> </span></p> </td> </tr> <tr> <td style="width:386.95pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=516> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">ole32!CAptRpcChnl::SendReceive+ab</span></p> </td> <td style="width:45.05pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=60> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'"> </span></p> </td> </tr> <tr> <td style="width:386.95pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=516> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">ole32!CCtxComChnl::SendReceive+1a9</span></p> </td> <td style="width:45.05pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=60> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'"> </span></p> </td> </tr> <tr> <td style="width:386.95pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=516> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">rpcrt4!NdrProxySendReceive+43</span></p> </td> <td style="width:45.05pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=60> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'"> </span></p> </td> </tr> <tr> <td style="width:386.95pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=516> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">rpcrt4!NdrClientCall2+206</span></p> </td> <td style="width:45.05pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=60> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'"> </span></p> </td> </tr> <tr> <td style="width:386.95pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=516> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">rpcrt4!ObjectStublessClient+8b</span></p> </td> <td style="width:45.05pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=60> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'"> </span></p> </td> </tr> <tr> <td style="width:386.95pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=516> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">rpcrt4!ObjectStubless+f</span></p> </td> <td style="width:45.05pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=60> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'"> </span></p> </td> </tr> <tr> <td style="width:386.95pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=516> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">….</span></p> </td> <td style="width:45.05pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=60> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'"> </span></p> </td> </tr> </tbody> </table> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">This thread is calling (via DCOM) a component in process 884, which is svchost.exe, running the following services: AeLookupSvc, AudioSrv, Browser, CryptSvc, dmserver, EventSystem, helpsvc, lanmanserver, lanmanworkstation, Schedule, seclogon, SENS, ShellHWDetection, TrkWks, winmgmt, wuauserv, WZCSVC. </span></p> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">As you can see the &quot;winmgmt&quot; service (responsible for WMI) is running in this process and our service depends on it, so our service will start after winmgmt is started (the same for IIS W3SVC service).. </span></p> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">The svchost.exe process (884) was dumped and we can see a thread (waiting for a DCOM call to end) accessing process 2880 which is - wmiprvse.exe (I guess this is the WMI server. Don't know if it's relevent, but there were 2 instances of this process). This is the native call stack of the thread (in svchost.exe):</span></p> <p class=H4 style="margin:5pt 0in"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'"><strong> </strong></span><a name="884:424Thread3816"></a><span style="font-size:10pt;font-family:'Arial', 'sans-serif'"><strong>Thread 48 - System ID 3816</strong></span></p> <table class=MsoNormalTable style="border-collapse:collapse" border=0 cellspacing=0 cellpadding=0> <tbody> <tr> <td style="width:201.85pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=269> <p class=MsoNormal style="margin:5pt 0in;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">Entry point</span></p> </td> <td style="width:266.1pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=355> <p class=MsoNormal style="margin:5pt 0in;line-height:normal"><strong><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">wbemcore!CCoreQueue::_ThreadEntry</span></strong></p> </td> </tr> <tr> <td style="width:201.85pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=269> <p class=MsoNormal style="margin:5pt 0in;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">Create time</span></p> </td> <td style="width:266.1pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=355> <p class=MsoNormal style="margin:5pt 0in;line-height:normal"><strong><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">11/19/2009 1:40:56 PM</span></strong></p> </td> </tr> <tr> <td style="width:201.85pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=269> <p class=MsoNormal style="margin:5pt 0in;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">Time spent in user mode</span></p> </td> <td style="width:266.1pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=355> <p class=MsoNormal style="margin:5pt 0in;line-height:normal"><strong><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">0 Days 00:00:00.00</span></strong></p> </td> </tr> <tr> <td style="width:201.85pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=269> <p class=MsoNormal style="margin:5pt 0in;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">Time spent in kernel mode</span></p> </td> <td style="width:266.1pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=355> <p class=MsoNormal style="margin:5pt 0in;line-height:normal"><strong><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">0 Days 00:00:00.00</span></strong></p> </td> </tr> </tbody> </table> <p class=MsoNormal style="margin:5pt 0in;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'"><br/><br/>This thread is making a COM call to <strong>multi-threaded apartment (MTA)</strong> in <strong>process 2880</strong><br/><br/></span></p> <table class=MsoNormalTable style="border-collapse:collapse" border=0 cellspacing=0 cellpadding=0 width=624> <tbody> <tr> <td style="width:423.3pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=564> <p class=MsoNormal style="margin:5pt 0in;line-height:normal;text-align:center" align=center><strong><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">Function</span></strong></p> </td> <td style="width:44.65pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=60> <p class=MsoNormal style="margin:5pt 0in;line-height:normal;text-align:center" align=center><strong><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">Source</span></strong></p> </td> </tr> <tr> <td style="width:423.3pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=564> <p class=MsoNormal style="margin:5pt 0in;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">ntdll!KiFastSystemCallRet</span></p> </td> <td style="width:44.65pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=60> <p class=MsoNormal style="margin:5pt 0in;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'"> </span></p> </td> </tr> <tr> <td style="width:423.3pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=564> <p class=MsoNormal style="margin:5pt 0in;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">ntdll!NtRequestWaitReplyPort+c</span></p> </td> <td style="width:44.65pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=60> <p class=MsoNormal style="margin:5pt 0in;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'"> </span></p> </td> </tr> <tr> <td style="width:423.3pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=564> <p class=MsoNormal style="margin:5pt 0in;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">rpcrt4!LRPC_CCALL::SendReceive+230</span></p> </td> <td style="width:44.65pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=60> <p class=MsoNormal style="margin:5pt 0in;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'"> </span></p> </td> </tr> <tr> <td style="width:423.3pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=564> <p class=MsoNormal style="margin:5pt 0in;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">rpcrt4!I_RpcSendReceive+24</span></p> </td> <td style="width:44.65pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=60> <p class=MsoNormal style="margin:5pt 0in;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'"> </span></p> </td> </tr> <tr> <td style="width:423.3pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=564> <p class=MsoNormal style="margin:5pt 0in;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">ole32!ThreadSendReceive+138</span></p> </td> <td style="width:44.65pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=60> <p class=MsoNormal style="margin:5pt 0in;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'"> </span></p> </td> </tr> <tr> <td style="width:423.3pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=564> <p class=MsoNormal style="margin:5pt 0in;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">ole32!CRpcChannelBuffer::SwitchAptAndDispatchCall+112</span></p> </td> <td style="width:44.65pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=60> <p class=MsoNormal style="margin:5pt 0in;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'"> </span></p> </td> </tr> <tr> <td style="width:423.3pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=564> <p class=MsoNormal style="margin:5pt 0in;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">ole32!CRpcChannelBuffer::SendReceive2+d3</span></p> </td> <td style="width:44.65pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=60> <p class=MsoNormal style="margin:5pt 0in;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'"> </span></p> </td> </tr> <tr> <td style="width:423.3pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=564> <p class=MsoNormal style="margin:5pt 0in;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">ole32!CAptRpcChnl::SendReceive+ab</span></p> </td> <td style="width:44.65pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=60> <p class=MsoNormal style="margin:5pt 0in;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'"> </span></p> </td> </tr> <tr> <td style="width:423.3pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=564> <p class=MsoNormal style="margin:5pt 0in;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">ole32!CCtxComChnl::SendReceive+1a9</span></p> </td> <td style="width:44.65pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=60> <p class=MsoNormal style="margin:5pt 0in;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'"> </span></p> </td> </tr> <tr> <td style="width:423.3pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=564> <p class=MsoNormal style="margin:5pt 0in;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">…</span></p> </td> <td style="width:44.65pt;background-color:transparent;border-color:#ece9d8;padding:0in" width=60> <p class=MsoNormal style="margin:5pt 0in;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'"> </span></p> </td> </tr> </tbody> </table> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">3) Setting our service to &quot;Manual&quot; and starting it (manually - after logging into the server or starting it remotely from a different server immediately after reboot) is OK - nothing hangs.<br/></span><span style="font-size:10pt;font-family:'Arial', 'sans-serif'"><br/>4) We deleted our service (from the registry!) and placed a batch file in the windows &quot;startup&quot; folder. This batch files calls the service's code, but runs it as a normal C# executable. After server reboot, it also hang on the same problematic line of code (again... for 2 days until we killed it).<br/></span><span style="font-size:10pt;font-family:'Arial', 'sans-serif'"><br/>5) Using ADSI (System.DirectoryServices) instead of WMI had the same results (starting the application pools hanged!). <br/></span><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">We have been digging into this for the past 2 weeks... </span></p> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"> </p> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'"><strong><br/>My questions:</strong> <br/></span><span style="font-size:10pt;font-family:'Arial', 'sans-serif'"><strong>========== <br/></strong></span><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">1) Did anyone encounter the same issue? <br/></span><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">2) Does anyone know why it hangs? Is there any additional service dependency we should take in mind? <br/></span><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">3) Does anyone have a solution for this issue? <br/></span><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">4) Why is this happening after a reboot only when the service to set to &quot;Automatic&quot; startup? If we do it manually - everything is Ok!</span></p> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"> </p> <p class=MsoNormal style="margin:0in 0in 10pt;line-height:normal"><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">Thanks in advanced,<br/></span><span style="font-size:10pt;font-family:'Arial', 'sans-serif'">Omri<br/><br/></span></p> <p><span style="text-decoration:underline"><br/>*** Small update:<br/></span>We have noticed that on VMs (VMware stations) the service hangs after reboot for an average of ~40min, until it starts (note: it never fails to start, but 40min is way too much). An event log message is recorded in the system event log stating that our service hanged for more than 16min (source: Service Control Manager, Event ID: 7044).<br/>On &quot;regular&quot; machines (real metals) the average time until the service starts is ~55 hours!!! Again, an event log entry is recorded as described above.<br/>The avergae values were calculated from 10 differens VMs &amp; 8 different &quot;real&quot; servers.</p> </span>Fri, 20 Nov 2009 20:28:27 Z2009-11-27T06:00:09Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/5b733698-641a-43f9-afea-e62d778081afhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/5b733698-641a-43f9-afea-e62d778081afMichal Burgerhttp://social.msdn.microsoft.com/Profile/en-US/?user=Michal%20BurgerCustom mscorlib implementationIs it possible to make your own mscorlib replacement? How would I do this? It's really just a research question but I think it should be possible. Any insights or links will be appreciated!Mon, 23 Nov 2009 23:02:18 Z2009-11-27T09:25:03Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/7a49a64e-5d65-42f4-ac12-ecb77c1e2a5bhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/7a49a64e-5d65-42f4-ac12-ecb77c1e2a5broma_victahttp://social.msdn.microsoft.com/Profile/en-US/?user=roma_victahow to use /LARGEADDRESSAWARE ?hi all,<br/><br/>I have an application acad.exe in 64 bit system but i cant able to run it . I went through some sites and it gives me the idea of using <br/><br/>&quot;LARGEADDRESSAWARE&quot;<br/><br/>I have installed visual studio 2008 and I am new to .net<br/><br/>Can anyone tell me how to use LARGEADDRESSAWARE in visual studio 2008<br/><br/>King Regards<br/><br/>Kannan<br/><br/>Sun, 22 Nov 2009 12:35:04 Z2009-11-24T18:42:11Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/104d085d-a862-44bd-af73-67085b0f78b4http://social.msdn.microsoft.com/Forums/en-US/clr/thread/104d085d-a862-44bd-af73-67085b0f78b4MatteoDevhttp://social.msdn.microsoft.com/Profile/en-US/?user=MatteoDev.NET application crashes sudently. How can I find the reason why?Hi everybody!<br/> <br/> I have been programming with the .NET 2.0 plateform for many years. I have a large project that was running fine until some month ago. It's a Win32 application that as many features. Some of the functionnalities use multithreading.<br/> <br/> Since a few months, some users tell me that the application crashes sudently, with no reason, and randomly. I think this could be a multithread problem but I'm not sure. I cannot leave the application in that way, because users get fed up with unexpeted crashes.<br/> <br/> My problem is that I can't find a way ton find what append, because there is nothing in the Windows EventLog, no error window, and no report to send to Microsoft.<br/> <br/> Usually, when I have an exception, it's caught by the application and logged. If it's something else, or if I have done a bad code, the exception is caught by the CLR and an EventLog is added.<br/> <br/> Can you help me to find a way to detect the problem?<br/> <br/> Thanks.Sun, 08 Nov 2009 13:27:44 Z2009-11-24T16:06:30Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/80f2ff88-fc3c-443c-85ca-6d59a52ac851http://social.msdn.microsoft.com/Forums/en-US/clr/thread/80f2ff88-fc3c-443c-85ca-6d59a52ac851Massacrinohttp://social.msdn.microsoft.com/Profile/en-US/?user=MassacrinoCan I put reg-free COM config in an app-domain config?Hi there<br/> <br/> Could anyone help with the following ref-free COM problem, please?<br/> <br/> I have an unmanaged module which points IAppDomainSetup-&gt;ConfigurationFile to a file with the following contents and then uses the IAppDomainSetup to create an app-domain.<br/> <br/> &lt;?xml version =&quot;1.0&quot;?&gt;<br/> &lt;configuration&gt;<br/>     &lt;runtime&gt;<br/>         &lt;assemblyBinding xmlns=&quot;urn:schemas-microsoft-com:asm.v1&quot;&gt;<br/>             &lt;dependentAssembly&gt;<br/>                 &lt;assemblyIdentity type=&quot;win32&quot; name=&quot;<strong>managed-dependency</strong> &quot; version=&quot;1.0.0.0&quot; /&gt;<br/>             &lt;/dependentAssembly&gt;<br/>         &lt;/assemblyBinding&gt;<br/>     &lt;/runtime&gt;<br/> &lt;/configuration&gt;<br/> <br/> A managed module in the app-domain then uses an interop to unmanaged coclass. The managed dependency has the following manifest<br/> <br/> &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br/> &lt;assembly xsi:schemaLocation=&quot;urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd&quot; manifestVersion=&quot;1.0&quot; xmlns:asmv1=&quot;urn:schemas-microsoft-com:asm.v1&quot; xmlns:asmv2=&quot;urn:schemas-microsoft-com:asm.v2&quot; xmlns:asmv3=&quot;urn:schemas-microsoft-com:asm.v3&quot; xmlns:dsig=&quot;http://www.w3.org/2000/09/xmldsig#&quot; xmlns:co.v1=&quot;urn:schemas-microsoft-com:clickonce.v1&quot; xmlns=&quot;urn:schemas-microsoft-com:asm.v1&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;<br/>   &lt;assemblyIdentity name=&quot;<strong>managed-dependency</strong> &quot; version=&quot;1.0.0.0&quot; type=&quot;win32&quot; /&gt;<br/>   &lt;dependency&gt;<br/>     &lt;dependentAssembly asmv2:dependencyType=&quot;install&quot; asmv2:codebase=&quot;<strong>reg-free-comserver.dll.manifest</strong> &quot; asmv2:size=&quot;787&quot;&gt;<br/>       &lt;assemblyIdentity name=&quot;<strong>reg-free-comserver.dll</strong> &quot; version=&quot;1.0.0.0&quot; type=&quot;win32&quot; /&gt;<br/>       &lt;hash xmlns=&quot;urn:schemas-microsoft-com:asm.v2&quot;&gt;<br/>         &lt;dsig:Transforms&gt;<br/>           &lt;dsig:Transform Algorithm=&quot;urn:schemas-microsoft-com:HashTransforms.Identity&quot; /&gt;<br/>         &lt;/dsig:Transforms&gt;<br/>         &lt;dsig:DigestMethod Algorithm=&quot;http://www.w3.org/2000/09/xmldsig#sha1&quot; /&gt;<br/>         &lt;dsig:DigestValue&gt;LpJMG4ZBo5H1NxbG3JPaTyjcpAI=&lt;/dsig:DigestValue&gt;<br/>       &lt;/hash&gt;<br/>     &lt;/dependentAssembly&gt;<br/>   &lt;/dependency&gt;<br/> &lt;/assembly&gt;<br/> <br/> The unmanaged reg-free-comserver.dll.manifest file contains the following. It's very simple: just one coclass with one IDispatch registered for standard TLB marshalling.<br/> <br/> &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;<br/> &lt;assembly xmlns=&quot;urn:schemas-microsoft-com:asm.v1&quot; manifestVersion=&quot;1.0&quot;&gt;<br/> <br/>     &lt;assemblyIdentity type = &quot;win32&quot; name = &quot;<strong>reg-free-comserver.dll</strong> &quot; version = &quot;1.0.0.0&quot; /&gt;<br/> <br/>     &lt;file name = &quot;<strong>reg-free-comserver.dll</strong> &quot;&gt;<br/>         &lt;comClass clsid=&quot;{05F5B69B-B4E7-4500-94E5-8AA1533B44D5}&quot; threadingModel = &quot;Apartment&quot; /&gt;<br/>         &lt;typelib tlbid=&quot;{BAE209E9-D942-4397-8806-FA93B54C2486}&quot; version=&quot;1.0&quot; helpdir=&quot;&quot;/&gt;<br/>     &lt;/file&gt;<br/> <br/>     &lt;comInterfaceExternalProxyStub<br/>         name=&quot;IMyUnManagedInterface&quot;<br/>         iid=&quot;{2BAAAC04-7035-40DA-852D-35066FDE47CF}&quot;<br/>         proxyStubClsid32=&quot;{00020424-0000-0000-C000-000000000046}&quot;<br/>         baseInterface=&quot;{00000000-0000-0000-C000-000000000046}&quot;<br/>         tlbid=&quot;{BAE209E9-D942-4397-8806-FA93B54C2486}&quot; /&gt;<br/> <br/> &lt;/assembly&gt;<br/> <br/> The trace output tells me that reg-free-comserver.dll is in fact never loaded.<br/> <br/> Any advice greatly appreciated.Mon, 23 Nov 2009 16:00:14 Z2009-11-24T18:05:41Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/760ea95b-4c3e-4f48-a0f6-9d728d5580dahttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/760ea95b-4c3e-4f48-a0f6-9d728d5580daraw100http://social.msdn.microsoft.com/Profile/en-US/?user=raw100When calling Shell CopyHere command I need to know when operation complete<p>Hi,<br/> <br/> I have an operation that creates a number of large zip files.  At the moment I don't know when one is complete before starting the next one and the screen is full of lots (up to 30 sometimes) of zip windows.  For this reason, and knowing when some temporary folders are no longer being accessed so they can be deleted, I want to have only one zip operation at a time.<br/> <br/> I can't tell when that zip operation is finished though.  I have tried to use delegates as below but they are showing complete whilst they are clearly not complete:</p> <p> </p> <p> <pre lang="x-c#">Folder SF = SH.NameSpace(fi.FullName); DirectoryInfo di = new DirectoryInfo(App.appSavePath); //Delegate for a Shell CopyHere ExportHelpers.CopyHereHandler handler = new ExportHelpers.CopyHereHandler( SF.CopyHere); foreach (DirectoryInfo diInner in di.GetDirectories()) { string name = diInner.Name.ToLower(); //If the directory is either not a language folder or is if (App.nonLanguageSubFolders.Where(a =&gt; a.ToLower() == name).Count() &gt; 0 || name == langId.ToLower()) { Folder DF = SH.NameSpace(diInner.FullName); //SF.CopyHere(DF, 16); IAsyncResult result = handler.BeginInvoke(DF, 16, null, null); do { Thread.Sleep(250); } while (!result.IsCompleted); } }</pre> <em>(Moderator: I put code into code block using &lt;/&gt; button to make it *more* readable. Thx)</em></p> <p><span style="font-size:x-small"><br/> The zipping works fine - but I would be very grateful if you could tell me how I can know, from .NET, when the Shell zip operation has completed so I can zip one folder at a time (the operation above is called many times for different folder structures - into separate zips).<br/> <br/> Thanks for any suggestions.</span></p>Fri, 20 Nov 2009 13:17:04 Z2009-11-24T08:39:28Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/7207a8f9-8632-472e-8960-f10e057231c8http://social.msdn.microsoft.com/Forums/en-US/clr/thread/7207a8f9-8632-472e-8960-f10e057231c8KeithAtGeohttp://social.msdn.microsoft.com/Profile/en-US/?user=KeithAtGeo.net windows service Faulting application nnn.exe, version 2.0.1.0, stamp 4b055d77, faulting module kernel32.dll, version 5.2.3790.4480I'm running a windows service, on a 64bit server, that is on a sys.threading.timer, polling the processlist to verify that specific apps are running and starts them if they are not running.  It works fine for a number of .exe's all 32bit vb.net apps.  The service has no ui and all the vb.exe apps do have ui.  One app, the engineconsole won't start. It is a vb.net app that employees it's own timers and threadpool.  The logging in the engineconsole.formload doesn't get run so just starting the app is failing with the application kernal32.dll fault.  If I run the engineconsole.exe by itself without launching it from the service it runs fine on the server.<br/><br/>Of course all of this runs as expected on the development machine.  I've researched this issue a bit and lots of posts with similar problems regarding windows services and application faults.  Do you have any suggestions for likely problems ?<br/><br/><br/>(specs)<br/>ms windows server 2003 R2 sp2<br/>dual quad xeon cpu's<br/>.net 2.0 with 3.0/3.5 installed<br/>development in visdev 2008<br/><br/>Thu, 19 Nov 2009 16:19:34 Z2009-11-23T23:12:22Zhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/37aee165-aa3c-4c0a-b235-cee7cc4ca73ahttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/37aee165-aa3c-4c0a-b235-cee7cc4ca73aKhayralla AL-Atharihttp://social.msdn.microsoft.com/Profile/en-US/?user=Khayralla%20AL-AthariRetrieving the COM class factory for component with CLSID {xxx} failed due to the following error: 80080005<p>Hi all<br/><br/>I have a C# windows service application which refrencing a DCOM dll.<br/>When I run this application as a Console application, it work perfect.<br/>When I run it as a service, I got :<br/>Retrieving the COM class factory for component with CLSID {xxx} failed due to the following error: 80080005<br/><br/>then I get a solution to this problem by changing some values using Component Services then DCOM properties.<br/>When I set all values back again, I got the same error. Then, from registry I get these values which make my service running without such problem.<br/><br/>Registry entry which solve the problem:<br/>Windows Registry Editor Version 5.00</p> <p>[HKEY_CLASSES_ROOT\AppID\{xxx}]<br/>@=&quot;yyyyy&quot;<br/>&quot;ActivateAtStorage&quot;=&quot;Y&quot;<br/>&quot;LaunchPermission&quot;=hex:01,00,04,80,80,00,00,00,90,00,00,00,00,00,00,00,14,00,\<br/>  00,00,02,00,6c,00,04,00,00,00,00,00,18,00,1f,00,00,00,01,02,00,00,00,00,00,\<br/>  05,20,00,00,00,20,02,00,00,00,00,14,00,1f,00,00,00,01,01,00,00,00,00,00,05,\<br/>  04,00,00,00,00,00,24,00,1f,00,00,00,01,05,00,00,00,00,00,05,15,00,00,00,45,\<br/>  06,6e,63,f8,f8,95,f2,da,cf,9c,83,aa,1d,00,00,00,00,14,00,1f,00,00,00,01,01,\<br/>  00,00,00,00,00,05,12,00,00,00,01,02,00,00,00,00,00,05,20,00,00,00,20,02,00,\<br/>  00,01,02,00,00,00,00,00,05,20,00,00,00,20,02,00,00<br/>&quot;RunAs&quot;=&quot;Interactive User&quot;<br/>&quot;AccessPermission&quot;=hex:01,00,04,80,44,00,00,00,54,00,00,00,00,00,00,00,14,00,\<br/>  00,00,02,00,30,00,02,00,00,00,00,00,14,00,07,00,00,00,01,01,00,00,00,00,00,\<br/>  05,0a,00,00,00,00,00,14,00,07,00,00,00,01,01,00,00,00,00,00,05,12,00,00,00,\<br/>  01,02,00,00,00,00,00,05,20,00,00,00,20,02,00,00,01,02,00,00,00,00,00,05,20,\<br/>  00,00,00,20,02,00,00<br/><br/><br/>and this is the entry which make trubles for me:<br/>Windows Registry Editor Version 5.00</p> <p>[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AppID\{xxx}]<br/>@=&quot;yyyyy&quot;<br/>&quot;ActivateAtStorage&quot;=&quot;N&quot;<br/>&quot;LaunchPermission&quot;=hex:01,00,04,80,48,00,00,00,58,00,00,00,00,00,00,00,14,00,\<br/>  00,00,02,00,34,00,02,00,00,00,00,00,18,00,1f,00,00,00,01,02,00,00,00,00,00,\<br/>  05,20,00,00,00,20,02,00,00,00,00,14,00,0b,00,00,00,01,01,00,00,00,00,00,05,\<br/>  12,00,00,00,01,02,00,00,00,00,00,05,20,00,00,00,20,02,00,00,01,02,00,00,00,\<br/>  00,00,05,20,00,00,00,20,02,00,00<br/><br/>Question: How can I fix this error on all Customer  machines programmatically in C#?<br/>I already added<br/>ActivateAtStorage=&quot;Y&quot;<br/>RunAs=&quot;Interactive User&quot;<br/>to the customer registry, but did not solve the problem.<br/><br/>Khayralla</p>Mon, 16 Nov 2009 14:58:53 Z2009-11-23T15:06:28Z