nuget

How to ship the stylecop.json and custom.ruleset files with a NuGet package in VS2017

末鹿安然 提交于 2021-02-08 05:22:23
问题 At the moment we are switching from VS2015 to VS2017. One of our upgrade steps is to switch from stylecop to the new Stylecop.Analyzer package. The new Stylecop is using 2 files. The stylecop.json and the Stylecop.ruleset. The target: I want to provide the stylecop files as a custom nuget package. But I dont know how to create the needed .csproj entries. <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> ... <CodeAnalysisRuleSet>packages\My.StyleCop.1.0.0-pre15\RuleSet\My.StyleCop.ruleset<

Deploy project with xUnit reference as NuGet package

久未见 提交于 2021-02-07 17:29:50
问题 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 dotnet pack . Another interesting effect is, that the project icon turns into a Unit Test icon as soon as I add

Deploy project with xUnit reference as NuGet package

风格不统一 提交于 2021-02-07 17:29:41
问题 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 dotnet pack . Another interesting effect is, that the project icon turns into a Unit Test icon as soon as I add

Visual Studio - Nuget - Unable to load the service index for source

混江龙づ霸主 提交于 2021-02-07 14:05:38
问题 This is my NuGet.config : <?xml version="1.0" encoding="utf-8"?> <configuration> <packageSources> <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" /> </packageSources> <disabledPackageSources> <add key="Microsoft and .NET" value="true" /> </disabledPackageSources> </configuration> Now, in Visual Studio, when I try to install 'geckofx45' package, I get the following error : install-package geckofx45 install-package : Unable to load the service index for

Regex to parse package name and version number from nuget package filenames

浪尽此生 提交于 2021-02-07 13:41:02
问题 I have a directory of nuget packages that I've downloaded from nuget.org. I'm trying to create a regex that will parse out the package name and version number from the filename. It doesn't seem difficult at first glance; the filenames have a clear pattern: {PackageName}.{VersionNumber}.nupkg Edge cases make it challenging though. Package names can have dashes, underscores, and numbers Package names can have effectively unlimited parts separated by dots Version numbers consist of 3-4 groups of

Regex to parse package name and version number from nuget package filenames

陌路散爱 提交于 2021-02-07 13:39:45
问题 I have a directory of nuget packages that I've downloaded from nuget.org. I'm trying to create a regex that will parse out the package name and version number from the filename. It doesn't seem difficult at first glance; the filenames have a clear pattern: {PackageName}.{VersionNumber}.nupkg Edge cases make it challenging though. Package names can have dashes, underscores, and numbers Package names can have effectively unlimited parts separated by dots Version numbers consist of 3-4 groups of

Have a NuGet package output a file

不想你离开。 提交于 2021-02-07 10:36:33
问题 I have a Visual Studio project that I have made into a NuGet package. The project has a file in it (called SwaggerIndex.html ). I have set that file to have the "Copy to Output Directory" property to "Copy if newer". (I need this file to copy to the build folder on build.) In that solution it works just fine. (I created another project to test it, and when it references my project that has the SwaggerIndex.html , it outputs it to the build folder just fine.) However, when I package it into a

Private NuGet Feed - Remembering Password

无人久伴 提交于 2021-02-07 08:28:46
问题 Whenever I update my NuGet packages in Visual Studio, I am prompted for a username and password regarding a private NuGet feed. Despite me ticking the box [✓] Remember my password , I am prompted to enter password on subsequent NuGet updates. How can I make it remember my password properly? 回答1: This is a prompt from Visual Studio and not NuGet. Information entered here is not saved with NuGet. Although it should be cached for the current Visual Studio session. NuGet stores user names and

Private NuGet Feed - Remembering Password

谁说胖子不能爱 提交于 2021-02-07 08:28:41
问题 Whenever I update my NuGet packages in Visual Studio, I am prompted for a username and password regarding a private NuGet feed. Despite me ticking the box [✓] Remember my password , I am prompted to enter password on subsequent NuGet updates. How can I make it remember my password properly? 回答1: This is a prompt from Visual Studio and not NuGet. Information entered here is not saved with NuGet. Although it should be cached for the current Visual Studio session. NuGet stores user names and

Override a nuget package reference with a local project reference

久未见 提交于 2021-02-07 06:47:41
问题 I'd like iterate on a nuget package without continuously pushing the package to a nuget feed. I'm wondering if it's possible to conditionally add a project reference instead of a nuget package reference via a target or props file in csproj files that would allow me to locally debug my nuget package. In my csproj I would have: <Reference Include="A"> if(Exists(localOverrides.props) { <HintPath>localOverrides.A.HintPath</HintPath> } else { <HintPath>..\packages\A.dll</HintPath> } </Reference>