-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Error building when project has percent '%' char in the path #985
Comments
@rainersigwald and I looked over it and the exception is thrown here: https://github.com/Microsoft/msbuild/blob/master/src/XMakeBuildEngine/Construction/ProjectRootElement.cs#L1946 XmlTextReader seems to be lazy opening the file.
I guess we'll have to read the file ourselves and pass it into |
We also peeked into the internals of I don't think we'll have to read + pass a string--we should be able to pass a |
@rainersigwald hmmmm. The tricky thing is that path-wise could be very well that both unescaped and escaped paths correspond to two valid and different folders. In my example above: So I believe the trick is not to escape or unescape the Project folder, but keep it as it is. I ignore whether this is practic or even feasible. So I beg your pardon in case my suggestion is aberrant |
@cdmihai That's it Also happens with referenced dlls from packages "C:\Users\xxxxx\Repos\feature%2FTest\SolutionFolder\Solution.sln" (destino predeterminado) (1) -> Have changed the paths and solutions and projects and also it is in spanish. But fundamentally you see that when tring to look for imports or packages, looks for the unescaped path, with (in this particular case) is wrong |
Escaping the path wouldn't affect the I think the best thing to do here is to work around the |
If you have URL characters in your project path like C:\Project\Project%20\proj.csproj XMLTextReader.Read() method try to unescape these characters. In result the build is failed because it doesn't find the path. Workaround is to load xml from StreamReader instead of string. Fixes #985
Background: * Previous implementation on Full Framework used XmlTextReader(path). This contained an issue with certain characters (dotnet#985) and was fixed by using streams (dotnet#1004). dotnet#1004 also changed from XmlTextReader to XmlReader. * XmlReader contains logic to normalize line endings. Internally, it sets the Normalize property to true and replaces (some? all?) \r\n with \n. This change switches implementation to use XmlTextReader. This class sets the internal Normalize to false and does not replace \r\n with \n. This fixes dotnet#1340. However, .NET Core does not ship with XmlTextReader, only XmlReader. dotnet#1340 still exists for .NET Core.
Background: * Previous implementation on Full Framework used XmlTextReader(path). This contained an issue with certain characters (dotnet#985) and was fixed by using streams (dotnet#1004). dotnet#1004 also changed from XmlTextReader to XmlReader. * XmlReader contains logic to normalize line endings. Internally, it sets the Normalize property to true and replaces (some? all?) \r\n with \n. This change switches implementation to use XmlTextReader. This class sets the internal Normalize to false and does not replace \r\n with \n. This fixes dotnet#1340. However, .NET Core does not ship with XmlTextReader, only XmlReader. dotnet#1340 still exists for .NET Core.
Background: * Previous implementation on Full Framework used XmlTextReader(path). This contained an issue with certain characters (dotnet#985) and was fixed by using streams (dotnet#1004). dotnet#1004 also changed from XmlTextReader to XmlReader. * XmlReader contains logic to normalize line endings. Internally, it sets the Normalize property to true and replaces (some? all?) \r\n with \n. This change switches implementation to use XmlTextReader. This class sets the internal Normalize to false and does not replace \r\n with \n. This fixes dotnet#1340. However, .NET Core does not ship with XmlTextReader, only XmlReader. dotnet#1340 still exists for .NET Core.
Background: * Previous implementation on Full Framework used XmlTextReader(path). This contained an issue with certain characters (#985) and was fixed by using streams (#1004). #1004 also changed from XmlTextReader to XmlReader. * XmlReader contains logic to normalize line endings. Internally, it sets the Normalize property to true and replaces (some? all?) \r\n with \n. This change switches implementation to use XmlTextReader. This class sets the internal Normalize to false and does not replace \r\n with \n. This fixes #1340. However, .NET Core does not ship with XmlTextReader, only XmlReader. #1340 still exists for .NET Core.
We work with mercurial and hgflow
When a feature branch is created in hgflow, by default the branch will be named like 'feature/[FEATURENAME]'
When Jenkins wants to build that branch, creates a folder with the branch name. But it escapes the slash, resulting in something like 'feature%2F[FEATURENAME]'
Then when Jenkins launches MSBuild, the build will fail because it unescapes paths, and tries to find everything inside 'feature/[FEATURENAME]'. But that folder does not exist.
Why does MSBuild try to Unescape the path always?
The text was updated successfully, but these errors were encountered: