Skip to content

Conversation

@mateoatr
Copy link
Contributor

@mateoatr mateoatr commented Aug 6, 2020

Related to dotnet/runtime#37208. Using a backslash as a directory separator for copied satellite assemblies is causing errors when generating bundles for single file apps, since it's completely valid to use \ in a filename. Changing this line seemed like the easiest way to solve this.

@mateoatr mateoatr requested a review from a team as a code owner August 6, 2020 18:42
@mateoatr mateoatr self-assigned this Aug 6, 2020
<!-- Copy satellite assemblies. -->
<ResolvedFileToPublish Include="@(IntermediateSatelliteAssembliesWithTargetPath)">
<RelativePath>%(IntermediateSatelliteAssembliesWithTargetPath.Culture)\%(Filename)%(Extension)</RelativePath>
<RelativePath>%(IntermediateSatelliteAssembliesWithTargetPath.Culture)/%(Filename)%(Extension)</RelativePath>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this work on windows? It seemed like the bundler was treating this as a string, causing \ to be part of a filename on unix, so I naiively would have expected this to just move the problem to windows.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK / is a reserved character in Windows and cannot be used for naming filenames/folders. This wouldn't be the only place where we use slashes for dir separators.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't any other custom Target use backslash, and then it would be broken as well?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wli3
Copy link

wli3 commented Aug 7, 2020

MSBuild can tolerate both slashes. Which component throw up on the bad slash?

@mateoatr
Copy link
Contributor Author

MSBuild can tolerate both slashes. Which component throw up on the bad slash?

Right. The problem is really in the Bundler, which isn't smart about relative paths that use a backslash and ends up embedding satellite assemblies (and any other files which are passed to it through the SDK and contain backslashes) as if these were files named a\b. This is probably better off being fixed in the runtime, I've opened a PR there. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants