-
Notifications
You must be signed in to change notification settings - Fork 85
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
NoTargets does not work with multi targeting when project extension is .msbuildproj #155
Comments
Another easier workaround, use the .csproj extension instead. Not perfect but it works... |
* Bicep nuget packages fixes Fixes #5253 Fixes #5238 Fixes #5236 * Mitigate lack of multitarget support microsoft/MSBuildSdks#155 * Revert "Mitigate lack of multitarget support" This reverts commit 9dcad82. * Revert "Bicep nuget packages fixes" This reverts commit be85aff. * Add support for arrays in (last)indexOf Closes #4895 * UTs and baseline changes Upgraded Azure.Deployments.* package dependencies to 1.0.546 * Fix test case * Update description.
* Bicep nuget packages fixes Fixes #5253 Fixes #5238 Fixes #5236 * Mitigate lack of multitarget support microsoft/MSBuildSdks#155 * Revert "Mitigate lack of multitarget support" This reverts commit 9dcad82. * Revert "Bicep nuget packages fixes" This reverts commit be85aff. * Cleanup all unused using statements
* Bicep nuget packages fixes Fixes Azure#5253 Fixes Azure#5238 Fixes Azure#5236 * Mitigate lack of multitarget support microsoft/MSBuildSdks#155 * Revert "Mitigate lack of multitarget support" This reverts commit 9dcad82. * Revert "Bicep nuget packages fixes" This reverts commit be85aff. * Add support for arrays in (last)indexOf Closes Azure#4895 * UTs and baseline changes Upgraded Azure.Deployments.* package dependencies to 1.0.546 * Fix test case * Update description.
* Bicep nuget packages fixes Fixes Azure#5253 Fixes Azure#5238 Fixes Azure#5236 * Mitigate lack of multitarget support microsoft/MSBuildSdks#155 * Revert "Mitigate lack of multitarget support" This reverts commit 9dcad82. * Revert "Bicep nuget packages fixes" This reverts commit be85aff. * Cleanup all unused using statements
@bash I think you have a typo in the issue. ist -> is @ViktorHofer I get a build error when using csproj now that I upgraded to VS2022 and uninstalled all old SDKs. Severity Code Description Project File Line Suppression State My xml is <?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.Build.NoTargets/3.3.0" InitialTargets="RunBeforeAnySsrsReport">
<!-- ReSharper disable UnknownProperty -->
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<OutputPath>bin</OutputPath>
<RestoreNoCache>True</RestoreNoCache>
</PropertyGroup>
<ItemGroup>
<Content Include="RunBeforeAnySsrsReport.ps1" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Target Name="RunBeforeAnySsrsReport">
<PropertyGroup>
<PowerShellExe Condition=" '$(PowerShellExe)' == '' ">
"C:\Program Files\PowerShell\7\pwsh.exe"
</PowerShellExe>
<ScriptLocation Condition=" '$(ScriptLocation)' == '' ">$(MSBuildProjectDirectory)\RunBeforeAnySsrsReport.ps1</ScriptLocation>
</PropertyGroup>
<Message Importance="High" Condition=" '$(PowerShellExe)' == '' " Text=" PowerShellExe not configured. ">
</Message>
<Message Importance="High" Condition=" '$(ScriptLocation)' == '' " Text=" ScriptLocation not configured. ">
</Message>
<PropertyGroup>
<PwshCommand>pwsh.exe -NonInteractive -ExecutionPolicy Unrestricted -File "$(ScriptLocation)"</PwshCommand>
</PropertyGroup>
<Message Importance="High" Text=" $(PwshCommand) ">
</Message>
<Exec Command="$(PwshCommand)" ConsoleToMSBuild="true" />
</Target>
</Project> |
@jzabroski Thanks 🙂 |
@jzabroski do you use the latest version of this msbuildsdk? I think that error was fixed recently. |
Apparently setting the To get this working with the .msbuildproj extension, add this code in addition to your <ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
Then you can add the project to a solution file and it will open and build correctly. |
Minimal, Reproducible Example
Source: https://github.com/bash/MSBuildNoTargetsIssueRepro
Failing Travis build: https://travis-ci.com/github/bash/MSBuildNoTargetsIssueRepro/builds/152979950
Error Message:
Possible Workaround
I believe the issue is that Microsoft.Common.CrossTargeting.targets is never imported when the project extension doesn't correspond to a language.
My workaround sets the property
LanguageTargets
to a custom file, that imports CrossTargeting.targetsThe text was updated successfully, but these errors were encountered: