I have a library that contains some classes, which I need in several Unit Test projects. The library should be deployed as a NuGet package in my private repository. I already deployed some NuGet packages there, so I know what I have to do.
BUT: Inside of this library I need a reference to xUnit. And as soon as I add this reference, there is no more.nupkg file created when execute do.net pack
.
Another interesting effect is, that the project icon turns into a Unit Test icon as soon as I add xUnit:
Steps to reproduce:
Create a Class Library
Add a reference to the xUnit NuGet package
Right click the project and click on pack
Expected Behvior: there should be a.nupkg file in./bin/Debug
Actual Behevior: there is no such file.
According to https://github.com/do.net/cli/issues/7539 , some projects seem to be "not packable" by default. You have to enable this manually by adding the following lines to your.csproj file:
<PropertyGroup>
<IsPackable>true</IsPackable>
</PropertyGroup>
After that, the.nupkg file is created expected.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.