Bug 3852 - Assembly.GetManifestResourceStream '.' escaping incompatibility
Summary: Assembly.GetManifestResourceStream '.' escaping incompatibility
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib (show other bugs)
Version: 2.10.x
Hardware: PC Windows
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-03-12 04:23 UTC by David Schmitt
Modified: 2012-04-23 11:54 UTC (History)
1 user (show)

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


Attachments

Description David Schmitt 2012-03-12 04:23:37 UTC
When embedding resources with dots in the directory name, MS.NET escapes those dots with an underscore. The directory "mono2.0" becomes "mono2._0" as resource name.

mono-2-10 doesn't do this escaping.
Comment 1 Mikayla Hutchinson [MSFT] 2012-03-13 18:14:55 UTC
Does this escaping take place in the compiler, MSBuild, the classlibs, or a mixture?

An easy way to check this would be to look at the build output on .NET and check the arguments with which MSBuild is invoking the compiler. Also, when loading the resources at runtime, do you access them with the escaped or unescaped name?
Comment 2 David Schmitt 2012-04-23 11:54:47 UTC
Here's the relevant MSBuild log line:

  C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe [...] /resource:EmbeddedLibs\Npgsql20119.3binmono20\Mono.Security.dll,PrepareEnv.EmbeddedLibs.Npgsql20119._3binmono20.Mono.Security.dll [...]

As you can see, the escaping is already done by the MSBuild task and only happens to the directory name. "Mono.Security" is passed through unharmed.<facepalm/>


Assembly.GetManifestResourceNames() returns the escaped names.

Note You need to log in before you can comment on or make changes to this bug.