Could not load file or assembly '' or one

2019-01-18 03:28发布

Any help please?

I have only one library and it is driving me crazy. this is the error that I receive. I am not using any other dependancies.

Could not load file or assembly 'FOD.Intranet.Lib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=039c1f3a4c719e82' or one of its dependencies. The system cannot find the file specified. 

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'FOD.Intranet.Lib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=039c1f3a4c719e82' or one of its dependencies. The system cannot find the file specified.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace: 


[FileNotFoundException: Could not load file or assembly 'FOD.Intranet.Lib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=039c1f3a4c719e82' or one of its dependencies. The system cannot find the file specified.]
   NewCollection.VisualWebPart1.VisualWebPart1UserControl.TodaysNews() +0
   NewCollection.VisualWebPart1.VisualWebPart1UserControl.Page_Load(Object sender, EventArgs e) +52
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
   System.Web.UI.Control.OnLoad(EventArgs e) +132
   System.Web.UI.Control.LoadRecursive() +66
   System.Web.UI.Control.AddedControl(Control control, Int32 index) +350
   NewCollection.VisualWebPart1.VisualWebPart1.CreateChildControls() +155
   System.Web.UI.Control.EnsureChildControls() +146
   System.Web.UI.Control.PreRenderRecursiveInternal() +61
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3394

9条回答
不美不萌又怎样
2楼-- · 2019-01-18 04:00

for guys still looking into this issue one thing u need to know is there are different GACutils out there , so u need to make sure that ur using correct GACUTIL to deploy the DLL to correct GAC

for eg: if my dll was complied in 3.5 .net framework and my OS version was 64 bit windows it would be in below location

C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\x64

Struggled for 4 stupid days to figure this out

查看更多
手持菜刀,她持情操
3楼-- · 2019-01-18 04:02

For assemblies not in GAC, and which are referred in the build, sometimes this error also happens if the platform target does not match. So match the assembly platform type to the one where it is being used.

enter image description here

查看更多
啃猪蹄的小仙女
4楼-- · 2019-01-18 04:03

Please try to unreference the DLL then re reference it again and rebuild you project. Also Check to ensure that the version matchs what is in the project web config

查看更多
登录 后发表回答