PresentationFramework DLL could not be loaded

2019-09-20 03:32发布

I am running a TeamCity build which is running FXCop Analysis.
Getting the following error:

[INFO] 2>Project : error : CA0058 : The referenced assembly 'PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be found. 

Now, this error is coming on only one of the machines, and he build is running fine on all remaining ones.

I've checked the following (same on all the machines)

  1. Checked that the assembly is present in GAC
  2. Verified that Visual Studio 2010 and FXCop 10.0 are present on all machines and verified the configuration.

Any idea?

标签: c# dll gac fxcop
1条回答
Lonely孤独者°
2楼-- · 2019-09-20 04:16

Try copying the PresentationFramework.dll file to

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC#\Bin or

C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC#\Bin if you are using Visual Studio 2012 now.

How to copy the DLL 1)Open command line and navigate to it like this

C:\Windows\assembly\GAC_MSIL\PresentationFramework\3.0.0.0__31bf3856ad364e35

2) Copy the file to a folder in your C Drive say DLLFiles with this command

copy PresentationFramework.dll C:\DLLFiles

3) Use windows explorer to copy to the Visual Studio folder. If that does not solve it try referencing the DLL in your project.

Hope it works.

查看更多
登录 后发表回答