使用MSBuild构建时无效的架构

时间:2011-04-14 15:37:17

标签: visual-studio visual-studio-2008 msbuild

我正在尝试调试构建问题,其中解决方案通过Visual Studio 2008 IDE正确构建,但是当我尝试通过命令行构建时,构建的可执行文件无法正常工作(它构建,但运行时可执行文件没有' t按预期运行)。

我尝试使用/ val标志,当我尝试构建解决方案时,我收到了无效的架构错误。

C:\LuxRender\windows\lux.sln.cache(3,6): Schema validation error MSB4045: Project is not valid. The element 'PropertyGroup' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003' has invalid child element '_SolutionProjectConfiguration' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003'. List of possible elements expected: 'Property' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003'. C:\LuxRender\windows\lux.sln.cache(8,6): Schema validation error MSB4045: Project is not valid. The element 'ItemGroup' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003' has invalid child element '_SolutionProjectProjects' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003'. List of possible elements expected: 'Item' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003'. C:\LuxRender\windows\lux.sln.cache : Schema validation error MSB4042: Stopping because of syntax errors in project file. MSBUILD : Schema validation error MSB4045: Project is not valid. The element 'PropertyGroup' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003' has invalid child element '_SolutionProjectConfiguration' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003'. List of possible elements expected: 'Property' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003'. MSBUILD : Schema validation error MSB4045: Project is not valid. The element 'ItemGroup' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003' has invalid child element '_SolutionProjectProjects' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003'. List of possible elements expected: 'Item' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003'. MSBUILD : Schema validation error MSB4042: Stopping because of syntax errors in project file.

我正在使用的命令行命令:

msbuild lux.sln /nologo /val /property:Configuration=Release;Prlatform=x64 target:rebuild

所以我有两个问题:

  1. 上述错误意味着什么?
  2. 我该如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

尝试:

msbuild lux.sln /nologo /p:Configuration=Release /p:Platform=x64 /t:rebuild

/ val正在根据默认架构验证项目。由于您已修改了项目属性,因此会引发错误。验证开关本质上是为了捕获这种情况,只有整个项目有效时,你绝对想要继续构建。