Nuget-程序包还原失败。回滚“ WebApplication1”的程序包更改。 0 [英] Nuget - Package restore failed. Rolling back package changes for 'WebApplication1'. 0

查看:1181
本文介绍了Nuget-程序包还原失败。回滚“ WebApplication1”的程序包更改。 0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我自己尚未发布的自定义nuget软件包,尚未在本地进行测试。



nuget软件包包含一个dll文件和nuspec文件,如下所示。

 <?xml version = 1.0?> 
< package>
<元数据>
< id> MyLib< / id>
< version> 1.0.0< / version>
< authors> Author< / authors>
< owners>所有者< / owners>
< licenseUrl>许可证url< / licenseUrl>
< projectUrl>项目url< / projectUrl>
< requireLicenseAcceptance> false< / requireLicenseAcceptance>
< description>一些说明< / copyright>
< tags> Tag1 Tage2< / tags>
< / metadata>
< files>
< file src = bin\Debug\netstandard1.4\ * .dll target = lib />
< file src = bin\Debug\netstandard1.4\ * .pdb target = lib />
< / files>
< / package>

我已将nupkg文件复制到一个位置并将其添加到

  Visual Studio工具->选项->包裹->来源目录

错误

 软件包MyLib 1.0.0与netcoreapp1.0(.NETCoreApp,Version = v1.0)不兼容。软件包MyLib 1.0.0支持:net(.NETFramework,Version = v0.0)
软件包还原失败。回滚 WebApplication1的程序包更改。

不确定如何解决该问题或查找更多信息。



更多信息



该dll文件是使用模板(.Net Framework 4.5.2)创建的

 模板->可视C#-> .NET Core->类库(.NET标准)

使用模板创建了Web应用程序。 (空Web应用程序)

 模板->可视C#-> .NET Core-> ASP.NET Core Web应用程序(.NET Core)

编辑



我在 Output 窗口下找到了更多详细信息

 一个或多个软件包与.NETCoreApp,Version = v1.0不兼容。 

我应该创建哪种类库与.NETCoreApp兼容?



Edit2



我看到了这个


It's my own custom nuget package that I've not published yet and testing locally.

The nuget package consists of a dll file and nuspec file is as follows.

<?xml version="1.0"?>
<package >
  <metadata>
    <id>MyLib</id>
    <version>1.0.0</version>
    <authors>Author</authors>
    <owners>Owner</owners>
    <licenseUrl>license url</licenseUrl>
    <projectUrl>project url</projectUrl>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>some description</copyright>
    <tags>Tag1 Tage2</tags>
  </metadata>
  <files>
    <file src="bin\Debug\netstandard1.4\*.dll" target="lib" />
    <file src="bin\Debug\netstandard1.4\*.pdb" target="lib" />
  </files>
</package>

I've copied the nupkg file to a location and added it to the

Visual studio Tools -> Options -> Packages -> sources directory 

Error:

Package MyLib 1.0.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package MyLib 1.0.0 supports: net (.NETFramework,Version=v0.0)
Package restore failed. Rolling back package changes for 'WebApplication1'.

Not sure how can I resolve the issue or find more information.

More Info

The dll file was created using template (.Net Framework 4.5.2)

Templates -> Visual C# -> .NET Core -> Class Library (.NET Standard)

The web application was crated using template. (Empty Web Application)

Templates -> Visual C# -> .NET Core -> ASP.NET Core Web Application (.NET Core)

Edit

I found more details under Output window

One or more packages are incompatible with .NETCoreApp,Version=v1.0.

What kind of class library should I create which is compatible with .NETCoreApp?

Edit2

I saw this URL. it suggests to create the nupkg using dotnet.exe pack --no-build whereas earlier I downloaded the nuget.exe from nuget.org to create the package.

I tried above command but then visual studio says

"... Target pack doesn't exists in the project ... "

Followed instructions on this site as well but failed

这篇关于Nuget-程序包还原失败。回滚“ WebApplication1”的程序包更改。 0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆