.net-4.5

EntityFramework (6) and async ( waitingForActivation)?

[亡魂溺海] 提交于 2019-12-24 13:26:23
问题 I've downloaded EF6 ( in order to use async ) So I wrote this simple method : public async Task<List<int>> MyasyncMethod() { var locations = await MyDumpEntities.AgeGroups.Select(f=>f.endYear).ToListAsync(); return locations; } ...Later... DumpEntities1 MyDumpEntities = new DumpEntities1(); var data = MyDumpEntities.AgeGroups.ToListAsync(); MyasyncMethod().ContinueWith(s => { Response.Write("f"); }); MyDumpEntities.Dispose(); But I don't see anything on the screen and when I inspect data I

InstallShield with .NET 4.5 nested installation

拜拜、爱过 提交于 2019-12-24 08:39:16
问题 My installer needs to redistribute the .NET framework, but I don't want to have a setup.exe wrapper so I've written a Custom Action to launch the web installer for .NET if the end-users machine does not already have it. This works perfectly fine with .NET 4.0 and .NET 3.5 but for .NET 4.5 the .NET installer reports "waiting for another install to complete" and fails - this error msg would be correct if my Custom Action was in the Exec sequence, but I specifically placed it very early in the

How to redirect Assembly Versions in wpf?

落花浮王杯 提交于 2019-12-24 06:58:19
问题 How to redirect Assembly Versions in WPF? Following http://msdn.microsoft.com/en-us/library/7wd6ex19(v=vs.110).aspx#bypass_PP throws File Load exception. Could not load file or assembly 'Microsoft.Practices.Unity, Version=2.1.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"

Not reach the code as expected

蹲街弑〆低调 提交于 2019-12-24 06:55:52
问题 I have a telephony application, in which I want to invoke simultaneous calls,. Each call will occupy a channel or port. So I added all channels to a BlockingCollection. The application is a windows service. Let's see the code. public static BlockingCollection<Tuple<ChannelResource, string>> bc = new BlockingCollection<Tuple<ChannelResource, string>>(); public static List<string> list = new List<string>();// then add 100 test items to it. The main application has the code: while (true) {

Not reach the code as expected

与世无争的帅哥 提交于 2019-12-24 06:53:07
问题 I have a telephony application, in which I want to invoke simultaneous calls,. Each call will occupy a channel or port. So I added all channels to a BlockingCollection. The application is a windows service. Let's see the code. public static BlockingCollection<Tuple<ChannelResource, string>> bc = new BlockingCollection<Tuple<ChannelResource, string>>(); public static List<string> list = new List<string>();// then add 100 test items to it. The main application has the code: while (true) {

Winforms ListView MouseUp event firing more than once

怎甘沉沦 提交于 2019-12-24 05:00:10
问题 In my .NET 4,5 Winforms application, the ListView control's MouseUp event is firing multiple times when I open a file from that event as follows: private void ListView1_MouseUp(object sender, MouseEventArgs e) { ListViewHitTestInfo hit = ListView1.HitTest(e.Location); if (hit.SubItem != null && hit.SubItem == hit.Item.SubItems[1]) { System.Diagnostics.Process.Start(@"C:\Folder1\Test.pdf"); MessageBox.Show("A test"); } } Note: When clicking on the SubItem1 of the listview, the file opens but

Load a Certificate Using X509Certificate2 with ECC Public Key

一曲冷凌霜 提交于 2019-12-24 04:56:50
问题 This is a newbie question. I'm trying to load a .der certificate using: X509Certificate2 cert = new X509Certificate2(@"c:\temp\mycert.der"); RSACryptoServiceProvider csp = (RSACryptoServiceProvider)cert.PublicKey.Key But I get a "The certificate key algorithm is not supported" error on the 2nd line. When I import this certificate to MMC I can see the public key like . Is it valid? How do I get it in code? 回答1: Prior to .NET 4.6.1 ECDSA keys were not supported. For legacy/compatibility reasons

Load a Certificate Using X509Certificate2 with ECC Public Key

梦想与她 提交于 2019-12-24 04:56:04
问题 This is a newbie question. I'm trying to load a .der certificate using: X509Certificate2 cert = new X509Certificate2(@"c:\temp\mycert.der"); RSACryptoServiceProvider csp = (RSACryptoServiceProvider)cert.PublicKey.Key But I get a "The certificate key algorithm is not supported" error on the 2nd line. When I import this certificate to MMC I can see the public key like . Is it valid? How do I get it in code? 回答1: Prior to .NET 4.6.1 ECDSA keys were not supported. For legacy/compatibility reasons

Getting a System.AccessViolationException only during debug

扶醉桌前 提交于 2019-12-24 03:14:22
问题 UPDATE I've changed the question with my latest findings and simplified as much as possible. I have the following piece of code public virtual int DefineAction(bool b, string s, Type1 t1, Type2 t2) { return 1; } public ProcessResult Process(bool b, string s, Type1 t1, Type2 t2) { int i = DefineAction(b, s, t1, t2); // more code } When I put a breakpoint on the Line var int i= ... and I try to step through it I get an AccessVialoationExeption UPDATE: If I remove virtual for the function

Name attribute of DataMember in WCF looks like not working

和自甴很熟 提交于 2019-12-24 02:57:13
问题 I have WCF service exposed to multiple client. In some of client datamember name casing was not proper. My Class properties have invalid property name as per casing standards like public class TransactionParamter { [DataMember] public string orderId; [DataMember] public string orderDetails; [DataMember] public double orderSumTotal; } I have tried to change it to public class TransactionParamter { [DataMember(Name= "orderId")] public string OrderId; [DataMember(Name= "orderDetails")] public