.net-4.0

How to send a custom command to a .NET windows Service from .NET code?

ぐ巨炮叔叔 提交于 2019-12-17 08:21:15
问题 As in the following link, one can stop, start, and "stop, then start" a service using C# code. http://www.csharp-examples.net/restart-windows-service/ I have baked a .NET service that does implement OnStart and OnStop . However, I need to implement a "smart restart" functionality which is more involved than just stopping and then starting. I need to keep the downtime to just a few seconds if that (but Stop + Start can take minutes in this case when done cleanly, and I must do it cleanly), and

Differences between .NET 4.0 and .NET 4.5 in High level in .NET

放肆的年华 提交于 2019-12-17 08:07:49
问题 Eager to know Differences between .NET 4.0 and .NET 4.5 in High level in .NET and also differences in ASP.NET, C# also in these frameworks 回答1: What is new in .NET Framework 4.5 & What's new and expected in .NET Framework 4.5: Support for Windows Runtime Support for Metro Style Applications Support for Async Programming Garbage Collector Improvements Faster ASP.NET Startup Better Data Access Support WebSockets Support Workflow Support - BCL Support differences in ASP.NET in these frameworks

Differences between .NET 4.0 and .NET 4.5 in High level in .NET

感情迁移 提交于 2019-12-17 08:06:13
问题 Eager to know Differences between .NET 4.0 and .NET 4.5 in High level in .NET and also differences in ASP.NET, C# also in these frameworks 回答1: What is new in .NET Framework 4.5 & What's new and expected in .NET Framework 4.5: Support for Windows Runtime Support for Metro Style Applications Support for Async Programming Garbage Collector Improvements Faster ASP.NET Startup Better Data Access Support WebSockets Support Workflow Support - BCL Support differences in ASP.NET in these frameworks

Unable to load SOS in WinDbg

你说的曾经没有我的故事 提交于 2019-12-17 07:59:29
问题 Background: I'm new to WinDbg and trying to get it running for the first time. I want to examine a memory dump I took from a running ASP.NET 4 site hosted in IIS 7 on Windows Server 2008 (x86) and downloaded to my local machine. I installed the debugging tools and launched WinDbg for the first time, opening the crash dump. I went to File | Symbol File Path and set the path to *srv*c:\symbols*http://msdl.microsoft.com/download/symbols* and waited for all the symbols to load. When trying to

Parallel.For(): Update variable outside of loop

末鹿安然 提交于 2019-12-17 07:11:41
问题 I'm just looking in to the new .NET 4.0 features. With that, I'm attempting a simple calculation using Parallel.For and a normal for(x;x;x) loop. However, I'm getting different results about 50% of the time. long sum = 0; Parallel.For(1, 10000, y => { sum += y; } ); Console.WriteLine(sum.ToString()); sum = 0; for (int y = 1; y < 10000; y++) { sum += y; } Console.WriteLine(sum.ToString()); My guess is that the threads are trying to update "sum" at the same time. Is there an obvious way around

WPF slow to start on x64 in .NET Framework 4.0

…衆ロ難τιáo~ 提交于 2019-12-17 07:08:03
问题 I've noticed that if I build my WPF application for Any CPU/x64, it takes MUCH longer to start (on the order of about 20 seconds) or to load new controls than it does if started on x86 (in release & debug modes, inside or outside of VS). This occurs with even the simplest WPF apps. The problem is discussed in this MSDN thread, but no answer was provided there. This happens only with .NET 4.0 -- in 3.5 SP1, x64 was just as fast as x86. Interestingly, Microsoft seems to know about this problem

Using multiple versions of the same DLL

被刻印的时光 ゝ 提交于 2019-12-17 06:37:10
问题 I've been tasked in creating a new module for an application, and so, I'm adding new DLLs to the project. This is all fine and well. However, in my DLLs I'd like to use a new version of an external DLL (over which I have no control). If I just reference the new DLL and work with that one only, my code will work, but the old code will stop functioning. Could not load file or assembly 'itextsharp, Version=5.0.6.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca' or one of its dependencies. The

How to handle all unhandled exceptions when using Task Parallel Library?

拈花ヽ惹草 提交于 2019-12-17 06:28:22
问题 I'm using the TPL (Task Parallel Library) in .NET 4.0. I want to centralize the handling logic of all unhandled exceptions by using the Thread.GetDomain().UnhandledException event. However, in my application, the event is never fired for threads started with TPL code, e.g. Task.Factory.StartNew(...) . The event is indeed fired if I use something like new Thread(threadStart).Start() . This MSDN article suggests to use Task.Wait() to catch the AggregateException when working with TPL, but that

How to handle all unhandled exceptions when using Task Parallel Library?

霸气de小男生 提交于 2019-12-17 06:28:19
问题 I'm using the TPL (Task Parallel Library) in .NET 4.0. I want to centralize the handling logic of all unhandled exceptions by using the Thread.GetDomain().UnhandledException event. However, in my application, the event is never fired for threads started with TPL code, e.g. Task.Factory.StartNew(...) . The event is indeed fired if I use something like new Thread(threadStart).Start() . This MSDN article suggests to use Task.Wait() to catch the AggregateException when working with TPL, but that

Could not find required file 'setup.bin'

只谈情不闲聊 提交于 2019-12-17 06:08:22
问题 I'm unable to build a Setup Project in VS2010, for a Windows Service project. It fails with this error: Could not find required file 'setup.bin' in 'C:\MyProject\Engine'. My environment is Windows 7 Professional x64 with Visual Studio 2010 Version 10.0.40219.1 SP1Rel I've downloaded Microsoft Windows SDK for Windows 7 and .NET Framework 4, repaired, then rebooted, then installed the unchecked components except Visual C++ compiler, then installed KB2519277. These are the existing registry