.net-4.6

How to mark identity column properly with Entity Framework 6.1?

浪尽此生 提交于 2019-11-28 00:34:23
问题 I've seen many posts and answers regarding how to mark a field as the identity column. Many of them are outdated and are targeting older versions of Entity Framework. Some resources tell me to use an attribute on the field: [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int ID { get; set; } Other resources tell me to add this code to OnModelCreating method: modelBuilder.Entity<User>().Property(u => u.ID).HasDatabaseGeneratedOption(System.ComponentModel.DataAnnotations.Schema

How to run Roslyn instead csc.exe from command line?

放肆的年华 提交于 2019-11-27 22:49:10
After installing VS 2015, running csc.exe from command line causes this message to be displayed to console: This compiler is provided as part of the Microsoft (R) .NET Framework, but only supports language versions up to C# 5, which is no longer the latest version. For compilers that support newer versions of the C# programming language, see http://go.microsoft.com/fwlink/?LinkID=533240 The link redirects to Roslyn's repository at GitHub. So, is the a way to run "compilers that support newer versions" (Roslyn) from command line? It sounds like your path is inappropriate, basically. If you open

Feature 'interpolated strings' is not available in C# 5. Please use language version 6 or greater

戏子无情 提交于 2019-11-27 21:19:28
问题 There is a similar question to this here but I believe that involves a different cause. I moved a class from a newer project into an older project. Both were targeting .net 4.6 however after the move I received the following error on build. Feature 'interpolated strings' is not available in C# 5. Please use language version 6 or greater. I tried setting my project to build with C# 6 in the properties window with no change. 回答1: I eventually found the place to change it. It seems sometimes

How to serialize List<List<object>>?

拜拜、爱过 提交于 2019-11-27 19:39:45
问题 Framework is c# .net 4.6.2 I am generating automatic XML classes from XML codes When I auto generate, it automatically converts as Array[][] But i want to use it as List<List<>> And i am sure that my conversation from Array to List causes some serialization error. I think it is about get and set functions. So i need your help to fix this issue Here the auto generated code piece when i edit > paste special > paste XML as classes /// <remarks/> [System.SerializableAttribute()] [System

How to build .NET 4.6 Framework app without Visual Studio installed?

喜欢而已 提交于 2019-11-27 17:23:12
Until now, I could build .NET 4.5.2 using command line c:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild MySolution.sln The only what I need to install on a computer was .NET Framework and Visual Studio 2010 shell . Now I consider upgrading to .NET 4.6., but I cannot find a way how to build a solution without Visual Studio. I don't want to install Visual Studio 2015, because it is too big for this hosted virtual machine. I hope some MSBuild or Microsoft package installation could be sufficient. Install: The .NET 4.6 Framework The Microsoft Build Tools 2015 The .NET Framework 4.6 targeting

Do I need to target my application to .NET 4.6 to take advantage of RyuJIT?

醉酒当歌 提交于 2019-11-27 14:07:10
问题 Reading from Announcing .NET Framework 4.6 it seems to imply that RyuJIT is only for .NET 4.6. Does that means I will need to re-target my applications to .NET 4.6 for RyuJIT to take effect? 回答1: Short answer: no. Long answer: use the debugger to ensure you have the new version. First have a look-see at the runtime directory with Explorer, navigate to C:\Windows\Microsoft.NET\Framework64\v4.0.30319. You'll find the the two jitters there, clrjit.dll is new jitter based on the Ryujit project

Garbage Collection and Parallel.ForEach Issue After VS2015 Upgrade

柔情痞子 提交于 2019-11-27 13:27:53
I have some code to process several million data rows in my own R-like C# DataFrame class. There's a number of Parallel.ForEach calls for iterating over the data rows in parallel. This code has been running for over a year using VS2013 and .NET 4.5 without issues. I have two dev machines (A and B) and recently upgraded machine A to VS2015. I started noticing a strange intermittent freeze in my code about half the time. Letting it run for a long time, it turns out that the code does eventually finish. It just takes 15-120 minutes instead of 1-2 minutes. Attempts to Break All using the VS2015

Error Invalid option '6' for /langversion; must be ISO-1, ISO-2, 3, 4, 5 or Default

坚强是说给别人听的谎言 提交于 2019-11-27 11:01:37
问题 I am trying to target .NET 4.6 and also take advantage of the latest C# version by changing the C# language version to 6. However during compilation I got this error: Error Invalid option '6' for /langversion; must be ISO-1, ISO-2, 3, 4, 5 or Default If I update the /langversion:6 in Web.Config setting to 5 it works, <system.codedom> <compilers> <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken

How do the semantics of AsyncLocal differ from the logical call context?

允我心安 提交于 2019-11-27 09:56:41
问题 .NET 4.6 introduces the AsyncLocal<T> class for flowing ambient data along the asynchronous flow of control. I've previously used CallContext.LogicalGet/SetData for this purpose, and I'm wondering if and in what ways the two are semantically different (beyond the obvious API differences like strong typing and lack of reliance on string keys). 回答1: The semantics are pretty much the same. Both are stored in the ExecutionContext and flow through async calls. The differences are API changes (just

How to run Roslyn instead csc.exe from command line?

我与影子孤独终老i 提交于 2019-11-26 21:09:46
问题 After installing VS 2015, running csc.exe from command line causes this message to be displayed to console: This compiler is provided as part of the Microsoft (R) .NET Framework, but only supports language versions up to C# 5, which is no longer the latest version. For compilers that support newer versions of the C# programming language, see http://go.microsoft.com/fwlink/?LinkID=533240 The link redirects to Roslyn's repository at GitHub. So, is the a way to run "compilers that support newer