无法加载文件或程序集'NuGet.Server,Version = 2.11.1.0,Culture = neutral,PublicKeyToken = null'或其依赖项之一 [英] Could not load file or assembly 'NuGet.Server, Version=2.11.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies

查看:381
本文介绍了无法加载文件或程序集'NuGet.Server,Version = 2.11.1.0,Culture = neutral,PublicKeyToken = null'或其依赖项之一的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我在本教程之后通过ASP.Net Web应用程序创建了一个NuGet服务器:



当我导航到网址时,我收到以下错误



如果图片不够清晰,请参见下文:


无法加载文件或程序集'NuGet.Server, Version = 2.11.1.0,Culture = neutral,PublicKeyToken = null'或其依赖项之一。定位的程序集的清单定义与程序集引用不匹配。 (来自HRESULT的异常:0x80131040)


这是我项目的 web.config 文件以及我的发布资料



我的目标.NET Framework版本是4.6,但程序包本身是早期版本的.NET。这可能是问题吗?我把项目文件夹放在我本地机器上的物理路径上,当我在调试模式下运行项目时,它工作得很好。请参阅下面的屏幕截图:



注意:由于组织机密性政策,我必须隐藏软件包名称。



我指向这些包文件:

  D:\ Backup\Dropbox\vox_server_01\\\
uget\Packages

我之所以如此我正在创建这个NuGet服务器是因为现有的服务器有问题。



这可能是用户组的权限吗在IIS?此链接

解决方案

我无法复制你的错误,但这里有一些注意到nuget服务器问题可能是什么已解决:



web.config中的 packagesPath 键可以留空,因为您已使用默认文件夹\Packages。



部署到服务器时,您可能会在行中找到错误访问路径服务器 .cache.bin被拒绝。只需在服务器上创建一个具有该名称的空白文件即可。


So I have created a NuGet Server via an ASP.Net Web Application following this tutorial: http://nugetserver.net/ which is hosted in IIS. I have placed the files on my D: drive on my server along with my packages.

IIS Sites Virtual Path:

I get the following error when I navigate to the url:

In case the picture is not clear enough, please see below:

Could not load file or assembly 'NuGet.Server, Version=2.11.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Here is my project's web.config file along with my publishing profile:

My target .NET Framework version is 4.6 but the packages themselves are those of an earlier version of .NET. Could this be the problem? I took the project folder and put it on my physical path on my local machine and it works just fine when I run the project in debug mode. Please see screenshot below:

NOTE: I have to hide the package names due to organizational confidentiality policies.

I am pointing to these package files:

D:\Backup\Dropbox\vox_server_01\nuget\Packages

The reason I am creating this NuGet server is because the existing one is buggy.

Could this be a permissions thing to the users group in IIS? This link Could not load file or assembly 'someProject' or one of its dependencies. Access is denied lead me to that question. Any suggestions on how I can get around this?

Update: Here are my package sources below:

解决方案

I could not replicate your error, but here are some notes how nuget server problems can be solved:

The packagesPath key in web.config can be left blank, as you are already using the default folder \Packages.

When deploying to the server, you might find an error in the line of Access to the path server.cache.bin is denied. Just create a blank file with that name on your server.

这篇关于无法加载文件或程序集'NuGet.Server,Version = 2.11.1.0,Culture = neutral,PublicKeyToken = null'或其依赖项之一的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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