Subversion并使用IIS进行ASP.NET开发

时间:2022-09-10 03:35:06

I'm a total newbie to SVN and haven't been able to find an answer for the following situation.

我是SVN的新手,并且无法找到以下情况的答案。

I have an ASP .NET 2.0 web app that I am developing. I am using my local IIS as the development web server (i.e. not the Visual Studio web development server). My development environment is VS2005, Vista, IIS7, TortoiseSVN / AnkhSVN. VisualSVN is installed on the server.

我正在开发一个ASP .NET 2.0 Web应用程序。我使用我的本地IIS作为开发Web服务器(即不是Visual Studio Web开发服务器)。我的开发环境是VS2005,Vista,IIS7,TortoiseSVN / AnkhSVN。 VisualSVN安装在服务器上。

My .sln files and class libraries, etc. are located in the **C:\Localsource\Projects\ProjectName** folder, and my .aspx files are in my **C:\inetpub\wwwroot\ProjectName** folder.

我的.sln文件和类库等位于** C:\ Localsource \ Projects \ ProjectName **文件夹中,我的.aspx文件位于我的** C:\ inetpub \ wwwroot \ ProjectName **文件夹中。

I can set up the repository for **C:\Localsource\Projects\ProjectName** fine, but can't think of a way to set it up for the IIS folder as well in the same repository.

我可以设置** C:\ Localsource \ Projects \ ProjectName **的存储库,但是想不出在同一个存储库中为IIS文件夹设置它的方法。

What's the best way for dealing with this development environment in SVN?

在SVN中处理这种开发环境的最佳方法是什么?

Many thanks,

Ant

7 个解决方案

#1


4  

In a solution in Visual Studio you can have a class library project which is usually in a directory underneath the .sln file.

在Visual Studio的解决方案中,您可以拥有一个类库项目,该项目通常位于.sln文件下的目录中。

In this case he also has a web project within the solution but NOT underneath the .sln file in the file directory structure.

在这种情况下,他还在解决方案中有一个Web项目,但不在文件目录结构中的.sln文件下面。

He will be attaching to this project via HTTP not via local file path.

他将通过HTTP而不是通过本地文件路径附加到此项目。

IIS will manage this as http://localhost/webapp and by default will place it in c:\inetpub\wwwroot\webapp. The files in webapp folder will not be in the repo as they arent in the hierachy of the solution and the class library. This is his question how to sort it out.

IIS将以http:// localhost / webapp进行管理,默认情况下将其放在c:\ inetpub \ wwwroot \ webapp中。 webapp文件夹中的文件不在repo中,因为它们不在解决方案和类库的层次结构中。这是他的问题如何解决。

My answer is to move http://localhost/webapp to point to a folder that is underneath the .sln file and adjacent to the class library directory then it can all go in the repo.

我的答案是将http:// localhost / webapp移动到指向.sln文件下面并且与类库目录相邻的文件夹,然后它们都可以进入仓库。

Seperating the class library and the the webapp is best practice to aide code re-use and decoupling the logic from the web site.

分离类库和webapp是帮助重用代码并将逻辑与网站分离的最佳实践。

#2


2  

Can you not just point IIS to C:\Localsource\Projects\ProjectName and set the permissions?

你能不能只将IIS指向C:\ Localsource \ Projects \ ProjectName并设置权限?

#3


0  

Hmmm - Good point. It was set up like this when I got here, and Visual Studio always creates websites in the wwwroot folder, so I assumed wwwroot was just where they had to go.

嗯 - 好点。当我到这里时它就像这样设置了,Visual Studio总是在wwwroot文件夹中创建网站,所以我认为wwwroot就是他们必须去的地方。

Maybe I'll have to think about doing a little rearranging...

也许我不得不考虑做一些重新整理......

Thanks!

#4


0  

The IIS folder is not the output of the code base it is part of the application. It's not CGI output or anything but actually the scripts to run the app!

IIS文件夹不是代码库的输出,它是应用程序的一部分。它不是CGI输出或其他任何东西,但实际上是运行应用程序的脚本!

This is the .aspx pages that will have user controls and HTML to actually run the application. Its part of the applciation but split away from VS Studio solution.

这是.aspx页面,它们将具有用户控件和HTML来实际运行应用程序。它是应用程序的一部分,但与VS Studio解决方案分开。

The easiest way is to have a solution and then C:\Localsource\Projects\ProjectName\WEBSITE.

最简单的方法是获得一个解决方案,然后是C:\ Localsource \ Projects \ ProjectName \ WEBSITE。

Point IIS at that folder as well.

也将IIS指向该文件夹。

#5


0  

OK, I may be being stupid here but.. Why do you need to add the IIS folder (i.e. the output of the code base) to your repository?

好吧,我可能在这里很傻但是..为什么你需要将IIS文件夹(即代码库的输出)添加到你的存储库?

Update

I think I should clarify this a bit more.. What I mean to say is I am not sure why the ASPX is seperate from the project anyway? What is wrong with an Web Project and n Class Library Projects in a Solution, added to your repository.. You then publish on each new release..

我想我应该多说一点。我的意思是说我不确定为什么ASPX与项目分开? Web项目和解决方案中的n类库项目有什么问题,添加到存储库中。然后在每个新版本上发布..

If it is simply a case of "it might be easier to roll back the published output" then so be it, I was just curious as I have not seen many people actually work that way.

如果它只是“可能更容易回滚已发布的输出”那么就是这样,我只是好奇,因为我没有看到很多人实际上以这种方式工作。

Deployment of solutions in this structure would be a lot easier as well..

在这种结构中部署解决方案也会容易得多。

#6


0  

I think you might want to separate this into two problems, following this recommendation from Dillorscroft.

根据Dillorscroft的建议,我想你可能想把它分成两个问题。

First, with regard to the material on your development server that is published to the production site, I think you need version control for that. First so you can roll back any page, and you can also decide when you have a stable level of the development site that you want to extract to production. (I would get that from the source control system into a site image and then synchronize that image with the production site.)

首先,关于发布到生产站点的开发服务器上的材料,我认为您需要对其进行版本控制。首先,您可以回滚任何页面,还可以决定何时拥有要提取到生产的开发站点的稳定级别。 (我会从源代码管理系统将其转换为站点映像,然后将该映像与生产站点同步。)

So, for the first part, we are talking about versioning the web pages and all of the custom server-side material that supports the web site.

因此,对于第一部分,我们讨论的是对网页进行版本控制以及支持该网站的所有自定义服务器端材料。

Secondly, With regard to the development of components that are used on the site, they need their own development projects, since it is the result that goes to the development site, not all of the source, libraries, etc. that the component is built with. So these will have their own project development tree (think of it as if you were building a library that is to be used by other development projects, although in this case the other projects are web pages). So the only thing that should show up in IIS is the "deployed" component to the development site.

其次,关于站点上使用的组件的开发,他们需要自己的开发项目,因为它是开发站点的结果,而不是所有源,库等构建组件用。因此,这些将拥有自己的项目开发树(将其视为您正在构建一个供其他开发项目使用的库,尽管在这种情况下其他项目是网页)。因此,唯一应该在IIS中显示的是开发站点的“已部署”组件。

There seem to be three critical questions for you:

您似乎有三个关键问题:

  1. How development of tests that need to go against the web site is handled and where that is version controlled (assuming they do not belong on the web site itself)

    如何处理需要针对网站的测试的开发以及版本控制的位置(假设它们不属于网站本身)

  2. How easily you can arrange to make sure that all content on the development web site is kept under version control and checked-in and -out appropriately. (This has to do with the tools you use to edit web pages and other server-side gunk other than components developed off to the side.)

    您可以轻松地安排确保开发网站上的所有内容都保持在版本控制下,并且适当地签入和签出。 (这与您用来编辑网页的工具和除了侧面开发的组件之外的其他服务器端gunk有关。)

  3. Easily taking developed components from the projects that produce them to the development site and have them be checked-in there.

    轻松地将开发的组件从生成它们的项目中提取到开发站点并在那里签入。

My solution to (2) and to version control of the development web site is to use Visual Source Safe integration with IIS and FrontPage extensions that places the site under version control. Components produced from other development projects are mapped to the server project by VSS sharing.

我对(2)的解决方案和开发网站的版本控制是使用Visual Source Safe与IIS和FrontPage扩展集成,将网站置于版本控制之下。从其他开发项目生成的组件通过VSS共享映射到服务器项目。

For SVN, I speculate that (1) you want to see if there is an SVN adapter that IIS will recognize as an external source-control system and, either way, (2) have a discipline that takes delivery of components from their construction projects into the overall web site project.

对于SVN,我推测(1)你想看看是否有一个SVN适配器,IIS将其识别为外部源控制系统,无论哪种方式,(2)都有一个规程,从他们的建设项目中交付组件进入整个网站项目。

#7


0  

Rob,

Why do you consider an .aspx file an output of the code base?

为什么将.aspx文件视为代码库的输出?

It is part of the code base. It's not an output after compilation for instance.

它是代码库的一部分。例如,它不是编译后的输出。

Just wondered?

#1


4  

In a solution in Visual Studio you can have a class library project which is usually in a directory underneath the .sln file.

在Visual Studio的解决方案中,您可以拥有一个类库项目,该项目通常位于.sln文件下的目录中。

In this case he also has a web project within the solution but NOT underneath the .sln file in the file directory structure.

在这种情况下,他还在解决方案中有一个Web项目,但不在文件目录结构中的.sln文件下面。

He will be attaching to this project via HTTP not via local file path.

他将通过HTTP而不是通过本地文件路径附加到此项目。

IIS will manage this as http://localhost/webapp and by default will place it in c:\inetpub\wwwroot\webapp. The files in webapp folder will not be in the repo as they arent in the hierachy of the solution and the class library. This is his question how to sort it out.

IIS将以http:// localhost / webapp进行管理,默认情况下将其放在c:\ inetpub \ wwwroot \ webapp中。 webapp文件夹中的文件不在repo中,因为它们不在解决方案和类库的层次结构中。这是他的问题如何解决。

My answer is to move http://localhost/webapp to point to a folder that is underneath the .sln file and adjacent to the class library directory then it can all go in the repo.

我的答案是将http:// localhost / webapp移动到指向.sln文件下面并且与类库目录相邻的文件夹,然后它们都可以进入仓库。

Seperating the class library and the the webapp is best practice to aide code re-use and decoupling the logic from the web site.

分离类库和webapp是帮助重用代码并将逻辑与网站分离的最佳实践。

#2


2  

Can you not just point IIS to C:\Localsource\Projects\ProjectName and set the permissions?

你能不能只将IIS指向C:\ Localsource \ Projects \ ProjectName并设置权限?

#3


0  

Hmmm - Good point. It was set up like this when I got here, and Visual Studio always creates websites in the wwwroot folder, so I assumed wwwroot was just where they had to go.

嗯 - 好点。当我到这里时它就像这样设置了,Visual Studio总是在wwwroot文件夹中创建网站,所以我认为wwwroot就是他们必须去的地方。

Maybe I'll have to think about doing a little rearranging...

也许我不得不考虑做一些重新整理......

Thanks!

#4


0  

The IIS folder is not the output of the code base it is part of the application. It's not CGI output or anything but actually the scripts to run the app!

IIS文件夹不是代码库的输出,它是应用程序的一部分。它不是CGI输出或其他任何东西,但实际上是运行应用程序的脚本!

This is the .aspx pages that will have user controls and HTML to actually run the application. Its part of the applciation but split away from VS Studio solution.

这是.aspx页面,它们将具有用户控件和HTML来实际运行应用程序。它是应用程序的一部分,但与VS Studio解决方案分开。

The easiest way is to have a solution and then C:\Localsource\Projects\ProjectName\WEBSITE.

最简单的方法是获得一个解决方案,然后是C:\ Localsource \ Projects \ ProjectName \ WEBSITE。

Point IIS at that folder as well.

也将IIS指向该文件夹。

#5


0  

OK, I may be being stupid here but.. Why do you need to add the IIS folder (i.e. the output of the code base) to your repository?

好吧,我可能在这里很傻但是..为什么你需要将IIS文件夹(即代码库的输出)添加到你的存储库?

Update

I think I should clarify this a bit more.. What I mean to say is I am not sure why the ASPX is seperate from the project anyway? What is wrong with an Web Project and n Class Library Projects in a Solution, added to your repository.. You then publish on each new release..

我想我应该多说一点。我的意思是说我不确定为什么ASPX与项目分开? Web项目和解决方案中的n类库项目有什么问题,添加到存储库中。然后在每个新版本上发布..

If it is simply a case of "it might be easier to roll back the published output" then so be it, I was just curious as I have not seen many people actually work that way.

如果它只是“可能更容易回滚已发布的输出”那么就是这样,我只是好奇,因为我没有看到很多人实际上以这种方式工作。

Deployment of solutions in this structure would be a lot easier as well..

在这种结构中部署解决方案也会容易得多。

#6


0  

I think you might want to separate this into two problems, following this recommendation from Dillorscroft.

根据Dillorscroft的建议,我想你可能想把它分成两个问题。

First, with regard to the material on your development server that is published to the production site, I think you need version control for that. First so you can roll back any page, and you can also decide when you have a stable level of the development site that you want to extract to production. (I would get that from the source control system into a site image and then synchronize that image with the production site.)

首先,关于发布到生产站点的开发服务器上的材料,我认为您需要对其进行版本控制。首先,您可以回滚任何页面,还可以决定何时拥有要提取到生产的开发站点的稳定级别。 (我会从源代码管理系统将其转换为站点映像,然后将该映像与生产站点同步。)

So, for the first part, we are talking about versioning the web pages and all of the custom server-side material that supports the web site.

因此,对于第一部分,我们讨论的是对网页进行版本控制以及支持该网站的所有自定义服务器端材料。

Secondly, With regard to the development of components that are used on the site, they need their own development projects, since it is the result that goes to the development site, not all of the source, libraries, etc. that the component is built with. So these will have their own project development tree (think of it as if you were building a library that is to be used by other development projects, although in this case the other projects are web pages). So the only thing that should show up in IIS is the "deployed" component to the development site.

其次,关于站点上使用的组件的开发,他们需要自己的开发项目,因为它是开发站点的结果,而不是所有源,库等构建组件用。因此,这些将拥有自己的项目开发树(将其视为您正在构建一个供其他开发项目使用的库,尽管在这种情况下其他项目是网页)。因此,唯一应该在IIS中显示的是开发站点的“已部署”组件。

There seem to be three critical questions for you:

您似乎有三个关键问题:

  1. How development of tests that need to go against the web site is handled and where that is version controlled (assuming they do not belong on the web site itself)

    如何处理需要针对网站的测试的开发以及版本控制的位置(假设它们不属于网站本身)

  2. How easily you can arrange to make sure that all content on the development web site is kept under version control and checked-in and -out appropriately. (This has to do with the tools you use to edit web pages and other server-side gunk other than components developed off to the side.)

    您可以轻松地安排确保开发网站上的所有内容都保持在版本控制下,并且适当地签入和签出。 (这与您用来编辑网页的工具和除了侧面开发的组件之外的其他服务器端gunk有关。)

  3. Easily taking developed components from the projects that produce them to the development site and have them be checked-in there.

    轻松地将开发的组件从生成它们的项目中提取到开发站点并在那里签入。

My solution to (2) and to version control of the development web site is to use Visual Source Safe integration with IIS and FrontPage extensions that places the site under version control. Components produced from other development projects are mapped to the server project by VSS sharing.

我对(2)的解决方案和开发网站的版本控制是使用Visual Source Safe与IIS和FrontPage扩展集成,将网站置于版本控制之下。从其他开发项目生成的组件通过VSS共享映射到服务器项目。

For SVN, I speculate that (1) you want to see if there is an SVN adapter that IIS will recognize as an external source-control system and, either way, (2) have a discipline that takes delivery of components from their construction projects into the overall web site project.

对于SVN,我推测(1)你想看看是否有一个SVN适配器,IIS将其识别为外部源控制系统,无论哪种方式,(2)都有一个规程,从他们的建设项目中交付组件进入整个网站项目。

#7


0  

Rob,

Why do you consider an .aspx file an output of the code base?

为什么将.aspx文件视为代码库的输出?

It is part of the code base. It's not an output after compilation for instance.

它是代码库的一部分。例如,它不是编译后的输出。

Just wondered?