源代码控制/ASP.NET MVC 2 维护 - 从 Win7 笔记本电脑到 IIS7 生产服务器

发布于 2024-09-11 09:15:02 字数 459 浏览 4 评论 0原文

首先,我不确定是否应该将这个问题分成更小的、单独的问题。它们是相关的,但我不确定我是否做错了。抱歉,如果我是的话。

我对源代码/版本控制的想法有点陌生。我已经在我的开发笔记本电脑上安装了 TortoiseSVN,但还没有真正养成使用它的习惯。也就是说,我有一个正在运行的(目前还小得令人尴尬的)ASP.NET MVC 2 站点,很快就需要升级,我很好奇最好的方法是什么。另一个问题是,该网站目前不使用数据库,但很快就会使用。我已经在服务器上安装了 SQL Server 2008 R2。

那么,有没有办法让我使用 Subversion 将站点的更新版本推送到服务器?或者让服务器拉它?

使用VS 2010自带的版本控制会更好吗?

数据库呢?当我在解决方案中设置数据库及其数据时,如何将其移植到服务器?我需要手动写入数据库吗?

显而易见的选择是简单地用新版本覆盖现有的 .dll 并上传新的静态内容,但这对我来说似乎有点过时。

First, I'm not sure if I should break this question into smaller, individual questions. They're related, but I'm not sure if I'm doing it wrong. Apologies if I am.

I'm a bit new to the idea of source/version control. I have installed TortoiseSVN on my development laptop, but haven't really gotten into the habit of using it. That said, I have a live (and embarrassingly small, at the moment) ASP.NET MVC 2 site that will be in need of upgrading soon, and I'm curious as to what the best way to go would be. As an added wrinkle, the site does not currently use a database, but it will relatively soon. I've already installed SQL Server 2008 R2 on the server.

So, is there a way for me to use Subversion to push an updated iteration of my site to the server? Or to have the server pull it?

Would it be better to use the version control that comes with VS 2010?

What about the db? When I set up the db and its data in my solution, how would I port that over to the server? Would I have to manually write to the db?

The obvious option is to simply overwrite the existing .dll with the new build and upload new static content, but that seems a bit archaic to me.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

草莓酥 2024-09-18 09:15:02

您最好将其分成多个问题。

  1. 版本控制 - 除非您使用 Team Foundation 版本并安装了 TFS,否则 Visual Studio 中不会内置版本控制。颠覆是一个不错的选择。我更喜欢分布式 vcs 系统,如 git 或 hg,但如果您是新手,svn 是一个不错的选择。
  2. 可以使用svn从服务器拉取内容,但您可能不想直接将内容推到那里。如果这样做,您可以使用 MsBuild、NAnt、Rake 或许多其他构建工具自动执行该步骤。
  3. 数据库 - 据我所知,您需要在本地和生产计算机上运行数据库创建和更新脚本。您可以使用任务 ->从本地数据库生成脚本,以生成首次设置生产数据库时运行所需的脚本。之后,您应该计划在本地和生产环境中编写和执行更新脚本。您需要执行此操作,以确保您不会通过本地测试无意中删除数据。
  4. 不管是否过时,xcopy 部署仍然可行,尤其是使用构建工具来自动化该过程。

我希望这能有所帮助。

You would do better to split this up into multiple questions.

  1. Version control - unless you are using a Team Foundation version and have TFS installed, you don't have version control built into Visual Studio. Subversion is a good choice. I prefer distributed vcs systems like git or hg, but if you're new to it, svn is a good choice.
  2. You can use svn to pull from the server, but you probably don't want to shove stuff out there directly. If you do, you can automate the step using a build tool like MsBuild, NAnt, Rake, or many others.
  3. Database - So far as I know, you'll need to run your database creation and update scripts on both your local and production machines. You can use the Tasks -> Generate Scripts from your local database to generate the scripts you need to run the first time you set up your production database. After that, you should plan to write and execute update scripts locally and on production. You'll want to do this to make sure you don't inadvertently delete data by testing it locally.
  4. Archaic or not, xcopy deployment is still viable, especially with a build tool to automate the process.

I hope that helps a bit.

戈亓 2024-09-18 09:15:02

@Kevin:

看一下 MSDeploy,它是 VS2010 的一部分。我不熟悉它处理数据库更新的方式,但就处理 ASP.Net 网站以及任何与此相关的网站的部署而言,它应该是划算的。

类似的东西的好处是,您可以使用它在新网站上推出,在生产环境中测试它,然后使您的 URL 引用使用新网站,而不是更新实时网站并在最后查找某些内容某处破裂。

@Kevin:

Take a look at MSDeploy, which is part of VS2010. I'm not familiar with its handling database updates, but as far as handling the deployment of ASP.Net websites, and any websites for that matter, it's supposed to be on the money.

What's great with something like that is you can use it to roll out on a fresh website, test it in the production environment, and then make your URL references use the new site, instead of updating the live site and finding at the very end something breaks somewhere.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文