开发者

How do I work with ASP.NET between SubVersion and my hosted site?

I'm at the very beginning of learning ASP.NET WebForms. Right now I'm starting to go through the TailSpin-SpyWorks tutorial. I've also setup a Windows hosting account at www.arvixe.com to use to host my site(s).

I've currently been working on desktop apps in WinForms with C#, and using subversion for version control. And I'm trying to understand how my current work-flow will translate into to an ASP.NET environment. Now I understand that the process of administering websites can be incredible complex for a large site, but keep in mind I'm just trying to get a basic idea of how I should be working while creating very simple site.

Off hand I was thinking that I would have a local database with some sample data to use for local debugging as I'm working on the site. Then I'd have the live version on my host, that pointed at the live database on the host as well. Also I was thinking I could also have a separate staging site under a "beta" subdomain folder on my host that would allow me to check a work in process version of the site with the live data.

Am I on the right track? I'm especially confused with how I can work between a local copy pointing at my local database, and th开发者_如何学Ce live version pointing at the live database but all the files be under version control.

At first I sure I'll end up needing to make a lot of changes to the database schema. Will I just end up having to make each change twice? First in the local database, and then again in the live database? Or is there some easy way to push the changes in the local database to the live database?

I figure I must need to have separate web.config files for debugging and the live site correct? Do both these files go into version control? If so how do I tell Visual Studio to use the first while debugging locally, but publish the 2nd?


second paragraph still says winforms.. but anyhow lets see if i could shed some light regarding some of your inquiry.

assuming you want to do a web application and not win app. let me answer your question one by one:

Off hand I was thinking that I would have a local database with some sample data to use for local debugging as I'm working on the site. Then I'd have the live version on my host, that pointed at the live database on the host as well. Also I was thinking I could also have a separate staging site under a "beta" subdomain folder on my host that would allow me to check a work in process version of the site with the live data.

if you want above then you will need, 3 DB instances, one on your local, and two on the live server(one for live db and the other for the test DB).

Ultimately, your local, live and test should be one version. what i mean is same version but different copies of the files. I think you are confusing your self with version and files.

after your done with the local development you will publish that version. when you publish you will have files that you will then deploy on your live server which doesn't need version control normally. assuming you have setup the test and the live site properly, when the files are on the server you will implement it first on the test (put the files on the "test" folder) if testing is successful then copy the same files(same version) on the "live" folder (keep in mind these are two folder which will have two different webconfig; one main difference will be the db connection because one should be pointing at the test db and the other is on the live db)

if you want to have some sort of versioning on the published files on the server. what you can do is backup the files on the test and live folders before overriding it with the new published version.

Am I on the right track? I'm especially confused with how I can work between a local copy pointing at my local database, and the live version pointing at the live database but all the files be under version control.

i don't know much about subversion. but what i do know is that you can work between databases via the webconfig.

also for the live website you dont need the whole lot of codes, you just need essential files like the .dll, aspx pages and script styles etc. and we dont normally put it under source/version control.

At first I sure I'll end up needing to make a lot of changes to the database schema. Will I just end up having to make each change twice? First in the local database, and then again in the live database? Or is there some easy way to push the changes in the local database to the live database?

there is a database compare function in Visual Studio where you could push changes you make from local to live easier. Another option is to use script when doing changes in the database, so that you just need to run the script again on the live db when you need to.

I figure I must need to have separate web.config files for debugging and the live site correct? Do both these files go into version control? If so how do I tell Visual Studio to use the first while debugging locally, but publish the 2nd?

Yes separate webconfigs, but you only need keep one on you version control, the live one wont be under the version control normally.

Another alternative is to just have one webconfig and have different sets of keys for live, test and debug. just comment out the sets that you dont need. this will work for you but if your team will go big, other developers should not see details like credentials for the live db and that is also one reason not to put it under subversion. just keep the files on the live server where only authorize people can see.

hope you get somthing from this. cheers!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜