0

I'm trying to migrate from an old style csproj file where I have this in the file

  <ItemGroup>
    <Resource Include="Resources\CustomerLogo.png" />
  </ItemGroup>

and when I, in my code, calls:

var resourceManager = new ResourceManager(assembly.GetName().Name + ".g", assembly);
var culture = System.Threading.Thread.CurrentThread.CurrentCulture;
var resourceSet = resourceManager.GetResourceSet(culture, true, true);

I can find the file in the resourceSet with Resources\CustomerLogo.png as key and a stream as value.

I have now tried converting the csproj file, and it still includes the ItemGroup, but now it does not appear in the resourceSet.

Any that can help me?

Yours /peter

2
  • Have you tried creating a test project in the new SDK format on the side, manually adding the resource and to it and then looking the .csproj file to see what changed? When I was converting old projects a couple of years ago, I found that manually rebuilding a new one from scratch using the IDE (with the old one alongside it for reference) worked much better Commented Oct 2, 2022 at 15:57
  • The following was done .net5 post Commented Oct 2, 2022 at 21:04

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.