Setting up an ASP.net development environment

Oct 27, 2007
17,009
5
0
I have some basic experience in developing web sites using PHP and mySQL but my experience is pretty limited. In the past I have set up forums, Drupal environments etc by installing them on some webspace hosted by Dreamhost. I don't fully understand the dynamics of database servers but I have a flimsy grasp on the concepts.

What I want to do is start learning ASP.net web programming by developing locally. I have installed MS SQL, the .NET framework and visual studio on my desktop. I'm trying to get my head around how this whole thing works. Basically I want to be able to develop web sites and apps on either my desktop or laptop, and upload them to the web server set up on my desktop. I have that part sort of under control. The two computers are networked so that if I visit http://localhost on the desktop or http://198.162.0.1 (local network address of desktop) from the laptop I'm presented with whatever web pages I put in a particular folder on the desktop (in this case c:\server\www\). I also have FTP access to this folder from the laptop.

Can someone help me by explaining in simple terms what the best way of setting this environment up for dynamic ASP.net development? I'm not really sure how to phrase the question because I don't fully understand the concepts behind servers, database servers etc. I shouldn't even need to worry about setting up SQL on the laptop, correct?

Also as an aside, it is possible to gain FTP or HTTP access to my desktop from outside of my local network? The desktop is connected to the internet through a router (along with several other computer belonging to my flat mates). This isn't an urgent concern but it would be cool if this was possible. The desktop is only a development environment so I don't need to find a new host just to test my ASP.net stuff which isn't supported by Dreamhost.

Sorry if this request is somewhat nebulous but I'm new to this stuff. Any advice and links would be very much appreciated. Thanks!
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
I'll take the last question first :). Assuming you're in a typical SOHO environment, i.e. behind a router, then to get outside access to either FTP or HTTP you'd gave to forward a port from the router to whatever machine is hosting that service. Then you would use the IP the cable co. assigns the external interface of the router as the IP for the service.

There are a lot of ways to set up an ASP.NET dev environment, as with any other platform. Probably the typical way for a sole developer is to work off one machine, i.e. SQL Server (possibly express edition), Visual Studio, and the integrated dev. web server on one machine. You can develop and debug easily in such an environment without jumping through a lot of hoops. If you have a separate server to test the site you can either use VS's publish utility or just FTP the files over as needed.

If you want to diversify out of that then you can start moving servers off the main system. So you might have SQL Server or MySQL running on a separate machine, and set up the database connections in web.config to point to that. There's no real reason to develop on an external web server, although you can and can also debug remotely. In your case I don't think you benefit, as you aren't part of a team integrating builds and content.

You only need the SQL Server/MySQL database client software on the web server system.
 

clamum

Lifer
Feb 13, 2003
26,256
406
126
At my job I have a laptop for development (well, two of them at the moment) and do all of my dev work on it. I have Visual Studio, MS SQL 2005, the .NET frameworks, and of course IIS installed so all of my tools are local.

My web.config or app.config files have the database connection strings in them, usually defaulted to my local database instance. That way I can add additional connection strings to remote databases and change one line of code to connect to them instead.
 
Oct 27, 2007
17,009
5
0
Thanks for your detailed replies guys, that helps a lot. So far I have managed to forward HTTP requests to my cable-company assigned IP address so I can access my home PC through HTTP and FTP protocols from anywhere (I didn't even know this was possible, awesome!). I have a SQL database server running on my desktop and a user name and password set up so my laptop can access it. I am opening the web site files locally from my desktop machine (c:\server\www) and through FTP from the desktop. Although it took several hours of tearing my hair out getting it to work I can access my SQL databases from anywhere. I think this is a pretty complete setup but let me know if I'm forgetting anything.

Also regarding the web.config files, is there a simple way to add database connection strings to this file without doing it manually? I'm still not totally familiar with SQL syntax and I'm sure I'll break things if I edit it manually.
 
Oct 27, 2007
17,009
5
0
Also just another quick question, I have forwarded port 80 (HTTP) to my PC - is this the standard way of accessing a home server? Are there significant risks involved with using this port to access my computer remotely?
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
Originally posted by: GodlessAstronomer
Also just another quick question, I have forwarded port 80 (HTTP) to my PC - is this the standard way of accessing a home server? Are there significant risks involved with using this port to access my computer remotely?

Opening any port on the public side of your router is risky to a certain extent. As normally configured your router only allows connections to be initiated from within your network. As you have set it up it will listen on port 80 or whatever and respond to connection requests by forwarding to an internal machine. Make very certain of the configuration of the web server and FTP server, as you could potentially set someone loose inside.
 

techfuzz

Diamond Member
Feb 11, 2001
3,107
0
76
Originally posted by: GodlessAstronomer
Also regarding the web.config files, is there a simple way to add database connection strings to this file without doing it manually? I'm still not totally familiar with SQL syntax and I'm sure I'll break things if I edit it manually.
You can try to use the IIS Configuration Manager, but I wouldn't recommend it. I don't think it automatically builds the string for you anyways.

Try this site for some help:
http://www.connectionstrings.com

Just add this to your web.config under the <configuration> section:
<connectionStrings>
<add name="myConnectionString" connectionString="Data Source=192.168.1.100;Initial Catalog=database_name;User Id=username;Password=password;"/>
</connectionStrings>

techfuzz