msbuild icon indicating copy to clipboard operation
msbuild copied to clipboard

Solution is failed to be built if contains 3 or more dots in name

Open lucipurrr opened this issue 4 years ago • 4 comments

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.

lucipurrr avatar Feb 18 '20 12:02 lucipurrr

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 avatar Feb 21 '20 23:02 Forgind

@Forgind what does glob expansion have to do with this error? I don't see a glob involved.

rainersigwald avatar Feb 22 '20 21:02 rainersigwald

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.

Forgind avatar Feb 24 '20 17:02 Forgind

Any update on this issue... ?

snhg avatar Jun 24 '22 10:06 snhg