dotnet / dotnet/msbuild

Incorrect error about Import Project even when Condition evaluates to false

Open
#1,961 0 comments 0 reactions 0 assignees View on GitHub
bug triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

Consider this test project:
```



```
If you build it it will fail with:
```
D:\1.proj(2,11): error MSB4226: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MS
Build\foo" was not found. Also, tried to find "foo" in the fallback search path(s) for $(MSBuildExtensionsPath32) - "C:
\Program Files (x86)\MSBuild" . These search paths are defined in "C:\Program Files (x86)\Microsoft Visual Studio\2017\
Enterprise\MSBuild\15.0\Bin\MSBuild.exe.Config". Confirm that the path in the declaration is correct, and that
the file exists on disk in one of the search paths.
```
The resource string in question is: `ImportedProjectFromExtensionsPathNotFoundFromAppConfig`. The position in code is: http://source.dot.net/#Microsoft.Build/Evaluation/Evaluator.cs,2747

I think it should build successfully since the condition is false (the path in the condition exists). However it fails regardless whether you specify Exists or !Exists in the condition.

This is in MSBuild that ships with VS 2017, it may have been fixed since, I didn't check.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.