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

Proper localization of a WinForms application

I’ve just completed a C# .Net 3.5 project with a similar problem. We were writing WinForms plugin for an existing multi-lingual application with 8 languages (including English). This is how we did it: Create all our forms and UI in the default language, English. Put all our internal strings in a resource file (stuff not … 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

tech