How do I include contract assemblies in the nupkg automatically?

空扰寡人 提交于 2019-12-19 09:46:20

问题


I just started using nuget to create some packages for an internal library in our company. This library is comprised of many assemblies, and a lot of them have contract reference assemblies generated from Code Contracts.

I'm using the most straightforward nuget pack approach, which is to pass in the csproj file paths and let it resolve all dependencies between projects. The problem is that it does not include the contract assemblies in the lib folder.

Is there a way to make it also get the contract assemblies and correctly only reference the actual dlls in the projects when the package is installed? I figure this should be automated in some way, since nuget could inspect the project file and know that it generates contract assemblies.

If this required explicit file references it would massively complicate our current process, since I'd have to rearrange files and folders to match the location of the .nuspec files, which I'd love to avoid.

EDIT:

I just found another question which deals with code contracts and nuget packages, but it does not answer my question directly. I figured I'd add the link here though since they deal with almost the same things.

来源:https://stackoverflow.com/questions/28192428/how-do-i-include-contract-assemblies-in-the-nupkg-automatically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!