我一直在将几个不同的 VS2008 项目升级到 VS2010,并在转换时发现 VB.Net 项目存在问题。
转换后, .vbproj 文件在 VS2008 中已更改为:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>CustomerManager.xml</DocumentationFile>
<WarningsAsErrors>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036</WarningsAsErrors>
</PropertyGroup>
在 VS2010 中对此:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>CustomerManager.xml</DocumentationFile>
<NoWarn>42353,42354,42355</NoWarn>
<WarningsAsErrors>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036</WarningsAsErrors>
</PropertyGroup>
主要区别在于VS2010版本增加了42353、42354、42355的值;在 IDE 中,这表现为项目属性 | 中的以下设置。编译部分为:
“函数返回没有返回值的内在值类型” = 无
在 Visual Studio 2010 中构建代码时这不是问题,但是当尝试通过我们的持续集成脚本构建代码时,它会失败并出现以下错误:
[msbuild] vbc : Command line error BC2026: warning number '42353' for the option 'nowarn' is either not configurable or not valid
[msbuild] vbc : Command line error BC2026: warning number '42354' for the option 'nowarn' is either not configurable or not valid
[msbuild] vbc : Command line error BC2026: warning number '42355' for the option 'nowarn' is either not configurable or not valid
我在 Google 上找不到这些消息的任何内容,这很奇怪,因为我正试图找出发生这种情况的原因。
关于 Visual Studio 2010 的转换向导为什么这样做的任何建议?
最佳答案
您是否更改了构建脚本以使用 4.0 版本的 MSBuild?在我看来你没有,MSBuild 提示它对警告 42353 等一无所知(如果它们是在 4.0 中引入的,这将是有道理的)
关于visual-studio-2010 - 将 VB.Net 2008 项目升级到 VS2010 时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2803681/