Embedded resources in ASP.NET 5 project

If we want to add embedded resources to ASP.NET 5 project like files, pictures etc... so that they become part of the assembly we cannot do that in standard way like we did it in older ASP.NET project versions. In the older versions of ASP.NET we embed resource that we set Build Action property from Content to Embedded Resource.

In ASP.NET 5 there is no Build Action property and we cannot set it to Embedded resource.

Solution: in ASP.NET 5 project we create Embedded folder and in project.json we set resource property to embed every file in Embedded folder in assembly:

"resource": [

Now we can use/access embedded resource file with the following code

var assembly = Assembly.GetExecutingAssembly();

Stream stream = assembly.GetManifestResourceStream("MyNamespace.EmbeddedFileName.csv"))

Embedded resource: embeds the file in an exclusive assembly manifest resource.