简体   繁体   中英

IIS Multidomain with asp.net and ef

I have multiple domains (eg site1.my.domain, site2.my.domain etc) on an IIS8.5 on server 2012. They must share the same code-base to maintain updates easier. But the shall all have different databases (with code first EF). Is there a way that I can include or load different web.config in IIS depending on sub-domain? Or is there a way to create a connectionstring dynamically before EF opens it? (try different approaches, but as soon as I log in, it crashes because no host/Request/Session available in Code.

Thanks in advance Carsten

OK. And found the solution for that problem: On SetInitializers() just put a true in the brackets... Darn... So easy... 2 days...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM