Skip to content
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

Checking for VS pathing when import not found #9625

Merged
merged 10 commits into from
Feb 14, 2024
Merged

Conversation

maridematte
Copy link
Contributor

Fixes #8967

Context

Users sometimes use different distributions to build projects, however some files available in the VS distribution are not available with dotnet build. It used to throw a "File not found" error, but now it is switched to "this imported project is in a VS distribution".

An example message is: error MSB4278: The imported project $(MSBuildE xtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\DSLTools\Microsoft.DslTools.settings.targets is from the Visual Studio distribution of MSBuild. Build with MSBuild.exe in a Developer Command Prompt.

Changes Made

Before throwing a invalidProject error for file not found, check the path of the file if it is within Visual Studio. If it is, throw new error instead.

Copy link
Member

@rainersigwald rainersigwald left a comment

Choose a reason for hiding this comment

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

Add a test please :)

src/Build/Evaluation/Evaluator.cs Outdated Show resolved Hide resolved
@maridematte maridematte marked this pull request as ready for review January 18, 2024 14:25
src/Build/Evaluation/Evaluator.cs Show resolved Hide resolved
src/Build.UnitTests/Evaluation/Evaluator_Tests.cs Outdated Show resolved Hide resolved
src/Build/Evaluation/Evaluator.cs Outdated Show resolved Hide resolved
src/Build/Resources/Strings.resx Outdated Show resolved Hide resolved
Copy link
Member

@rainersigwald rainersigwald left a comment

Choose a reason for hiding this comment

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

Please don't consider the test nits blocking, but I couldn't avoid picking at them.

src/Build/Resources/Strings.resx Outdated Show resolved Hide resolved
src/Build.UnitTests/Evaluation/Evaluator_Tests.cs Outdated Show resolved Hide resolved
src/Build.UnitTests/Evaluation/Evaluator_Tests.cs Outdated Show resolved Hide resolved
src/Build.UnitTests/Evaluation/Evaluator_Tests.cs Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants