question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SDK changes name of EmbeddedResource elements

See original GitHub issue

One of the projects I’ve converted to the new SDK has a number of EmbeddedResource elements.

<EmbeddedResource Include="Analyzers\FaultyAnalyzer.dll" />

When compiled as a PCL the name of the resource in the assembly would be “Analyzers.FaultyAnalyzer.dll”. After converting to the new SDK the name instead is “CompilerTestResources.Analyzers.FaultyAnalyzer.dll”.

It seems the name is getting prepending with the string $(MSBuildThisFileName). That’s breaking a number of our suites which can’t find resources anymore.

Is this a known issue? If so is there a work around we can use?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
jaredparcommented, May 4, 2017

There is not (and, IMHO, should not be) a design goal that you can just import the SDK, make no other project changes and get exactly the same behavior.

I agree.

Still, I think there are better ways to address migration pain than to reverse course on the defaults:

The SDK could also document the breaks in behavior. Knowing this was a break is better than spending a few hours to discover it’s a break.

0reactions
livarcocccommented, Jan 24, 2018

From reading the thread, it seems like there is nothing that we can/should be doing here. Besides maybe adding some documentation.

Given that, I am going to go ahead and close this issue.

As for the documentation, maybe we should file an issue under microsoft/docs, if there isn’t one already, to document these breaking changes as a whole and not just this one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to change the generated ManifestResourceName for ...
In the .csproj file, the Embedded Resources are defined as <EmbeddedResource> items. These have metadata named <LogicalName> which allows ...
Read more >
NET project SDK overview
The .NET SDK includes 'EmbeddedResource' items from your project directory by default. You can either remove these items from your project file, ...
Read more >
How resource manifest files are named
Describes the factors that influence the name of a resource manifest file name that's generated by MSBuild at compile time.
Read more >
How to Logically Name Embedded Resources in .csproj?
In this post we are sharing a nice tip to logically name embedded resources in a Visual studio C# project.
Read more >
ASP.NET Core (.csproj) Embedded Resources
I've previously blogged about how to have embedded resources in ASP.NET Core, however that was with the older project.json. I figured I would...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found