nuget-spec

declaring nuget packages that depend on each other in one solution

ぃ、小莉子 提交于 2019-12-20 18:15:02
问题 We have solution with a lot of projects and a more or less complex dependency graph between those projects. Now each of those projects should become its own nuget package and the dependency graph of the nuget packages should mirror the on of the projects. I have two questions: Is it possible to achieve this while keeping all projects within the same solution? If so how? Is advisable to keep all projects in the same solution? What would be the a common / "best practice" approach to this? 回答1:

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

Unable to pack a NuGet package using dotnet CLI and nuspec file

谁都会走 提交于 2019-12-10 11:19:14
问题 I have several projects that I'm migrating from .NET Framework 4.7 to .NET Standard 2.0. As a result, I'm trying to use the dotnet pack command to create my NuGet package while using my nuspec file with tokens. I have several custom build scripts that generate the version number for me. My generated files are not apart of version control but nuspec file is hence why I'd like to try and find a way to get the tokens to work, otherwise I'm stuck writing new scripts. The first thing I did was to

Unable to pack a NuGet package using dotnet CLI and nuspec file

好久不见. 提交于 2019-12-06 05:53:25
I have several projects that I'm migrating from .NET Framework 4.7 to .NET Standard 2.0. As a result, I'm trying to use the dotnet pack command to create my NuGet package while using my nuspec file with tokens. I have several custom build scripts that generate the version number for me. My generated files are not apart of version control but nuspec file is hence why I'd like to try and find a way to get the tokens to work, otherwise I'm stuck writing new scripts. The first thing I did was to set the GenerateAssemblyInfo to false in the project files. In my most simplest project, the csproj

Nuget pack does not honor number of digits on assembly version

半城伤御伤魂 提交于 2019-12-05 07:06:42
I need nuget pack to generate a package version with only 3 digits (we want to do semantic versioning on it) but when I call it on a csproj which has an AssemblyVersion attribute set to "1.0.0", the resulting nupkg file ends with version "1.0.0.0" in it's metadata (and file name). Why doesn't the command line tool honor the amount of digits specified on the AssemblyVersion attribute? I started this with a call to nuget spec against the csproj file, which generates a stub nuspec file like this (it actually includes more tags with placeholder values, but I've deleted them since we don't need

declaring nuget packages that depend on each other in one solution

自闭症网瘾萝莉.ら 提交于 2019-12-03 05:42:24
We have solution with a lot of projects and a more or less complex dependency graph between those projects. Now each of those projects should become its own nuget package and the dependency graph of the nuget packages should mirror the on of the projects. I have two questions: Is it possible to achieve this while keeping all projects within the same solution? If so how? Is advisable to keep all projects in the same solution? What would be the a common / "best practice" approach to this? The situation in our project is the same and we took the following approach: The first step is to create the

Is there a way to tell nuGet to install a file, into a project, only if the file is not already in the project?

你离开我真会死。 提交于 2019-12-01 21:17:06
问题 Is there a way to configure a nuGet package so that a file is installed, inside a project, only if it does not already exist in the project? Specifically, my nuGet package contains a custom config file. Once installed, the user will make modifications to the file. The problem is that the config file gets replaced when the user installs a new version of my nuGet package -- thus, losing their changes. I want to prevent this. 回答1: Let's assume that you are using Visual Studio and need to deploy

Setting file properties with NuGet using .targets file

[亡魂溺海] 提交于 2019-12-01 09:03:26
I am building a project to be installed as a NuGet package and I want to set the properties of a SpecFlow feature file (because it is latest SpecFlow and should not produce code-behind files for the features.) To achieve the effect of selecting a file, opening it's Properties pane and setting a couple of values, I have set my project structure like this: \MyProject \build MyProject.targets \Framework <the folder containing the file I want to affect> FrameworkTests.feature <the file I want to affect> \Framework FrameworkTests.feature <the original location of the file I want to affect> My

Setting file properties with NuGet using .targets file

匆匆过客 提交于 2019-12-01 07:54:06
问题 I am building a project to be installed as a NuGet package and I want to set the properties of a SpecFlow feature file (because it is latest SpecFlow and should not produce code-behind files for the features.) To achieve the effect of selecting a file, opening it's Properties pane and setting a couple of values, I have set my project structure like this: \MyProject \build MyProject.targets \Framework <the folder containing the file I want to affect> FrameworkTests.feature <the file I want to

How to add a folder to a nuspec file

吃可爱长大的小学妹 提交于 2019-11-29 01:07:23
So I'm actually trying to package up a web site project (not web application so no csproj file) into a NuGet package ready for Octopus to consume but am running into one brick wall after another.. I looked into using OctoPack but it doesn't support web site projects only web application projects. I am now trying to find a way of adding a folder (in my case a web site) into a Nuget package but Nuget doesn't allow this via the command line does it? It also requires a .csproj file! I've also tried trying to create the NuGet spec files and pass it in a folder but not possible? For the moment I may