應用程式要如何才能不繼承最外層主站台的設定
參考連結:
- Avoid web.config inheritance in child web application using inheritInChildApplications
- 如何讓同一個 IIS 站台設定兩個不同的 ASP.NET 應用程式
解决方式
<location path="." inheritInChildApplications="false">
應用程式的組件
載入組件時,讀取特定的版本,以下的例子為Entity Framework
原本讀取5.0.0.0
,但在特定的專案下要讀取6.0.0.0
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>