c# - Error Connecting to DB.mdf when published IIS -
i have been searching on different sources in search on solving issue.. i've published website on iis have been working on , first published website on iis.
i seem not able connect database.
i provide have done right down here..
appreciate please....
my web.config file in published website directory c:\financialhubtest. on side note tried adding user instance=true connection string in web.config file doesn't work..
<connectionstrings> <!--<add name="connstr" connectionstring="data source=(localdb)\mssqllocaldb;attachdbfilename=|datadirectory|\financialhub.mdf;integrated security=true" />--> <add name="connstr" connectionstring="data source=(localdb)\.\iis_db;integrated security=true;" /> </connectionstrings> details of mssqllocaldb cmd
applicationhost file in c:\windows\system32\inetsrv\config edited notepad2. i'm using financialhub applicationpool published website in iis
<applicationpools> <add name="defaultapppool" managedruntimeversion="v4.0" /> <add name="classic .net apppool" managedruntimeversion="v2.0" managedpipelinemode="classic" /> <add name=".net v2.0 classic" managedruntimeversion="v2.0" managedpipelinemode="classic" /> <add name=".net v2.0" managedruntimeversion="v2.0" /> <add name=".net v4.5 classic" managedruntimeversion="v4.0" managedpipelinemode="classic" /> <add name=".net v4.5" managedruntimeversion="v4.0" /> <add name="financialhub" autostart="true" managedruntimeversion="v4.0" managedpipelinemode="integrated"> <processmodel identitytype="applicationpoolidentity" loaduserprofile="true" setprofileenvironment="true" /> </add> <applicationpooldefaults managedruntimeversion="v4.0"> <processmodel identitytype="applicationpoolidentity" loaduserprofile="true" setprofileenvironment="false" /> </applicationpooldefaults> </applicationpools> my published website directory app_data having financialhub.mdf file
my sql server object explorer, connection appears when run website via visual studio 2015 think running on iis express..
i have been getting error every time change here , there i'm sure why.. or rather changes make either web.config, etc cause error. check windows event log too.
i followed these 2 links on dealing issue,
using localdb full iis, part 1: user profile,
using localdb full iis, part 2: instance ownership
if there need more information can provide..
i feel have been beating around bush trying figure out can't seem solve it..
i appreciate please. thank much.
you still using localdb after publishing application iis. localdb (sql database inside app_data) intended developing , testing purpose only.
you need real sql server when host site on iis. need install sql server either in same server application hosted or dedicated sql server. attach or copy existing database sql server.




Comments
Post a Comment