dotnet / msbuild

The Microsoft Build Engine (MSBuild) is the build platform for .NET and Visual Studio.
https://docs.microsoft.com/visualstudio/msbuild/msbuild
MIT License
5.24k stars 1.35k forks source link

[Broken Build]: /root/.dotnet/sdk/8.0.403/Microsoft.Common.CurrentVersion.targets(2011,5): error MSB3992: 'RootElementName' is not set. When UseAttributeForTargetFrameworkInfoPropertyNames is true, make sure to set a value for 'RootElementName' #10885

Open epitka-sg opened 1 month ago

epitka-sg commented 1 month ago

Issue Description

I have projects that are setup like this

<PropertyGroup>
    <TargetFramework Condition="'$(BuildNet8)' == ''">net6.0</TargetFramework>
    <TargetFrameworks Condition="'$(BuildNet8)' == 'y'">net6.0;net8.0</TargetFrameworks>
    <NoWarn>CS8981</NoWarn>
    <GenerateDocumentationFile>true</GenerateDocumentationFile>
    <LangVersion>latest</LangVersion>
</PropertyGroup>

When I build it from Dockerfile like this

RUN dotnet build -f net8.0 --configuration Release --no-restore --nologo -p:BuildNet8='y' -m:8 -p:CheckEolTargetFramework=false /warnaserror My.sln:

I get error on all projects /root/.dotnet/sdk/8.0.403/Microsoft.Common.CurrentVersion.targets(2011,5): error MSB3992: 'RootElementName' is not set. When UseAttributeForTargetFrameworkInfoPropertyNames is true, make sure to set a value for 'RootElementName'.

Steps to Reproduce

Not sure I can provide example, not can I share my solution

Expected Behavior

I expect it to compile

Actual Behavior

Throws an error

Ask us questions

No response

maridematte commented 1 month ago

Just with this information we are unable to continue investigation, as we can't reproduce or have logs to look at. We recommend attaching a binlog so we can conduct further research. Details on sharing binary logs More information on binary logs NOTE: Binary logs capture environment information. Ensure it does not include any information you don't want to be public before you attach one. If you want to share one just with Microsoft, you can report a problem through Visual Studio  and share it privately with Microsoft.

dotnet-policy-service[bot] commented 3 days ago

This issue is marked as stale because feedback has been requested for 30 days with no response. Please respond within 14 days or this issue will be closed due to inactivity.