我如何添加嵌入的资源到"类库(包)"项目2015年VS RC? [英] How Do I Add an Embedded Resource to a "Class Library (Package)" Project in VS 2015 RC?

查看:424
本文介绍了我如何添加嵌入的资源到"类库(包)"项目2015年VS RC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个名为在Visual Studio 2015发布候选新项目模板类库(包)。这是在Visual C#/ Web分类。在项目类型的信息面板,它说:PREVIEW - 创建一个类库作为的NuGet包,可以针对任何平台的项目模板

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.

有谁知道如何嵌入的资源添加到类库(包),在2015年VS RC项目?它甚至有可能?

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

推荐答案

有是默认的魔力 /编译器/资源,您可以使用到放文件,他们将被自动嵌入。我有一个例子@ https://github.com/ Blacklite /功能/树/主/ src目录/ Blacklite.Framework.Features.Http (注意,因为这帖子,它没有更新到BETA4,但功能并没有改变我的知识)

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 )

另外,作为每个架构,您可以使用资源键,在你的 project.json 特定文件夹点。
请参阅: http://json.schemastore.org/project

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

这篇关于我如何添加嵌入的资源到"类库(包)"项目2015年VS RC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆