Home Dashboard Directory Help
Search

Converting VS2008 to VS2010 - cannot build using .net 3.5 because of unknown warnings by AdamConway


Status: 

Closed
 as Fixed Help for as Fixed


1
0
Sign in
to vote
Type: Bug
ID: 625344
Opened: 11/29/2010 3:48:45 AM
Access Restriction: Public
1
Workaround(s)
view
1
User(s) can reproduce this bug

Description

I have an ASP MVC2 web project that I developed using VS2008. I recently upgrade to VS2010. I went through the upgrade wizard the first time I open the project in VS2010. When I came to the "Do you want to convert this site to use .net framework version 4" question I answered "no". This is because I wanted to build against .net 3.5 so that I know I can deploy to the production servers without needing to upgrade them to .net 4 first. It works fine locally (and is still targetting .net 3.5) but when I try to build it using the command line invocation of msbuild that our build script uses I get the following error:

vbc : Command line error BC2026: warning number '42353' for the option 'nowarn' is either not configurable or not valid
vbc : Command line error BC2026: warning number '42354' for the option 'nowarn' is either not configurable or not valid
vbc : Command line error BC2026: warning number '42355' for the option 'nowarn' is either not configurable or not valid

Is there some new version of msbuild for 3.5 which understands these warning codes? Yes, I can just remove the three codes from the .vbproj file, but I still count this as a bug - when I answered "no" to the upgrade question I expected to be able to build the project using the .net 3.5 msbuild that I have always used.

The msbuild there reports itself as "Microsoft (R) Build Engine Version 3.5.30729.1". On my development machine it reports as "Microsoft (R) Build Engine Version 3.5.30729.4926" so there is a difference there, but I woldn't have expected it to be a problem like this given it's the build number only that changes - or?

My development machine is Windows 7 while the build machine (and production machine) is Server 2008.
Details
Sign in to post a comment.
Posted by Microsoft on 2/25/2011 at 4:27 PM
Thanks for reporting this issue you've encountered with Visual Studio!

This is indeed a catch 22 - if we don't add these /nowarn switches, existing apps will start showing new warnings, but if we do add them, then downtargeted ASP.NET projects will have the issue you discovered when you deploy.

We can't do anything now for .NET 3.5 projects, but we've taken steps to prevent this issue in the future. We've changed BC2026, the error about an invalid /nowarn value, to be a warning instead, even if /warnaserror is specified. You'll see this fix in the version of Visual Studio after VS 2010 - this will let future versions of Visual Studio downtarget to this next version, even if they've added /nowarn switches specific to the future version.

Alex Turner
Program Manager
Visual Basic and C# Compiler
Posted by Microsoft on 12/2/2010 at 5:40 PM
Thanks for your feedback.
We are routing this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by AdamConway on 12/2/2010 at 12:15 AM
Hi,

I've now attached a ZIP file containing an example. I created a new ASP MVC profject in VS2008. Didn't change anything there. I then opened it in VS2010, went through the conversion wizard (answering "no" to ther questions about upgrading the .net framework version). I then copied both to my build machine (which is a Windows Server 2008 machine) and ran the following command from the command line inside each solution directory:
        C:\Windows\Microsoft.NET\Framework\v3.5\msbuild UpgradeTest\UpgradeTest.vbproj >log.txt
The zip file attached includes the log.txt too.

The 2008 version built fine, the 2010 version failed. Further investigation with my own project has indicated that the problem is the "Function returning intrinsic value type without return value" option under warning configurations on the compile tab of the project properties. This is a new option in VS2010 and for some reason sets to "None" by default (on upgrade at least), instead of to "Warning" (which I would have expected to be the default status for a warning?). Anyway, this adds some error codes to the <None> tag in the vbproj file. The msbuild on the server 2008 machine doesn't recognise those warning numbers at all, so it just gives an error and stops.

I have not tried other project types, so I don't know if this is specific to ASP MVC projects or not.
Posted by Microsoft on 12/1/2010 at 10:37 PM
Hello,

Sorry for bothering. Is there any update?

It would be greatly appreciated if you could provide us with that information as quickly as possible. If we do not hear back from you within 7 days, we will close this issue.

Thanks you,
Posted by Microsoft on 11/29/2010 at 8:41 PM

Thank you for reporting this issue. Unfortunately, we are unable to reproduce the issue with the steps you provided.

Could you please provide us with a sample project zip?

It would be greatly appreciated if you could provide us this information as quickly as possible.

Thank you,
Posted by Microsoft on 11/29/2010 at 4:20 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Posted by Microsoft on 11/29/2010 at 4:20 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.
Posted by AdamConway on 12/2/2010 at 12:16 AM
After upgrade, change the "Function returning intrinsic value type without return value" option under warning configurations on the compile tab of the project properties from "None" to "Warning"
File Name Submitted By Submitted On File Size  
UpgradeProblem.zip 12/2/2010 782 KB