C#: Could not load types from assembly

后端 未结 4 1186
暗喜
暗喜 2020-12-10 04:34

After adding Lucene.net and Lucene.net Contrib to a C# MVC3, I get the message below after the first successful run. After receiving this error, I need to completely wipe C:

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-10 05:31

    The manifest definition does not match means there is an issue with the resolution of the assembly. see this SO question

    [edit]

    Assemblies are loaded from GAC, then lib/bin directories within your application, then directories specified via in your project. Check that you have

    Specific Version = True and Copy Local = True

    in the reference's properties window.

    Assemblies from the private paths within your application (lib/bin directories) are the only ones that get shadow-copied. It's possible Contrib.Regex is being shadow-copied while Lucene.NET core is not.

    [/edit]

    The directory under ASP.NET Temporary Files that you are wiping is the shadow-copy directory. There may be an issue with how this assembly is being copied, which may be permissions for your domain account. You can test this theory by changing the shadowcopy directory or turning off shadowcopying completely as described here:

    You can change this directory in Application_Start as explained at https://stackoverflow.com/a/2847495/151445

    You can turn off shadow copying in the web.config:

提交回复
热议问题