.net-4.6

Thread.Abort in ASP.NET app causes w3wp.exe to crash

三世轮回 提交于 2019-11-30 07:15:44
Please do not set duplicate flag on this qustion - it is not about "why ThreadAbortException occurs", it is about "why w3wp.exe process terminates after ThreadAbortException". Let's say we have simple web application with following code sample: protected void Page_Load(object sender, EventArgs e) { Response.Redirect("http://google.com"); } Which by fact means something like (see Is Response.End() considered harmful? ): protected void Page_Load(object sender, EventArgs e) { ...response write some data... System.Threading.Thread.CurrentThread.Abort(); } On my machine (Windows 10 Pro + IIS) this

Visual Studio 2013 and .NET 4.6

扶醉桌前 提交于 2019-11-30 02:36:54
I'm trying to set the 4.6 .NET framework for my project and in the settings, as it wasn't listed, I chose the last option - to install more frameworks. That directed me to a page where I selected VS2013, clicked on .NET 4.6 and downloaded the software but despite the installation being successful and restart of the computer, I still don't get to see the 4.6 .NET in the list of available options. I've googled around for it and found mentioned that 4.6 is available on Win 8.1 (which is my system). However it doesn't say explicitly that it's available for VS 2013 (it doesn't say that it isn't,

Always use the 'async' and 'await' keywords in asynchronous methods in a library?

两盒软妹~` 提交于 2019-11-29 11:59:23
问题 Summary : In a library method, when should I use the async and await keywords instead of returning a Task directly? I believe my question is related to this one. However, that question is about .NET 4.0 and the TPL, while I'm using .NET 4.6 with the async and await keywords. So, I think my question might get different answers because these keywords didn't exist when the linked question was answered. Explanation: I'm writing a simple wrapper for an external WCF service and the wrapper makes

Thread.Abort in ASP.NET app causes w3wp.exe to crash

非 Y 不嫁゛ 提交于 2019-11-29 09:23:50
问题 Please do not set duplicate flag on this qustion - it is not about "why ThreadAbortException occurs", it is about "why w3wp.exe process terminates after ThreadAbortException". Let's say we have simple web application with following code sample: protected void Page_Load(object sender, EventArgs e) { Response.Redirect("http://google.com"); } Which by fact means something like (see Is Response.End() considered harmful?): protected void Page_Load(object sender, EventArgs e) { ...response write

How to mark identity column properly with Entity Framework 6.1?

空扰寡人 提交于 2019-11-29 07:12:57
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.DatabaseGeneratedOption.Identity); Which one should I use? First, second, both, doesn't matter, or

DateTimePicker garbled after Windows 10 Creators Update

China☆狼群 提交于 2019-11-29 04:23:15
Application built with VS 2015, C#, Winforms, using the DateTimePicker Windows control, text is garbled after updating machines to the Windows Creators Update. Has anyone else come across this or is there any suggested work around ? The June cumulative update for Windows 10 (KB 4022725) includes an updated COMCTL32.DLL that contains a fix for this issue. The file version should be 5.82.15063.413 after the update is installed. https://social.msdn.microsoft.com/Forums/en-US/4cf03067-46c4-4962-af8c-f4b1483e88ba/date-time-picker-garbled-after-windows-10-creators-update?forum

Visual Studio 2013 and .NET 4.6

被刻印的时光 ゝ 提交于 2019-11-28 23:32:34
问题 I'm trying to set the 4.6 .NET framework for my project and in the settings, as it wasn't listed, I chose the last option - to install more frameworks. That directed me to a page where I selected VS2013, clicked on .NET 4.6 and downloaded the software but despite the installation being successful and restart of the computer, I still don't get to see the 4.6 .NET in the list of available options. I've googled around for it and found mentioned that 4.6 is available on Win 8.1 (which is my

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

送分小仙女□ 提交于 2019-11-28 18:04:50
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=b77a5c561934e089" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701"> But how do

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

无人久伴 提交于 2019-11-28 16:48:26
.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). i3arnon The semantics are pretty much the same. Both are stored in the ExecutionContext and flow through async calls. The differences are API changes (just as you described) together with the ability to register a callback for value changes. Technically,

How to serialize List<List<object>>?

巧了我就是萌 提交于 2019-11-28 14:52:27
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.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType =