Bug 14847 - Escaped characters in paths not unescaped when CopyToOutputDirectory
Summary: Escaped characters in paths not unescaped when CopyToOutputDirectory
Alias: None
Product: Tools
Classification: Mono
Component: xbuild ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
: 14883 ()
Depends on:
Reported: 2013-09-19 06:44 UTC by Ole Laursen
Modified: 2014-02-09 13:39 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Ole Laursen 2013-09-19 06:44:15 UTC
The following .csproj XML snippet from Visual Studio fails, despite the referenced file existing, apparently because %28 and %29 is not unescaped to ( and ) in the actual copy operation:

    <None Include="..\..\src\dk.gov.oiosi.resource\Resources\Certificates\Test\Funktionscertifikat\CVR30808460.Expire20151025.TU GENEREL FOCES2 %28Spærret%29 %28Funktionscertifikat%29.pfx">
      <Link>Resources\Certificates\CVR30808460.Expire20151025.TU GENEREL FOCES2 %28Spærret%29 %28Funktionscertifikat%29.pfx</Link>


/home/olau/nemhandel/svn-oiosi/test/dk.gov.oiosi.test.unit/dk.gov.oiosi.test.unit.csproj (default targets) ->
/usr/lib/mono/3.5/Microsoft.Common.targets (_CopyDeployFilesToOutputDirectoryPreserveNewest target) ->

	/usr/lib/mono/3.5/Microsoft.Common.targets: error : Cannot copy /home/olau/nemhandel/svn-oiosi/src/dk.gov.oiosi.resource/Resources/Certificates/Test/Funktionscertifikat/CVR30808460.Expire20111105.TU GENEREL FOCES2 %28Udløbet%29 %28Funktionscertifikat%29.pfx to /home/olau/nemhandel/svn-oiosi/test/dk.gov.oiosi.test.unit/bin/Debug/Resources/Certificates/CVR30808460.Expire20111105.TU GENEREL FOCES2 (Udløbet) (Funktionscertifikat).pfx, as the source file doesn't exist.

Curiously, unescaping them manually and saving the .csproj doesn't help - it looks like xbuild automatically escapes them again, but then forgets to unescape them before copying.

(The "æ" is not a problem, I have the same error with pure-ASCII paths.)
Comment 1 Antonius Riha 2014-02-09 04:36:08 UTC
This may be a duplicate of https://bugzilla.xamarin.com/show_bug.cgi?id=14883
Comment 2 Mikayla Hutchinson [MSFT] 2014-02-09 13:37:45 UTC
*** Bug 14883 has been marked as a duplicate of this bug. ***
Comment 3 Mikayla Hutchinson [MSFT] 2014-02-09 13:39:08 UTC
Should be fixed by https://github.com/mono/mono/commit/a8392fb5e8517cb92d449e6b0b2b9d8e4c12cd67