Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Anybody know about ASP.NET deployment?

Author
Message
Seppuku Arts
Moderator
19
Years of Service
User Offline
Joined: 18th Aug 2004
Location: Cambridgeshire, England
Posted: 1st May 2014 00:26
This is getting on my nerves a little bit now and I'm trying to find a solution to a problem I'm getting deploying my site. My host will only let me use FTP load and there's plenty of information on using Web Deploy, but the FTP method is frustrating me. Everything works except my user login database, it just keeps triggering an error page.

It's a web forms web application. Essentially what I've done to prepare the site before uploading is I've made sure the settings for IIS on my host server are set to v4.0 (I am using ASP.NET 4.0 within Visual Web Developer 2010) and that the application pool is set to integrated. This means it's compatible to run the site, in fact, it is running it. So I don't think there's a problem there.

Because my user-database is in .MDF file in my App_Data, what I've done to get it onto my server is to use the 'Publish to Provider' feature in Visual Studio and have used it as a query in SQL Management Studio to get the user database up and running and it is - I've tested it in SQL Management Studio and all of my data transferred with it (my test user accounts).

I also went to my web.config and updated my connection string. Yet I seem to still trigger the error, so to test it, I went to make a new user account on my localhost to see where it would end up, the database on my computer or the database on the server and it ended up on the database on my computer. As I am using the login controls built into the framework I don't have any specific database references in any of my pages. I've also tried changing the Connections in Database explorer too.

So I'm not sure exactly what's referencing the database on my PC.

Here is my web.config file (with private information removed):



I am obviously missing something, but at the moment, it's a mystery to me. My database should in theory be working.

Maybe it'll come to me when I've slept on it.

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 1st May 2014 00:34
Connect to FTP, copy files over, done. I'm confused what could be hard about that, but I don't know what Web Deploy all does automatically for you.

What kind of error message does it give you?


Quote: "I went to make a new user account on my localhost to see where it would end up, the database on my computer or the database on the server and it ended up on the database on my computer."

When you say localhost, you're testing this new account script from your home computer? Wouldn't it look for the database relative to the server running the script, thus your local pc?


It's been a long time since I messed with ASP anything.

Seppuku Arts
Moderator
19
Years of Service
User Offline
Joined: 18th Aug 2004
Location: Cambridgeshire, England
Posted: 1st May 2014 00:56
The problem with just uploading is that not all hosts allow any kind of remote access to the App_Data folder for security reasons (and mine is one of them), so I can't just upload the .MDB file, I have to move it into my MQL Server database.

Essentially the approach I need to use is covered by these 2 tutorials:
http://www.asp.net/web-forms/tutorials/deployment/deploying-web-site-projects/deploying-a-database-cs
http://www.asp.net/web-forms/tutorials/deployment/deploying-web-site-projects/configuring-the-production-web-application-to-use-the-production-database-cs

Quote: "When you say localhost, you're testing this new account script from your home computer? Wouldn't it look for the database relative to the server running the script, thus your local pc?
"


I am using my home computer to test the site before deployment and to debug, but from what I understood, it acquires a connection to your database via connection strings (like in web.config)

As for the error - it's a generic, I've not got as far as figuring out custom error handling, perhaps it would be wise for me to invest in doing so.

Seppuku Arts
Moderator
19
Years of Service
User Offline
Joined: 18th Aug 2004
Location: Cambridgeshire, England
Posted: 1st May 2014 21:16
I figured it out...seems like there was a problem in my connection string.

Login to post a reply

Server time is: 2024-04-27 16:50:54
Your offset time is: 2024-04-27 16:50:54