今天打开VS2010,扩展管理器通知了我NuGet Package Manager的更新.
在安装过程中,我收到一个"安装失败",其中包含查看日志的选项.
我在该日志文件中看到的关键错误消息是:
The signature on the update version of 'NuGet Package Manager' does not match
the signature on the installed version. Therefore, Extension Manager cannot
install the update.
Run Code Online (Sandbox Code Playgroud)
我正在升级的版本号如下.
Current Version: 1.5.20902.9026
New Version: 1.6.21205.9031
Run Code Online (Sandbox Code Playgroud)
我也尝试安装它,而VS2010通过此页面关闭: 这里
当与vs 2010一起使用asp.net mvc 3项目时,我有很多警告,如下所示:
我想知道我做错了什么,我需要改变一些东西,因为这是Visual Studio中的开箱即用项目.
警告1未声明'packages'元素.C:\ Users\LUIS.SIMBIOS\Documents\Visual Studio 2010\Projects\SlnHR\HR\packages.config 2 2 HR
警告2验证(XHTML 1.0 Transitional):属性'charset'不是元素'meta'的有效属性.C:\ Users\LUIS.SIMBIOS\Documents\Visual Studio 2010\Projects\SlnHR\HR\Views\Shared_Layout.cshtml 4 11 HR
警告20错误6002:表/视图'HR.dbo.vw_aspnet_Users'没有定义主键.已推断密钥,并将定义创建为只读表/视图.C:\ Users\LUIS.SIMBIOS\Documents\Visual Studio 2010\Projects\SlnHR\HRRazorForms\Models\HR.edmx 1 1 HRRazorForms
web.config中
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=152368
-->
<configuration>
<connectionStrings>
<add name="ApplicationServices" connectionString="data source=xx; User Id=development; Password=xxxxx; Initial Catalog=HR" providerName="System.Data.SqlClient" />
<add name="HREntities" connectionString="metadata=res://*/Models.HR.csdl|res://*/Models.HR.ssdl|res://*/Models.HR.msl;provider=System.Data.SqlClient;provider connection string="Data Source=xxxx;Initial Catalog=HR;User ID=development;Password=xxxx;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" /></connectionStrings>
<appSettings>
<add key="webpages:Version" value="1.0.0.0" />
<add key="ClientValidationEnabled" value="true" />
<add …
Run Code Online (Sandbox Code Playgroud) 我有一个包含大约30个项目的.net解决方案,所有这些项目都以.Net Framework 4.5为目标.每个引用至少3-4个NuGet包.
我们现在需要将它们更新为.Net Framework 4.6.1.所以这就是我需要知道的:
我正在尝试为.Net程序集创建NuGet程序包,它会对原生的win32 dll进行pinvoke.我需要将程序集和本机dll打包,并将程序集添加到项目引用中(此部分没有问题),并且应将本机dll复制到项目输出目录或其他相关目录中.
我的问题是:
使用较新版本的NuGet,可以配置项目以自动恢复NuGet包,以便该packages
文件夹不需要包含在源代码存储库中.好.
但是,此命令添加了一个新.nuget
文件夹,其中有一个二进制文件NuGet.exe.这也可以由Visual Studio自动重新创建,因此将其添加到版本控制感觉不正确.但是,如果没有此文件夹,Visual Studio甚至无法正确加载解决方案.
你们怎么处理这个?将.nuget添加到源代码管理中?在打开解决方案之前运行一些命令行脚本?
我正在尝试使用MSBuild 12.0 构建一个packages
内容缺失(repositories.config
内部除外)的解决方案.我希望它能在构建之前自动恢复所有丢失的软件包但事实并非如此--MsBuild会报告大量错误:
"你错过了使用指令或汇编引用吗?"
NuGet Manager是2.7(我在Visual Studio 2013中看到这个关于框).我甚至试图传递EnableNuGetPackageRestore=true
参数 - 没有运气.我错过了什么?
所以我从http://www.twitterizer.net/downloads/下载了Twitterizer
我尝试在Visual Studio中打开它并获取所有这些nuget错误:
The imported project "C:\Twitterizer\.nuget\nuget.targets" was not found.
Confirm that the path in the <Import> declaration is correct, and that the file
exists on disk.
Run Code Online (Sandbox Code Playgroud)
到底是怎么回事.我该如何处理?
我有一个我已经制作的装配,这对我公司的团队非常具体.我希望能够使用NuGet使这个程序集可用于我的团队和我公司的类似团队正在开展的其他项目.但是,程序集并不是我想要与世界共享的代码.
我知道使用Maven,您可以从本地仓库创建本地存储库和源包.NuGet是否支持类似的功能?有没有办法让NuGet指定本地存储库或拥有私有包?
有没有办法使用在发布模式下编译的代码来创建NuGet包?或者是否有一些原因我应该只发布(在本地使用,在这种情况下可用)在调试模式下编译的包?
每次我nuget pack
从我的项目目录中调用时,我在下面的nuspec文件,在代码我只在发布模式下编译,它抱怨没有在调试文件夹("\bin\Debug\SomeProject.dll"
)中找到DLL .如果我在调试模式下编译它,那些文件就在那里并按照它应该将它们打包.
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>$id$</id>
<version>$version$</version>
<authors>$author$</authors>
<owners>$author$</owners>
<iconUrl>http://somewhere/project.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>$description$</description>
</metadata>
</package>
Run Code Online (Sandbox Code Playgroud) 假设我有一个类库,我想以netstandard1.3为目标,但也使用BigInteger
.这是一个简单的例子 - 唯一的源文件是Adder.cs
:
using System;
using System.Numerics;
namespace Calculator
{
public class Adder
{
public static BigInteger Add(int x, int y)
=> new BigInteger(x) + new BigInteger(y);
}
}
Run Code Online (Sandbox Code Playgroud)
回到这个世界project.json
,我将netstandard1.3
在该frameworks
部分中进行定位,并且明确依赖于System.Runtime.Numerics
版本4.0.1.我创建的nuget包将列出该依赖项.
在基于csproj的dotnet工具的勇敢新世界中(我使用的是命令行工具的v1.0.1),有一个隐含的元数据包引用,用于NETStandard.Library 1.6.1
何时进行定位netstandard1.3
.这意味着我的项目文件非常小,因为它不需要显式依赖项:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.3</TargetFramework>
</PropertyGroup>
</Project>
Run Code Online (Sandbox Code Playgroud)
...但是生成的nuget包依赖于NETStandard.Library
,这表明为了使用我的小型库,你需要那里的一切.
事实证明我可以使用禁用该功能DisableImplicitFrameworkReferences
,然后再次手动添加依赖项:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.3</TargetFramework>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Runtime.Numerics" Version="4.0.1" />
</ItemGroup>
</Project>
Run Code Online (Sandbox Code Playgroud)
现在,我的NuGet软件包确切地说明了它所依赖的内容.直观地说,这感觉就像一个"更精简"的包装.
那么我图书馆消费者的确切区别是什么?如果有人试图在UWP应用程序中使用它,第二个"修剪"形式的依赖关系是否意味着生成的应用程序会更小?
通过不清楚地记录 …