ASP.NET MVC: Views using a model type that is loaded by MEF can't be found by the view engine

前端 未结 2 900
天命终不由人
天命终不由人 2021-02-13 21:06

I\'m attempting to create a framework for allowing controllers and views to be dynamically imported into an MVC application. Here\'s how it works so far:

  • I\'m usin
2条回答
  •  鱼传尺愫
    2021-02-13 21:45

    Based on Update 2, I'm guessing what you've got is an explicitly loaded copy of your assembly (that is, it was loaded through some other method than Load, like LoadFrom). Explicitly loaded assemblies are set off aside into a special place, because they are not allowed to satisfy implicit type requirements. The rules for Fusion (the assembly loader) can be pretty arcane and hard to understand.

    I agree with Matthew's assessment that, to get this to work, your DLL is going to have to be in /bin or else it will never be able to satisfy the implicit type requirement.

提交回复
热议问题