<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="MyCsFile.xml" />
</ItemGroup>
</Project>
// in file MyCsFile.cs
namespace NetConsoleApp1
{
public class FirstClassInTheCsFile
{
}
}
// Program.cs
using System;
namespace NetConsoleApp1
{
internal class Program
{
private static void Main(string[] args)
{
Console.WriteLine(typeof(FirstClassInTheCsFile).Assembly.GetManifestResourceNames()[0]);
}
}
}
Output:
NetConsoleApp1.FirstClassInTheCsFile
Expected:
NetConsoleApp1.MyCsFile.xml
Observed: after cs file or xml file name has been changed just starting the app in debug mode does not build the change into the binaries. Rebuild does.
@JasonCard, could you please help redirect?
Hi @jamshedd, I work on .NET content localization, so I think you may have pinged the wrong person?
cc @rainersigwald @nguerrera
This is a known issue with resources in the 3.0 SDK
See https://github.com/microsoft/msbuild/issues/4740
The known issue document describes this at https://github.com/dotnet/core/blob/master/release-notes/3.0/3.0-known-issues.md#preview-9.
You basically need to set
<PropertyGroup>
<EmbeddedResourceUseDependentUponConvention>false</EmbeddedResourceUseDependentUponConvention>
</PropertyGroup>
in the project file
Duplicate of microsoft/msbuild#4740
Most helpful comment
See https://github.com/microsoft/msbuild/issues/4740
The known issue document describes this at https://github.com/dotnet/core/blob/master/release-notes/3.0/3.0-known-issues.md#preview-9.
You basically need to set
in the project file