Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/visual-studio/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio 加载EPPlus 4.0.0.1时出错,但存在nuget引用。_Visual Studio_Nuget - Fatal编程技术网

Visual studio 加载EPPlus 4.0.0.1时出错,但存在nuget引用。

Visual studio 加载EPPlus 4.0.0.1时出错,但存在nuget引用。,visual-studio,nuget,Visual Studio,Nuget,我不能100%确定这是NuGet问题还是其他地方的配置问题。我正在尝试修改一个引用EPPlus 3.x.x的项目中的一些代码,整个解决方案中的所有项目实际上都在修改,但是在其中一个包含我们实体的项目中,一位同事将其升级为使用4.0.0.1,这是测试版。以下是csproj文件中的实际行 //from the project where our entities our housed C:\work\Dev\SourceCode\Compass.Data\packages.config(7): &

我不能100%确定这是NuGet问题还是其他地方的配置问题。我正在尝试修改一个引用EPPlus 3.x.x的项目中的一些代码,整个解决方案中的所有项目实际上都在修改,但是在其中一个包含我们实体的项目中,一位同事将其升级为使用4.0.0.1,这是测试版。以下是csproj文件中的实际行

//from the project where our entities our housed
C:\work\Dev\SourceCode\Compass.Data\packages.config(7):  <package id="EPPlus" version="4.0.0-beta2" targetFramework="net40" />
//from the project I am trying to debug (step through).
C:\work\Dev\SourceCode\Compass.Business\packages.config(7):  <package id="EPPlus" version="3.1.3.3" targetFramework="net45" />
在packages文件夹中,我看到了以下内容

C:\work\Packages\EPPlus.4.0.0-beta2\lib\net20
我认为问题在于有一个net20文件夹,配置为targetFramework=net40,但我甚至不确定这一点。如果这是问题所在,我也不知道如何解决

希望有人能解释发生了什么


谢谢。

所以-虽然我真的不知道为什么我对这个问题有一个答案,可以帮助将来尝试调试的人

经过一些测试后,我意识到,当您没有附加调试程序时,这种方法工作得非常好。我唯一一次遇到问题的时候是我想逐步完成代码的时候。为了解决这个问题,我安装了GAC中正在寻找的版本。我不是100%确定这为什么有效,但它确实解决了我的问题

C:\WINDOWS\system32>cd C:\work\Packages\EPPlus.4.0.0-beta2\lib\net20

C:\work\Packages\EPPlus.4.0.0-beta2\lib\net20>gacutil /i EPPlus.dll
Microsoft (R) .NET Global Assembly Cache Utility.  Version 4.0.30319.33440
Copyright (c) Microsoft Corporation.  All rights reserved.

Assembly successfully added to the cache

C:\work\Packages\EPPlus.4.0.0-beta2\lib\net20>gacutil /l epplus
Microsoft (R) .NET Global Assembly Cache Utility.  Version 4.0.30319.33440
Copyright (c) Microsoft Corporation.  All rights reserved.

The Global Assembly Cache contains the following assemblies:
  epplus, Version=4.0.0.1, Culture=neutral, PublicKeyToken=ea159fdaa78159a1, processorArchitecture=MSIL

Number of items = 1

C:\work\Packages\EPPlus.4.0.0-beta2\lib\net20>

在我的例子中,它发生在一个ASP.NET网站上。 我确实更新了EPPLus.dll引用,但是发布函数没有用新文件替换旧文件。 手动删除dll并重新发布

C:\WINDOWS\system32>cd C:\work\Packages\EPPlus.4.0.0-beta2\lib\net20

C:\work\Packages\EPPlus.4.0.0-beta2\lib\net20>gacutil /i EPPlus.dll
Microsoft (R) .NET Global Assembly Cache Utility.  Version 4.0.30319.33440
Copyright (c) Microsoft Corporation.  All rights reserved.

Assembly successfully added to the cache

C:\work\Packages\EPPlus.4.0.0-beta2\lib\net20>gacutil /l epplus
Microsoft (R) .NET Global Assembly Cache Utility.  Version 4.0.30319.33440
Copyright (c) Microsoft Corporation.  All rights reserved.

The Global Assembly Cache contains the following assemblies:
  epplus, Version=4.0.0.1, Culture=neutral, PublicKeyToken=ea159fdaa78159a1, processorArchitecture=MSIL

Number of items = 1

C:\work\Packages\EPPlus.4.0.0-beta2\lib\net20>