Home Dashboard Directory Help

MSBuild regression, 'decodes' filenames when copying by leppie


 as Fixed Help for as Fixed

Sign in
to vote
Type: Bug
ID: 551765
Opened: 4/16/2010 4:08:54 AM
Access Restriction: Public
User(s) can reproduce this bug



My project works 100% in VS2008.

But now testing on VS2010, MSBuild reports the following:

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3159,9): error MSB3021: Unable to copy file "C:\DevProjects\IronScheme\IronScheme\IronScheme.Console\srfi\2\and-let%2a.sls" to "bin\Release\srfi\2\and-let*.sls". Illegal characters in path.
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3471,9): error MSB3541: Files has invalid value "bin\Release\srfi\2\and-let*.sls". Illegal characters in path.

As you can see, it 'decodes' the filename, and hence ends up with an invalid filename. The filename is encoded in the first place, so it does not have an invalid file character.

MSBuild should not be changing filenames (decoding or encoding).
Sign in to post a comment.
Posted by leppie on 3/26/2012 at 6:30 AM
Verified to be fixed in VS11 Beta.

Posted by leppie on 5/18/2011 at 11:19 AM
Can you please indicate the version of Visual Studio/.NET that will have this bug fix applied?

Or can you perhaps provide a hotfix?
Posted by leppie on 12/9/2010 at 11:43 PM
I just installed the .NET 4.0 update, and the bug is still present in MSBuild.

When are you planning on incorporating it?

I cannot start using .NET 4/VS2010 till this is fixed.
Posted by Microsoft on 5/25/2010 at 12:36 PM
I've investigated the bug and determined that the problem was in the AssignTargetPath task itself. This task was incorrectly causing the value placed in the TargetPath metadata to be escaped one time more than necessary. The bug is now fixed in our code base.

There is no workaround for this right now other than to rename the file to not use a %, which is what triggers MSBuild to perform escaping.
Posted by Microsoft on 4/19/2010 at 3:54 AM
Thank you for reporting this issue.
We are routing this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Sign in to post a workaround.
Posted by Eric Swanson-ericis.com on 12/2/2011 at 12:00 PM
Exclude the content file from the project and then use a post-build event to copy the file to the target directory (e.g. bin\Debug).