Open jeremymeng opened 8 years ago
Have you tried running program using dotnet <path-to-your-program>.dll
instead of dotnet run
?
(Where the path is probably something like bin\Debug\netcoreapp1.0\
.)
And how exactly do you figure out whether it prints \r
or not?
Have you tried running program using dotnet
.dll instead of dotnet run?
Same result.
And how exactly do you figure out whether it prints \r or not?
I just print "\\r"
if the character is \r
. Anyway, the project is just a simplified repro. What I really had was failing unit tests that expect "\r\n", as on Desktop, but end up without "\r" in the retrieved string. Under debugger on .NET Core, the result from ResourceManager.GetString(...)
does not contain "\r"
(https://github.com/jeremymeng/resource-test/blob/master/src/Console-Desktop/Resource1.Designer.cs#L71).
@jeremymeng if you've already found that ResourceManager.GetString() does not contain the '\r' then can we move this bug over to https://github.com/dotnet/corefx?
@piotrpMSFT we haven't ruled out the possibility of the difference in embedding resource strings. ILDasm shows the length of the embedded resource is exactly two less in the netcoreapp1.0 dll.
.mresource public Console_Desktop.Resource1.resources
{
// Offset: 0x00000000 Length: 0x000000E3
}
In the desktop executable, the length is 0xE5.
Steps to reproduce
Simplified repro: https://github.com/jeremymeng/resource-test.git
I have a resource file that is shared by a desktop project and a netcoreapp1.0 project. In the resource file there's a resource string that spans multiple lines. The projects simply print out the resource string.
Expected behavior
Both projects print out
Actual behavior
netcoreapp1.0 project prints out
1\n2\n3
, with'\r'
removed.Environment data
dotnet --info
output:.NET Command Line Tools (1.0.0-rc2-002617)
Product Information: Version: 1.0.0-rc2-002617 Commit Sha: db89bd35fc
Runtime Environment: OS Name: Windows OS Version: 10.0.10586 OS Platform: Windows RID: win10-x64