After upgrading Visual Studio to 2015, and projects from MVC 4.x to MVC 5.x, a few projects threw the following compile time and/or runtime error: Attempt by security transparent method ‘WebMatrix.WebData.PreApplicationStartCode.Start()’ to access security critical method ‘System.Web.WebPages.Razor.WebPageRazorHost.AddGlobalImport(System.String)’ failed.
To fix this initial error, upgrade WebHelpers via Nuget:
Install-Package Microsoft.AspNet.WebHelpers
Then it is likely you will receive this error after the nuget command: Could not load file or assembly 'WebMatrix.Data, Version=3.0.0.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)
To fix this new error, upgrade WebPages via Nuget:
Install-Package Microsoft.AspNet.WebPages.Data
Hope this helps!
SQL Server Data Tools Error: The script file could not be found
SSDT reported an error upoin trying to Publish my SQL Server Database project to a dev SQL Server: The script file could not be found
The fix ended up to be extremely simple: Delete the {Project Name}.dbmdl file in the project folder.
Hope this helps!
Using a third-party to generate an ASP.Net machine key is risky, as the third party now has access to your public IP and the generated machine key. But what is a secure way to generate your machine key?
The answer is simple. Use the IIS Administration portal to generate your machine keys. This method is 100% local to your corporate infrastructure, and not shared with anybody but you!
More Info: MSDN Machine Key
Enjoy!