Skip to content

Various SDK build fixes within VS #49748

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

Merged
merged 7 commits into from
Jul 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
<!-- NU1701 Disable implicit package target fallback, and disable warning for when we explicitly add it (currently needed for
Microsoft.ApplicationInsights) -->
<!-- NU1507 Disable multi-feed check as .NET uses multiple internal feeds intentionally -->
<NoWarn>$(NoWarn);NU1701;NU1507;NU1202</NoWarn>
<!-- NU5039 Disable NuGet is unable to find the readme file in the package. -->
<NoWarn>$(NoWarn);NU1701;NU1507;NU1202;NU5039</NoWarn>
<!-- do not enable analyzers on source build-->
<EnforceCodeStyleInBuild Condition="'$(DotNetBuildSourceOnly)' != 'true'">true</EnforceCodeStyleInBuild>
<UseSharedCompilation Condition="'$(DotNetBuildSourceOnly)' == 'true'">false</UseSharedCompilation>
Expand Down
2 changes: 1 addition & 1 deletion sdk.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@
</Folder>
<Folder Name="/src/Workloads/" />
<Folder Name="/src/Workloads/Manifests/">
<Project Path="src/Workloads/Manifests/manifest-packages.proj" Type="C#" />
<Project Path="src/Workloads/Manifests/manifest-packages.csproj" />
</Folder>
<Folder Name="/src/Workloads/VSInsertion/">
<Project Path="src/Workloads/VSInsertion/workloads.csproj" />
Expand Down
6 changes: 3 additions & 3 deletions src/Layout/redist/redist.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,18 @@
<ProjectReference Include="tools\tool_msbuild.csproj" />
<ProjectReference Include="tools\tool_nuget.csproj" />
<ProjectReference Include="..\..\Cli\dotnet\dotnet.csproj" />
<ProjectReference Include="..\..\Workloads\Manifests\manifest-packages.proj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" />
<ProjectReference Include="..\..\Workloads\Manifests\manifest-packages.csproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" />
<ProjectReference Include="..\..\Tasks\Microsoft.NET.Build.Tasks\Microsoft.NET.Build.Tasks.csproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" />
<ProjectReference Include="..\..\Tasks\Microsoft.NET.Build.Extensions.Tasks\Microsoft.NET.Build.Extensions.Tasks.csproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" />
<ProjectReference Include="..\..\Resolvers\Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver\Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.csproj" />
<ProjectReference Include="$(RepoRoot)src\BuiltInTools\dotnet-watch\dotnet-watch.csproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" Private="false" />
<ProjectReference Include="$(RepoRoot)src\BuiltInTools\dotnet-format\dotnet-format.csproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" Private="false" />
<ProjectReference Include="$(RepoRoot)src\BuiltInTools\dotnet-format\dotnet-format.csproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" Private="false" />

<ProjectReference Include="$(RepoRoot)template_feed\*\*.csproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" Private="false" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\finalizer\finalizer.csproj" Condition="'$(OS)' == 'Windows_NT'" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" Private="false" />
<ProjectReference Include="..\finalizer\finalizer.csproj" Condition="'$(OS)' == 'Windows_NT'" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" Private="false" />
</ItemGroup>

<!-- In .NET product build mode, explicitly build workloads in build pass 2.
Expand Down
2 changes: 1 addition & 1 deletion src/Layout/redist/targets/BundledManifests.targets
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
<Copy SourceFiles="@(ManifestContent)"
DestinationFolder="$(RedistInstallerLayoutPath)sdk-manifests/%(DestinationPath)" />

<MSBuild Projects="$(RepoRoot)src\Workloads\Manifests\manifest-packages.proj"
<MSBuild Projects="$(RepoRoot)src\Workloads\Manifests\manifest-packages.csproj"
Targets="LayoutBuiltinManifests"
Properties="ManifestDirectory=$(RedistInstallerLayoutPath)sdk-manifests\" />
</Target>
Expand Down
8 changes: 4 additions & 4 deletions src/Layout/redist/targets/GenerateMSIs.targets
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
<Output TaskParameter="GeneratedGuid" PropertyName="SdkInstallerUpgradeCode" />
</GenerateGuidFromName>

<Exec Command="powershell -NoProfile -NoLogo $(SdkGenerateMsiPowershellScript) ^
<Exec Command="powershell -NoProfile -NoLogo -ExecutionPolicy Bypass $(SdkGenerateMsiPowershellScript) ^
'$(IntermediateSdkInstallerOutputPath.TrimEnd('\'))' ^
'$(SdkMSIInstallerFile)' ^
'$(WixRoot)' ^
Expand Down Expand Up @@ -150,7 +150,7 @@
<Output TaskParameter="GeneratedGuid" PropertyName="SdkPlaceholderInstallerUpgradeCode" />
</GenerateGuidFromName>

<Exec Command="powershell -NoProfile -NoLogo $(SdkPlaceholderGenerateMsiPowershellScript) ^
<Exec Command="powershell -NoProfile -NoLogo -ExecutionPolicy Bypass $(SdkPlaceholderGenerateMsiPowershellScript) ^
'$(SdkPlaceholderMSIInstallerFile)' ^
'$(WixRoot)' ^
'$(SdkBrandName)' ^
Expand Down Expand Up @@ -186,7 +186,7 @@
DependsOnTargets="GenerateInstallerLayout;AcquireWix;MsiTargetsSetupInputOutputs;SetupTemplatesMsis"
Inputs="@(TemplatesMsiComponent);$(TemplatesGenerateMsiPowershellScript)"
Outputs="%(TemplatesMsiComponent.MSIInstallerFile)">
<Exec Command="powershell -NoProfile -NoLogo $(TemplatesGenerateMsiPowershellScript) ^
<Exec Command="powershell -NoProfile -NoLogo -ExecutionPolicy Bypass $(TemplatesGenerateMsiPowershellScript) ^
'%(TemplatesMsiComponent.LayoutPath)' ^
'%(TemplatesMsiComponent.MSIInstallerFile)' ^
'$(WixRoot)' ^
Expand Down Expand Up @@ -322,7 +322,7 @@
<Output TaskParameter="GeneratedGuid" PropertyName="CombinedFrameworkSDKHostInstallerUpgradeCode" />
</GenerateGuidFromName>

<Exec Command="powershell -NoProfile -NoLogo $(SdkGenerateBundlePowershellScript) ^
<Exec Command="powershell -NoProfile -NoLogo -ExecutionPolicy Bypass $(SdkGenerateBundlePowershellScript) ^
-UpgradePoliciesWxsFile '$(UpgradePoliciesSrcPath)' ^
-WorkloadManifestWxsFile '$(WorkloadManifestsWxsPath)' ^
-CLISDKMSIFile '$(SdkMSIInstallerFile)' ^
Expand Down
6 changes: 6 additions & 0 deletions src/Tasks/sdk-tasks/sdk-tasks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,10 @@
<Using Include="Microsoft.Build.Utilities.Task" Alias="Task" />
</ItemGroup>

<!--
Encountered an error about this target being missing when rebuilding within VS.
See: https://github.com/dotnet/msbuild/issues/4303#issuecomment-482345617
-->
<Target Name="GetTargetPath" />

</Project>
3 changes: 2 additions & 1 deletion src/Workloads/Manifests/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@

<PropertyGroup>
<!-- NU5128: This package doesn't contain any lib or ref assemblies because it's a tooling package. -->
<NoWarn>$(NoWarn);NU5128</NoWarn>
<!-- NU5039: NuGet is unable to find the readme file in the package. -->
<NoWarn>$(NoWarn);NU5128;NU5039</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Project Sdk="Microsoft.Build.Traversal" DefaultTargets="Pack">

<ItemGroup>
<ProjectReference Include="**\*.Manifest.proj" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Workloads/VSInsertion/workloads.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

<ItemGroup>
<!-- In .NET product build mode in the second build pass, there's no need to build the manifests since they're already downloaded from another vertical -->
<ProjectReference Include="$(RepoRoot)\src\Workloads\Manifests\manifest-packages.proj" ReferenceOutputAssembly="false" Condition="'$(DotNetBuild)' != 'true'" />
<ProjectReference Include="$(RepoRoot)\src\Workloads\Manifests\manifest-packages.csproj" ReferenceOutputAssembly="false" Condition="'$(DotNetBuild)' != 'true'" />
</ItemGroup>

<ItemGroup Condition="'$(BuildWorkloads)' == 'true'">
Expand Down
6 changes: 3 additions & 3 deletions test/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

<PropertyGroup>
<ExcludeFromSourceOnlyBuild>true</ExcludeFromSourceOnlyBuild>
<NoWarn>$(NoWarn);NU5125</NoWarn>

<!-- Don't warn about long filenames in packages, we bundle test assets that have long paths
<!-- NU5125 The licenseUrl element is being replaced by the license element. -->
<!-- NU5123 Don't warn about long filenames in packages, we bundle test assets that have long paths
(ie HelloWorldWithSubDirs) -->
<NoWarn>$(NoWarn);NU5123</NoWarn>
<NoWarn>$(NoWarn);NU5125;NU5123</NoWarn>

<GenerateProgramFile>false</GenerateProgramFile>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

<ItemGroup>
<PackageReference Include="Moq" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="$(RepoRoot)src\Compatibility\ApiCompat\Microsoft.DotNet.PackageValidation\Microsoft.DotNet.PackageValidation.csproj" />
<ProjectReference Include="..\Microsoft.NET.TestFramework\Microsoft.NET.TestFramework.csproj" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" />
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just moved this into the ItemGroup that is for PackageReferences. Not sure why it was here to begin with.

</ItemGroup>

</Project>