开发者

Invalid schema when building with MSBuild

开发者 https://www.devze.com 2023-02-25 01:32 出处:网络
I\'m trying to debug a build issue where the solution builds correctly via the Visual Studio 2008 IDE, but when I try building via commandline the built executable doesn\'t work properly (it builds, b

I'm trying to debug a build issue where the solution builds correctly via the Visual Studio 2008 IDE, but when I try building via commandline the built executable doesn't work properly (it builds, but when run the executable doesn't function as intended).

I tried using the /val flag and I'm getting invalid schema errors when I try to build a solution.

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'开发者_StackOverflow中文版 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.

The commandline command I'm using:

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

So I have 2 questions:

  1. What does the above error mean?
  2. How do I fix this?


Try:

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

/val is validating the project against the default schema. Since you have modified the project properties, it throws an error. The validate switch was essentially meant to capture this type of a situation where you absolutely wanted to continue with build only if the entire project was valid.

0

精彩评论

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