Using .Net 2.0 Web Links in Visual Studio 2010

I have a .NET 3.5 class library project that I migrated to Visual Studio 2010. It still targets .Net 3.5. This project contains two ASP.Net 2.0 web links (with auto-generated Reference.cs files).

During the transition to VS 2010, the Reference.cs files were updated to use .Net 4.0. In particular, the constructor attribute has been changed.

The original was:

[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.3053")]

New value:

[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]

I change the values ​​in the Reference.cs file, but the attributes change back whenever I run the Refresh Web Link command. I also tried adding a new web service link for the project, and they also target .Net 4.0.

Is there a way to prevent these Reference.cs files from being updated to use .Net 4.0?

+3
source share
2 answers

This version number does not mean that web links use 4.0 constructs. Version a identifier is GeneratedCodeAttributeused to track the version of the tool generated by the code. Thus, in essence, this code was generated using only the web generation tools 4.0.

+3
source

Could you just delete the web links and add them back manually?

-1
source

Source: https://habr.com/ru/post/1761773/


All Articles