Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Do I Add an Embedded Resource to a "Class Library (Package)" Project in VS 2015 RC?

There is a new project template in the Visual Studio 2015 release candidate called "Class Library (Package)." It's in the Visual C#/Web category. In the information panel of the project type, it says "PREVIEW - A project template for creating a class library as a NuGet package that can target any platform."

I'm doing something similar that I did in a normal Class Library project and involves an embedded resource. Normally, there's an option in the Properties dialog that allows you to specify a "Build Action." You can then select "Embedded Resource." That option does not appear in the Properties dialog for a file in a "Class Library (Project)" project.

Does anybody know how to add an embedded resource to a "Class Library (Package)" project in VS 2015 RC? Is it even possible?

like image 903
vbullinger Avatar asked May 13 '15 19:05

vbullinger


Video Answer


1 Answers

There is the default magic /compiler/resources that you can use to drop files in and they will be embedded automatically. I have an example @ https://github.com/Blacklite/Features/tree/master/src/Blacklite.Framework.Features.Http ( Note as of this post, it was not updated to beta4, but the functionality hasn't changed to my knowledge )

Also as per the schema, you can point at a specific folder using the "resources" key in your project.json. See: http://json.schemastore.org/project

like image 82
David Driscoll Avatar answered Oct 21 '22 10:10

David Driscoll