Why does my nested HttpModule EndRequest event handler not fire?

I also wanted to modify my headers, but i needed to hide as much as possible. It is the same for Add or Remove or both, it is just headers. 1) You can set MvcHandler.DisableMvcResponseHeader = true; in the global.asax protected void Application_Start() { MvcHandler.DisableMvcResponseHeader = true; } and protected void Application_PreSendRequestHeaders() { Response.Headers.Remove(“Server”); Response.Headers.Remove(“X-AspNet-Version”); …

Read more

Reference a .NET Core Library in a .NET 4.6 project

This can now be done with .Net Core RC2. Here is how: Ensure your .Net RC2 projects’ project.json is configured to include the relevant .net framework. For example this section references .Net 4.51 which can be reference by any of the frameworks equal or above this version: Example: “frameworks”: { “net451”: { }, “netstandard1.5”: { …

Read more

Breaking changes in .NET 4.0

The languages documentation team publishes separate documents for C# and VB breaking changes: VB: http://msdn.microsoft.com/en-us/library/cc714070%28VS.100%29.aspx C#: http://msdn.microsoft.com/en-us/library/ee855831%28VS.100%29.aspx I wrote the C# one and included covariance and contravariance breaking changes mentioned by Eric Lippert, and events changes discussed by Chris Burrows. There are also some breaking changes around optional parameters, embedded interop types, and method group …

Read more

Finding out what exceptions a method might throw in C#

.NET does not have enforced (“checked”) exceptions like java. The intellisense might show this information, if the developer has added a /// <exception…/> block – but ultimately more exceptions can happen than you expect (OutOfMemoryException, ThreadAbortException, TypeLoadException, etc can all happen fairly unpredictably). In general, you should have an idea of what things are likely …

Read more

How can I enable all features of C# 7 in Visual Studio 2017 project?

For arbitrary task-like types you linked to in the 2nd part of your question you need to include the System.Threading.Tasks.Extensions package. The reason you need these NuGet packages is because the new language features rely on new types added to the .NET framework. The new types that the C# language features depend on will not …

Read more