Could not load file or assembly 'System.Window

2019-01-12 02:44发布

I just added System.Windows.Interactivity assembly. XamlParse throw me an exception on run time:

Could not load file or assembly 'System.Windows.Interactivity, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Google search found only results related to prism - which I do not use.

Any idea why does it happen?

7条回答
祖国的老花朵
2楼-- · 2019-01-12 03:05

This was this morning's task. The problem for us was just that the installer moved the location of the DLL. Sometimes it's not a subtle version mismatch: a simple misplacement will cause the same signs. You can use Fuslogvw.exe to help diagnose this. Once you (a) remember to launch the tool with Admin privs and (b) configure the tool to show you binding failures ("Settings"), you'll see log entries like this:

LOG: DisplayName = System.Windows.Interactivity, PublicKeyToken=31bf3856ad364e35 (Partial) WRN: Partial binding information was supplied for an assembly: [ red herring, not a problem for us ] ... LOG: GAC Lookup was unsuccessful [ another red herring: System.Windows.Interactivity.dll is not a core assembly and not registered in the GAC by default ] LOG: Attempting download of new URL file:///C:/Program Files (x86)/<path>/System.Windows.Interactivity.DLL. ... LOG: All probing URLs attempted and failed. After you put the DLL where it belongs, the log will look like this: LOG: GAC Lookup was unsuccessful. LOG: Attempting download of new URL file:///C:/Program Files (x86)/<path>/System.Windows.Interactivity.DLL. LOG: Assembly download was successful. Attempting setup of file: C:\Program Files (x86)\<path>\System.Windows.Interactivity.dll

查看更多
登录 后发表回答