.net-4.0

Why does my WPF application quit unexpectedly on Windows XP SP2?

与世无争的帅哥 提交于 2019-12-11 19:07:08
问题 I've compiled my WPF project on Windows 7 64-bit, using VS 2010 and .NET 4. I have compiled it as a 32-bit application, of course, and it works fine in both 32- and 64-bit versions of Windows Vista/7. But in Windows XP SP2 32-bit, I get an error: wpfApp has encountered a problem and needs to close. We are sorry for the inconvenience." How can I fix this so that my application will run on Windows XP? 回答1: .NET 4 requires Windows XP Service Pack 3. Either upgrade to SP3, or downgrade your

Order of arguments and pipe-right operator

☆樱花仙子☆ 提交于 2019-12-11 18:24:35
问题 Is there a way to simplify the following, so I won't need a runWithTimeout function? let runWithTimeout timeout computation = Async.RunSynchronously(computation, timeout) let processOneItem item = fetchAction item |> runWithTimeout 2000 Edit: Here's why i needed the extra method: let processOneItem item = fetchAction item |> Async.Catch |> runWithTimeout 2000 |> handleExceptions 回答1: Perhaps you mean something like this: let processOneItem item = fetchAction item |> fun x -> Async

Asp.net chart multi-series showing wrong data

六眼飞鱼酱① 提交于 2019-12-11 17:39:19
问题 After solving this problem with asp.net multi-series chart programmatically, I found another problem in another multi-series chart: I want to show a monthly sales report, showing the evolution of the last m months in approved and rejected proposals. Some months, there aren't any rejected proposals, so the following query (C#/Oracle) returns some empty results. select to_char(c.date,'YYYYMM') ctb_month, c.approved, count(distinct c.f1) amt_c, count(b.f1) amt_b, sum(nvl(b.value,0)) sum_values

Convert int to hex and then into a format of 00 00 00 00

柔情痞子 提交于 2019-12-11 16:13:59
问题 I have an integer that gets incremented I then want this in hex so I do the conversion like so: myInt.ToString("X"); I then need a string in the format of 00 00 00 00 but I cannot work out a way to convert the hex string I now have into this format. 回答1: With a Linq query you can do this: string.Join(" ", BitConverter.GetBytes(myInt).Select(x=>x.ToString("x")).ToArray()); 回答2: Fun Mode On Part 1 I can use Regex es for replace! Wozza!!! string str = Regex.Replace( String.Format("{0:X8}", myVal

Can't reference Microsoft.Moles.Framework.dll in Visual Studio 2010 SP1

家住魔仙堡 提交于 2019-12-11 15:28:05
问题 Actually I already resolved this issue but still I'm not really happy with the way I resolved this issue. I have VS2010 SP1 and I need SP1 to work with Azure SDK. First of all installing Pex and Moles somehow created problems with System.XML.dll. It just disappeared from References in all projects. I had to explicitly find it and connect it to all solutions that used it. Also, there was a bigger issue with Moles itself. TestProjects just weren't able to find Microsoft.Moles.Framework.dll. And

How to add spell check in a richtextbox?

我的未来我决定 提交于 2019-12-11 14:32:58
问题 I want to add spell check to my richtextboxes in my application. How can i do that with built in classes in visual studio express 2010? 回答1: Have you looked at this? System.Windows.Controls.SpellCheck http://msdn.microsoft.com/en-us/library/system.windows.controls.spellcheck.aspx 回答2: If you are working on WPF, you can use System.Windows.Controls.SpellCheck. but if you using WinForms you can still use WPF spellcheck with some work. check this SO question for more info. Otherwise you need to

Can I set identity of my WCF service to run as 'Network Service' so it can reach shared network folders?

落花浮王杯 提交于 2019-12-11 13:57:28
问题 When debugging WCF service I need to use the remote share that stores our test data. But, since I host it on a local machine in IIS5 it doesn't have something like an application pool identity as found in IIS6 or 7, so the process running my WCF doesn't have permissions to reach it. How can I configure my WCF service to use a Network Identity so I can have access to shared folders in network? 回答1: You can try to configure it in machine.config. Try to set processModel element to: <processModel

NServiceBus IoC Serialization Exception

家住魔仙堡 提交于 2019-12-11 13:51:19
问题 I am using a "custom" object builder (Autofac) so I can re-use the registration of many types that I have done in a common assembly. When I run the service, hosted within NServiceBus.Host.exe, I get the following error: SerializationException was unhandled: Type 'Autofac.Core.Registration.ComponentNotRegisteredException' in assembly 'Autofac, Version=3.0.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da' is not marked as serializable. This seems odd to me because NServiceBus uses Autofac

Handle serial thread event in WPF GUI class

旧时模样 提交于 2019-12-11 13:41:31
问题 I have a serial port class, and I would like to control send/receive via my GUI, and have the GUI update based on receipt of data from the serial port (or other events). So the two relevant classes are the serial class and the main window class. I have the code below which compiles, but I get an exception when I try to run. public class MySerThread { public SerialPort serport; public event SerialDataReceivedEventHandler newSerData; public MySerThread() { serport = new SerialPort("COM1",

SignalR Hub's Groups dont work with long polling

杀马特。学长 韩版系。学妹 提交于 2019-12-11 13:32:59
问题 I have a Web App(.NET 4.0 ASP.NET MVC3) which uses SignalR(1.0.0 alpha 2) with Hubs and Persistent Connections. With the Hubs I use groups to send push notifications to some clients. The problem is that when the server is accessed remotely it defaults to long pooling and only the persistent connections work. With hubs the event happens on the server but my callback is not called at the client. It works locally, though it uses SSE. What I found is that the combination of Grouping the clients