最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

.net - Is there an easy way to include non-assembly files (.targets, .txt, .js, etc) in Nuget packages, and copy them to a speci

programmeradmin4浏览0评论

I have a file of MSBuild targets, an associated .props template, and a DLL with some custom tasks, which I use to package up .NET Framework projects into modules for installation into a third-party framework, which all live in one /build directory and get included through two lines in the project file. It all works, and it's slick, but it's a pain in the @ss to keep it up to date across old projects.

What I'd like: A Nuget package that on install will copy all the files into a /build directory (including the dll, to keep it separate from the products in the /bin directory), and add the necessary lines to the project file to import the .target file.

I've Googled this extensively and can only come up with partial answers. I've been able to get the .targets and .props files included in the project, although only as links, not as copies -- for the .targets this is fine but the .props needs to be modified for each project. I've had no success inserting the necessary lines into the project file, nor in getting a {projectName}.nuget.g.targets file to actually reference them.

I cannot find an example on Nuget of a package that installs files other than assemblies -- like documentation, or associated JS files. I have some experience building straightforward Nuget packages, but this is a bit of a leap for me.

Is this possible with Nuget? Is it possible without jumping through a lot of hoops?

If it won't work I'd rather just quit while I'm ahead! Since it's just for me, I have other options, I just like the idea of using Nuget since it's a familiar one.

Thanks!

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论