创建一个Nuget包VS 2015

时间:2022-09-01 18:28:09

I want to create a Nuget Package from an exiting VS 2015 ASP NET 5 Project. Its not an empty project, I have my own folder structure and dependencies in this project. What I need here is when any developer installs this package the package should create necessary folders and files in the target project.

我想从现有的VS 2015 ASP NET 5项目中创建一个Nuget包。它不是一个空项目,我在这个项目中有自己的文件夹结构和依赖项。我需要的是,当任何开发人员安装此软件包时,软件包应在目标项目中创建必要的文件夹和文件。

I want this basically to have a standard project structure which can be used by developers which will have the boilerplate code.

我希望这基本上有一个标准的项目结构,可以由具有样板代码的开发人员使用。

I tried using Nuget Package Explorer, but when I install it on a web application it does not create any folders that I have in the package. Here is a snapshot of the Nuget Package explorer

我尝试使用Nuget Package Explorer,但是当我在Web应用程序上安装它时,它不会创建我在包中的任何文件夹。这是Nuget Package资源管理器的快照

创建一个Nuget包VS 2015

I also tried dnu pack command, but not sure what else I need to have in project.json to make all the folders and files part of the package.

我也尝试过dnu pack命令,但不确定我还需要在project.json中使用什么来使所有文件夹和文件成为包的一部分。

Is Nuget package the correct way to go, or should it be a VS 2015 Project template?

Nuget包装是正确的方法,还是应该是VS 2015项目模板?

Really appreciate if anyone could give me some pointers on how to achieve this.

真的很感激,如果有人能给我一些关于如何实现这一目标的指示。

1 个解决方案

#1


1  

Nuget transforms don't look to be supported in ASP.NET 5 as yet. Here's the intended future spec.

到目前为止,还没有在ASP.NET 5中支持Nuget转换。这是预期的未来规范。

For now, creating a Project Template, instructions here, looks the way to go.

目前,创建一个项目模板,这里的说明,看起来要走的路。

#1


1  

Nuget transforms don't look to be supported in ASP.NET 5 as yet. Here's the intended future spec.

到目前为止,还没有在ASP.NET 5中支持Nuget转换。这是预期的未来规范。

For now, creating a Project Template, instructions here, looks the way to go.

目前,创建一个项目模板,这里的说明,看起来要走的路。