-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build error MSB4067 (UnrecognizedChildElement) when building a solution with rptproj or dwproj projects #2064
Comments
I recently added our .rptproj back into our solution file once I saw the availability of the Reporting Services extension for VS 2017. Our solution builds fine on the dev boxes, but is broken on our build server - even though I have installed the Reporting Services Projects on the build machine as well. It's concerning that no one from the team has commented for almost 2 months. |
This is a big breaking change. We too now have broken solutions on our build machines because of this. Can someone please triage? |
Thanks for the report! MSBuild has some code that attempts to detect whether projects referred to from the solution are MSBuild projects or some other format. In #1089, this logic was simplified to support the new simplified project files, which removed a check that the project specified the MSBuild namespace. A simple .rptproj looks like this: <?xml version="1.0" encoding="utf-8"?>
<Project xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2000/10/XMLSchema" ToolsVersion="2.0">
<DataSources />
<Reports />
</Project> The fact that its top-level element is
|
Workarounds
<Project InitialTargets="WorkAroundMSBuild2064">
<Target Name="WorkAroundMSBuild2064">
<!-- Work around https://github.com/Microsoft/msbuild/issues/2064 by
removing *.rptproj from the generated solution metaproject. -->
<ItemGroup>
<ProjectReference Remove="%(ProjectReference.Identity)"
Condition="'@(ProjectReference->'%(Extension)')' == '.rptproj'" />
</ItemGroup>
</Target>
</Project>
|
Spoke to @AndyGerlicher about this. The more-permissive namespace check in the real MSBuild project parser requires that the namespace be either the MSBuild namespace or not specified. The same check could be applied in the solution parser. |
Thanks for the workarounds! I'm trying out the I'm currently still hitting the issue at a later point in the build due to a solution Project Dependency: one of my csproj projects depends on an rptproj project (this was done to cause the build of the csproj to trigger the build of the rptproj). The error shows the steps:
Is there a way to similarly exclude rptproj references from the generate project metaproject? I tried the same pattern of |
@AndrewBennet Unfortunately, no, I don't see a nice way to prevent emitting those references into the |
OK - I'll remove the solution dependency for now. Thanks 👍 |
Any updates or timeline on when this issue will be resolved? |
* Check that the schema matches either empty or the MSBuild default schema when building a solution file. * Special case .rptproj files. This file format looks like a standard MSBuild file but specifies ToolsVersion=2.0 and a default XML schema. Since the XML parser treats that schema as equivalent to empty and empty is now allowed, there's no good way to determine if it's an MSBuild file until we try to parse. This results in an error in MSBuild 15 rather than a warning in MSBuild 14 for solutions with a .rptproj file. To solve this, the sln build will now allow projects where the schema is the default MSBuild schema or empty and ToolsVersion is not 2.0. Partial fix for dotnet#2064
Just discovered that the ability to build rptproj projects with MSBuild has been added in the last few weeks: https://blogs.msdn.microsoft.com/sqlrsteamblog/2017/09/25/msbuild-support-for-reporting-services-projects-now-available/ Have not tried this out yet, but upgrading the rptproj projects to the latest format would presumably get around this problem. Update: Having updated the SSRS Visual Studio plugin and upgraded the SSRS projects to the latest format, this issue no longer occurs. I can restore the solution dependecies 🎉 |
* Check that the schema matches either empty or the MSBuild default schema when building a solution file. * Special case .rptproj files. This file format looks like a standard MSBuild file but specifies ToolsVersion=2.0 and a default XML schema. Since the XML parser treats that schema as equivalent to empty and empty is now allowed, there's no good way to determine if it's an MSBuild file until we try to parse. This results in an error in MSBuild 15 rather than a warning in MSBuild 14 for solutions with a .rptproj file. To solve this, the sln build will now allow projects where the schema is the default MSBuild schema or empty and ToolsVersion is not 2.0. Partial fix for dotnet#2064
Are .dtproj projects being added in the same fix? |
Any updates for *.dtproj ? We have this issue on our customer and we need to build as soon as possible. |
I am seeing the same error with my .dtproj
Should I open a new issue for building ispac's from dtproj? |
@richardlhughes: This workaround does work for dtproj too. |
Confirmed. |
@rainersigwald - is this workaround still the only way to make this work on an Azure DevOps hosted build agent? |
HI, I am having .dtproj and .rptproj in a solution. i was getting errors for SSRS as well as SSIS. with this workaround, i could solve ssrs error message. Now SSIS is still there. I added : Can you please let me know how to add .dtproj referance ? |
Is there any plan to resolve fundamentally this issue? |
Is there any update on this issue? |
@arielman what is helping TFS update 2 ? |
How about adding |
FYI.. @marcpopMSFT @dotnet/msbuild team this issue has 23 upvotes from the community in NuGet/Home#7796. In summary, NuGet.exe invokes msbuild.exe during restore to identify the project references for a project. As per @kartheekp-ms's analysis NuGet/Home#7796 (comment), 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. |
@rainersigwald I'm upgrading some SSAS dwproj files from 2019 to VS 2022, and I'm getting a build failure that just says Object reference not set to an instance of an object. Is there a similar workaround to get the dwproj file to build and deploy in Visual studio 2022? |
@thelaziestgenius are you building from Visual Studio, or using |
I'm building from Visual Studio. Is there a way to build in MSBuild.exe to get more logging? |
@thelaziestgenius If you're building from Visual Studio, you're not hitting the problem tracked by this issue, which manifests only for command-line builds. I think you'll have to ask in the support channels for that plugin. |
@rainersigwald I've reached out to the team that manages the Microsoft Analysis Services Projects extension. I ran this command and got the following error: Error: "C:\Projects\SSAS.dwproj" (go target) (1) ->
Time Elapsed 00:00:00.04 I've also tried running it with the 2022 exe explicitly: |
@thelaziestgenius that is not expected to work, because |
Mitigates #2064 Context This is an alternate way to fix the same problem. This is incomplete: it would still need to replace "dwproj" with the !projectsKnownToBeMSBuild and add a warning.
When using MSBuild 15.0, cleaning or building a solution which contains rptproj or dwproj projects gives the following error:
When using MSBuild 14.0, the behaviour is better: it logs warnings (MSB4078) about unsupported projects:
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.
The text was updated successfully, but these errors were encountered: