Convert .Net Framework 4.6.2 project to .Net core project

This appears to be an official Microsoft resource for doing the migration. Summarized below: (recommended) Retarget all projects you wish to port to target the .NET Framework 4.7.2 or higher. (recommended) Use the .NET Portability Analyzer to analyze your assemblies and see if they’re portable to .NET Core. (recommended) Install the .NET API analyzer into …

Read more

preventing cross-site request forgery (csrf) attacks in asp.net web forms

You could try the following. In the Web-Form add: <%= System.Web.Helpers.AntiForgery.GetHtml() %> This will add a hidden field and a cookie. So if you fill out some form data and post it back to the server you need a simple check: protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) AntiForgery.Validate(); // throws an exception …

Read more

Could not load file or assembly System.Runtime, Version=4.1.2.0

The Assembly Binding’s might be wrong. DELETE the app.config or web.config AssemblyBinding sections. Then run this BindingRedirect in the Package Manager window: Get-Project –All | Add-BindingRedirect Optional: If you upgrade the framework version of all projects, you will need to reinstall all Nuget packages for all projects. To do that easily use this package managers …

Read more

Error CS1056: Unexpected character ‘$’ running the msbuild on a tfs continuous integration process

The problem can be fixed installing a Nuget package Microsoft.Net.Compilers. Below is the link of my highlighted answer: Project builds fine with Visual Studio but fails from the command line That feature is a syntactic sugar for C#6, try to install the latest version of the framework 4.6.2 https://www.microsoft.com/en-us/download/details.aspx?id=53345 Then go to your Project properties …

Read more

How to find out which .NET framework nuget package targets?

Cannot comment on the previous answer, but the targetFramework attribute in packages.config is the .NET version of the project at the time that package was installed. For example, I have two projects that use Newtonsoft.Json 9.0.1, and these are the lines in their respective packages.config files: <package id=”Newtonsoft.Json” version=”9.0.1″ targetFramework=”net452″ /> and <package id=”Newtonsoft.Json” version=”9.0.1″ …

Read more

Why are three properties in DbParameterCollection abstract in reference assemblies but virtual otherwise?

The reference assemblies are correct. In .NET Framework 4.5, these properties were abstract. They were changed to virtual in .NET Framework 4.5.1. It appears you’ve uncovered a documentation bug. As you probably have already guessed, the difference between the two System.Data.dll assemblies you are observing is due to how .NET Framework separates reference assemblies and …

Read more

Convert .Net Core to .Net Framework

I have loaded core project to the VS 2017 RC Community and open *.csproj in text editor. Just delete teg <RuntimeFrameworkVersion> and replace <TargetFramework>netcoreapp1.1</TargetFramework> to <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> And after all in project properties set to any another framework and reset back (VS reload and repair *.csproj file).