开发者

Using a .Net 2.0 Web Reference in Visual Studio 2010

开发者 https://www.devze.com 2023-01-13 12:23 出处:网络
I 开发者_StackOverflow社区have a .Net 3.5 class library project that I\'ve migrated to use Visual Studio 2010. It still targets .Net 3.5. This project contains two ASP.Net 2.0 style Web References (wi

I 开发者_StackOverflow社区have a .Net 3.5 class library project that I've migrated to use Visual Studio 2010. It still targets .Net 3.5. This project contains two ASP.Net 2.0 style Web References (with the auto generated Reference.cs files).

During the migration to VS 2010, the Reference.cs files were updated to use .Net 4.0. Specifically, the constructor attribute was change.

The original was:

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

The new value is:

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

I change the values back in the Reference.cs file, but the attributes are change back whenever I run the "Update Web Reference" command. I also tried adding a new Web Service reference to the project, and they also appear to target .Net 4.0.

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


This version number does not mean the web references are using 4.0 constructs. The version identifier a GeneratedCodeAttribute is used to track the version of the tool that generated the code. So it's essentially saying this code was generated using 4.0 web generation tool only.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号