使用了LocalDB的ASP.NET程式在部署到IIS時會報錯。修改步驟如下:
1)setProfileEnvironment需設定為true
This requires editing applicationHost.config file which is usually located in C:\Windows\System32\inetsrv\config.
Following the instructions from KB 2547655 we should enable both flags for Application Pool ASP.NET v4.0, like this:
<add name="ASP.NET v4.0" autoStart="true" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated">
<processModel identityType="ApplicationPoolIdentity" loadUserProfile="true" setProfileEnvironment="true" />
</add>
2)Run IIS as our Windows user
詳細資訊請參考:
1)http://blogs.msdn.com/b/sqlexpress/archive/2011/12/09/using-localdb-with-full-iis-part-1-user-profile.aspx
2)http://blogs.msdn.com/b/sqlexpress/archive/2011/12/09/using-localdb-with-full-iis-part-2-instance-ownership.aspx