-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Conversation
… NoWarn for NU5039. Added -ExecutionPolicy Bypass for calls to PowerShell. Added blank GetTargetPath to sdk-tasks.csproj. Other minor cleanup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Addresses several build and tooling issues when performing a full rebuild in Visual Studio by renaming project files for VS compatibility, suppressing new NuGet warnings, ensuring PowerShell scripts run under restrictive execution policies, and adding a helper script for runtime copying.
- Rename
manifest-packages.proj→manifest-packages.csprojand update all references. - Suppress additional NuGet warnings (
NU5039) and add-ExecutionPolicy Bypassto MSI-generation scripts. - Introduce an empty
GetTargetPathMSBuild target and add a newcopy-runtime.ps1script to copy built runtimes into Program Files.
Reviewed Changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/Microsoft.DotNet.PackageValidation.Tests/*.csproj | Added Microsoft.CodeAnalysis.CSharp package reference |
| test/Directory.Build.props | Combined and clarified NoWarn entries for NU5125/NU5123 |
| src/Workloads/VSInsertion/workloads.csproj | Updated <ProjectReference> to point at .csproj file |
| src/Workloads/Manifests/Directory.Build.props | Added NU5039 to NoWarn |
| src/Tasks/sdk-tasks/sdk-tasks.csproj | Added stub <Target Name="GetTargetPath" /> |
| src/Layout/redist/targets/GenerateMSIs.targets | Added -ExecutionPolicy Bypass to PowerShell <Exec> commands |
| src/Layout/redist/targets/BundledManifests.targets | Updated MSBuild project path to .csproj |
| src/Layout/redist/redist.csproj | Updated <ProjectReference> to .csproj |
| sdk.slnx | Updated solution entry for manifest-packages.csproj |
| eng/copy-runtime.ps1 | New admin-run PowerShell script to copy built runtime into Program Files |
| Directory.Build.props | Added NU5039 to root NoWarn |
| .vsconfig | New Visual Studio configuration file |
| </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" /> |
There was a problem hiding this comment.
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.
|
manifest-packages shouldn't be a csproj as it doesn't invoke the compiler. We have many proj files in our repos so that should work. Otherwise this is a VS / project-system bug. |
That's not how it works with solutions in Visual Studio. You can't have I know don't of the specifics beyond that, but it has always been that way. My general rule-of-thumb has always been; if the project needs to be in a solution, I use a |
Builds on: #49746
Summary
After trying to do "Rebuild All" within VS for the repo, I ran into a bunch of problems. This should address some of them.
Changes
manifest-packages.projtomanifest-packages.csprojfor VS compatibilityNU5039to NoWarn since we get this warning for all the packages we make-ExecutionPolicy Bypasssince you cannot build the redist project if your PowerShell is set to Restricted ExecutionPolicy (default on new Windows installs)GetTargetPathtarget to sdk-tasks.csproj as it was complaining about it when trying to rebuildAdded script to copy the downloaded runtime into Program FilesI was unable to run tests within VS. I was told that the runtime needed to be in Program Files, so I added a script that needs to be ran as Administrator to copy this over.The cause of this issue was this commit from this PR.sdk-build-envscript: SdkResolver may need to set DOTNET_ROOT in order for framework-dependent processes inside an IDE to run correctly #49825