lachmann
asked on
Login problems after deploying to IIS
I am using VS2005 to build a simple web application. I am using the login control and a SQL Express database to validate the user. The login works fine when I run the web app from VS 2005, but when I deploy the application to IIS the logins fail, and when I try to retrieve the password I get the following error in the browser.
The MDF file is the same one that is in the VS 2005 project. WHat is different when I deploy?
Help please.
========================== ========== ========== ========== ========== ========== ========== =======
Server Error in '/WebSite1' Application.
-------------------------- ---------- ---------- ---------- ---------- ---------- ----
Failed to update database "C:\INETPUB\WWWROOT\WEBSIT E1\APP_DAT A\ASPNETDB .MDF" because the database is read-only.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlE xception: Failed to update database "C:\INETPUB\WWWROOT\WEBSIT E1\APP_DAT A\ASPNETDB .MDF" because the database is read-only.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException (0x80131904): Failed to update database "C:\INETPUB\WWWROOT\WEBSIT E1\APP_DAT A\ASPNETDB .MDF" because the database is read-only.]
System.Data.SqlClient.SqlC onnection. OnError(Sq lException exception, Boolean breakConnection) +857434
System.Data.SqlClient.SqlI nternalCon nection.On Error(SqlE xception exception, Boolean breakConnection) +735046
System.Data.SqlClient.TdsP arser.Thro wException AndWarning (TdsParser StateObjec t stateObj) +188
System.Data.SqlClient.TdsP arser.Run( RunBehavio r runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838
System.Data.SqlClient.SqlC ommand.Fin ishExecute Reader(Sql DataReader ds, RunBehavior runBehavior, String resetOptionsString) +149
System.Data.SqlClient.SqlC ommand.Run ExecuteRea derTds(Com mandBehavi or cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +886
System.Data.SqlClient.SqlC ommand.Run ExecuteRea der(Comman dBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +132
System.Data.SqlClient.SqlC ommand.Int ernalExecu teNonQuery (DbAsyncRe sult result, String methodName, Boolean sendToPipe) +415
System.Data.SqlClient.SqlC ommand.Exe cuteNonQue ry() +135
System.Web.Security.SqlMem bershipPro vider.Rese tPassword( String username, String passwordAnswer) +2226
System.Web.Security.Member shipUser.R esetPasswo rd(String passwordAnswer) +83
System.Web.Security.Member shipUser.R esetPasswo rd(String passwordAnswer, Boolean useAnswer, Boolean throwOnError) +34
System.Web.UI.WebControls. PasswordRe covery.Att emptSendPa sswordQues tionView() +352
System.Web.UI.WebControls. PasswordRe covery.Att emptSendPa ssword() +66
System.Web.UI.WebControls. PasswordRe covery.OnB ubbleEvent (Object source, EventArgs e) +101
System.Web.UI.Control.Rais eBubbleEve nt(Object source, EventArgs args) +35
System.Web.UI.WebControls. Button.OnC ommand(Com mandEventA rgs e) +115
System.Web.UI.WebControls. Button.Rai sePostBack Event(Stri ng eventArgument) +163
System.Web.UI.WebControls. Button.Sys tem.Web.UI .IPostBack EventHandl er.RaisePo stBackEven t(String eventArgument) +7
System.Web.UI.Page.RaisePo stBackEven t(IPostBac kEventHand ler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePo stBackEven t(NameValu eCollectio n postData) +33
System.Web.UI.Page.Process RequestMai n(Boolean includeStagesBeforeAsyncPo int, Boolean includeStagesAfterAsyncPoi nt) +5102
-------------------------- ---------- ---------- ---------- ---------- ---------- ----
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
The MDF file is the same one that is in the VS 2005 project. WHat is different when I deploy?
Help please.
==========================
Server Error in '/WebSite1' Application.
--------------------------
Failed to update database "C:\INETPUB\WWWROOT\WEBSIT
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlE
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException (0x80131904): Failed to update database "C:\INETPUB\WWWROOT\WEBSIT
System.Data.SqlClient.SqlC
System.Data.SqlClient.SqlI
System.Data.SqlClient.TdsP
System.Data.SqlClient.TdsP
System.Data.SqlClient.SqlC
System.Data.SqlClient.SqlC
System.Data.SqlClient.SqlC
System.Data.SqlClient.SqlC
System.Data.SqlClient.SqlC
System.Web.Security.SqlMem
System.Web.Security.Member
System.Web.Security.Member
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.Control.Rais
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.Page.RaisePo
System.Web.UI.Page.RaisePo
System.Web.UI.Page.Process
--------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
ASKER
I performed the above actions, and the same thing happens.
If you right-click the file in windows explorer and choose the Security tab (if memory server), ensure that both IUSR and ASPNET accounts are both listed with write access to the file.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
in your sharing and security of the individual file, add your default web user (normally inet_pub ) to the list of users. Then you can edit the permission of the webuser itself to read / write to the file. This allows for that one file itself to be written to by someone logged to the website hosted from IIS without actually compromising the security of sharing it publicly through the directory.
I assume you are running IIS on a Windows XP or newer server.
I assume you are running IIS on a Windows XP or newer server.
ASKER
I am running IIS on Windows XP.
I am still not having any luck with this.
I am still not having any luck with this.
A dialogue box will open. Under the File tab, check the box that says []Write.
This will give IIS write-permissions.