asp.net 核心 nuspec 项目依赖
asp.net core nuspec project dependency
我有几个使用 asp.net 核心制作的项目,我想将它们导出到 NuGet。第一个版本(0.9.0)一切都很好。但是当我将一个包更新到 0.9.1 时,我开始遇到版本问题,导致应用程序开始寻找所有版本为 0.9.1 的依赖项(即使只有一个被更新,其他的仍然是 0.9.0)
谁能检查一下我的配置,看看我哪里出错了?
谢谢!
这些是我得到的错误:
FileLoadException: Could not load file or assembly 'Framework.Web, Version=0.9.1.0, Culture=neutral, PublicKeyToken=null'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
FileLoadException: Could not load file or assembly 'Framework.Web, Version=0.9.1.0, Culture=neutral, PublicKeyToken=null'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
这是我的 nuspec 文件:
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<!-- Required elements-->
<id>Framework.Web.Mvc</id>
<version>0.9.1</version>
<description>Framework web MVC library</description>
<authors>Lucas Leite</authors>
<!-- Optional elements -->
<dependencies>
<dependency id="Framework.Web" version="0.9.0" />
<dependency id="Framework.Model" version="0.9.0" />
<dependency id="Microsoft.AspNetCore.Localization.Routing" version="1.1.2" />
<dependency id="Microsoft.AspNetCore.Mvc" version="1.1.3" />
</dependencies>
<!-- ... -->
</metadata>
<!-- Optional 'files' node -->
<files>
<file src="bin\Release\netcoreapp1.1\Framework.Web.Mvc.dll" target="lib\netcoreapp1.1" />
<file src="bin\Release\netcoreapp1.1\Framework.Web.Mvc.xml" target="lib\netcoreapp1.1" />
<file src="bin\Release\netcoreapp1.1\pt-BR\Framework.Web.Mvc.resources.dll" target="lib\netcoreapp1.1\pt-BR" />
</files>
</package>
尝试将依赖版本更改为(,0.9.0]
:
<dependency id="Framework.Web" version="(,0.9.0]" />
根据Nuget dependency versioning、
<!-- Accepts any version 0.9.0 and above -->
<dependency id="Framework.Web" version="0.9.0" />
和
<!-- Accepts any version up below or include 0.9.0-->
<dependency id="ExamplePackage" version="(,0.9.0]" />
我有几个使用 asp.net 核心制作的项目,我想将它们导出到 NuGet。第一个版本(0.9.0)一切都很好。但是当我将一个包更新到 0.9.1 时,我开始遇到版本问题,导致应用程序开始寻找所有版本为 0.9.1 的依赖项(即使只有一个被更新,其他的仍然是 0.9.0)
谁能检查一下我的配置,看看我哪里出错了? 谢谢!
这些是我得到的错误:
FileLoadException: Could not load file or assembly 'Framework.Web, Version=0.9.1.0, Culture=neutral, PublicKeyToken=null'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
FileLoadException: Could not load file or assembly 'Framework.Web, Version=0.9.1.0, Culture=neutral, PublicKeyToken=null'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
这是我的 nuspec 文件:
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<!-- Required elements-->
<id>Framework.Web.Mvc</id>
<version>0.9.1</version>
<description>Framework web MVC library</description>
<authors>Lucas Leite</authors>
<!-- Optional elements -->
<dependencies>
<dependency id="Framework.Web" version="0.9.0" />
<dependency id="Framework.Model" version="0.9.0" />
<dependency id="Microsoft.AspNetCore.Localization.Routing" version="1.1.2" />
<dependency id="Microsoft.AspNetCore.Mvc" version="1.1.3" />
</dependencies>
<!-- ... -->
</metadata>
<!-- Optional 'files' node -->
<files>
<file src="bin\Release\netcoreapp1.1\Framework.Web.Mvc.dll" target="lib\netcoreapp1.1" />
<file src="bin\Release\netcoreapp1.1\Framework.Web.Mvc.xml" target="lib\netcoreapp1.1" />
<file src="bin\Release\netcoreapp1.1\pt-BR\Framework.Web.Mvc.resources.dll" target="lib\netcoreapp1.1\pt-BR" />
</files>
</package>
尝试将依赖版本更改为(,0.9.0]
:
<dependency id="Framework.Web" version="(,0.9.0]" />
根据Nuget dependency versioning、
<!-- Accepts any version 0.9.0 and above -->
<dependency id="Framework.Web" version="0.9.0" />
和
<!-- Accepts any version up below or include 0.9.0-->
<dependency id="ExamplePackage" version="(,0.9.0]" />