msbuild: Build error MSB4067 (UnrecognizedChildElement) when building a solution with rptproj or dwproj projects
When using MSBuild 15.0, cleaning or building a solution which contains rptproj or dwproj projects gives the following error:
Reports.rptproj(3,3): error MSB4067: The element <State> beneath element <Project> is unrecognized.
When using MSBuild 14.0, the behaviour is better: it logs warnings (MSB4078) about unsupported projects:
warning MSB4078: The project file “Reports.rptproj” is not supported by MSBuild and cannot be built.
The latter behaviour is more desirable (for me, at least): I would like to able to build a solution in a configuration which includes the .rptproj files. This would allow me to include these projects when building the solution in Visual Studio, and to be able to use the same configuration when building the solution via an MSBuild script.
Is this change of behaviour a bug? The message certainly seems like it is attempting to parse the rptproj file into some structure to which it doesn’t belong. If it is not, is there a way to downgrade the error MSB4067 to a warning, or to skip certain projects when building a solution? The /ignoreprojectextensions:.rptproj option does not prevent the error.
Note: this issue relates to this Stack Overflow post.
About this issue
- Original URL
- State: open
- Created 7 years ago
- Reactions: 12
- Comments: 28 (7 by maintainers)
Commits related to this issue
- Check schema when performing a sln build. * Check that the schema matches either empty or the MSBuild default schema when building a solution file. * Special case .rptproj files. This file format loo... — committed to AndyGerlicher/msbuild by AndyGerlicher 7 years ago
- Check schema when performing a sln build. * Check that the schema matches either empty or the MSBuild default schema when building a solution file. * Special case .rptproj files. This file format loo... — committed to AndyGerlicher/msbuild by AndyGerlicher 7 years ago
- Avoid building dwproj (#7708) Mitigates https://github.com/dotnet/msbuild/issues/2064 Context This is an alternate way to fix the same problem. This is incomplete: it would still need to replace ... — committed to dotnet/msbuild by Forgind 2 years ago
Workarounds
.slnfile with the special nameafter.{yoursolutionname}.sln.targets:devenv {path_to_solution.sln} /build.rptprojfiles from buildingAny updates or timeline on when this issue will be resolved?
FYI… @marcpopMSFT @dotnet/msbuild team this issue has 23 upvotes from the community in https://github.com/NuGet/Home/issues/7796. In summary, NuGet.exe invokes msbuild.exe during restore to identify the project references for a project. As per @kartheekp-ms’s analysis https://github.com/NuGet/Home/issues/7796#issuecomment-1076622574, it looks like something changed in msbuild version after 15.9 where msbuild.exe started returning a failure exit code when trying to read project references for a custom project (for example vdproj in this case). This happens even when ContinueOnError is set to WarnAndContinue (new behavior after 15.9 version). NuGet raises an exception in this case causing restore failures.
Is there any update on this issue?
Is there any plan to resolve fundamentally this issue?
This is a big breaking change. We too now have broken solutions on our build machines because of this. Can someone please triage?