且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 mvc 4 的 web.config 文件中添加程序集

更新时间:2022-11-05 12:59:47

很简单.查看 web.config 中的编译部分:

It is quite simple. Look at your compilation section in your web.config:

<compilation debug="true" targetFramework="4.0"/>

现在打开该部分并将您的组件放入其中:

Now open the section and put your assembly inside like this:

<compilation debug="true" targetFramework="4.0">
  <assemblies>
    <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
  </assemblies>
</compilation>

本节中的库是在编译时检查的,与运行时绑定无关.

Libraries in this section are checked in compilation time, it has nothing to do with runtime binding.