msbuild
msbuild copied to clipboard
Solution is failed to be built if contains 3 or more dots in name
Create a solution with a name like Test...Dots(in my case it was netcoreapp3.1) and try to build, it fails with the following error:
Microsoft.Common.props(62, 3): [MSB4019] The imported project "/Users/user/Projects/test...dots/test...dots/obj/test...dots.csproj.*.props" was not found. Confirm that the expression in the Import declaration "/Users/user/Projects/test...dots/test...dots/obj/test...dots.csproj.*.props" is correct, and that the file exists on disk.
This seems to primarily be a problem if someone wants to rename a file to have 3+ dots when it didn't originally, since VS doesn't allow someone to make a new solution with three consecutive dots in its name, and although dotnet sln
does, it doesn't allow you to add projects to a sln with three dots.
When building, however, this should still work, and it doesn't. I believe the problem is here. Specifically, according to the comment, we used to use GetFileListEscaped, which would not only handle escaping properly but also expand globs. The new version (with EscapingUtilities.UnescapeAll
) handles escaping but does not expand globs, which causes the error lucipurrr reported.
Since it would be best to copy what VS does as far as what are acceptable names, I created an issue in the sdk as well here.
@Forgind what does glob expansion have to do with this error? I don't see a glob involved.
My recollection is that it tries to find (props?) files to add to the project, and it includes a *. When it got here, it tried to load a document that still had a * in its path and failed, throwing the above error.
Any update on this issue... ?