如何创建从Web站点在Visual Studio 2010解决方案文件(的.sln) [英] How to create a solution file (.sln) from a Web Site in Visual Studio 2010

查看:276
本文介绍了如何创建从Web站点在Visual Studio 2010解决方案文件(的.sln)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我会在这里使用Visual Studio的行话...

I'll be using the Visual Studio jargon here...

我有一个住在一个网站 / Visual Studio 2010中/项目/我的项目/ code /网址

I have a Web Site that lives at /Visual Studio 2010/Projects/My Project/Code/WebSite.

我想创建一个解决方案文件(的.sln)文件,该网站,住在 / Visual Studio 2010中/项目/我的项目/

I'd like to create a solution file (.sln) file for this Web Site that lives at /Visual Studio 2010/Projects/My Project/.

有没有一种简单的方法来从Web站点解决方案文件,并指定要在该目录?还是有,我需要采取其他步骤...

Is there an easy way to create a solution file from a Web Site, and specify the directory for it to be at? Or are there other steps that I need to take...

推荐答案

请注意:以下适用于网站项目,而不是Web应用程序项目。水安全计划是因为它们不具有项目文件Visual Studio项目中的位唯一的,所有的项目设置被存储在溶液文件

Note: the following applies to Web Site Projects, not Web Application Projects. WSPs are a bit unique among Visual Studio projects in that they don't have a project file, and all the project settings are stored in the solution file.

有可能是2的方式来做到这一点:

There's probably 2 ways to do this:


  1. 创建所需的文件夹中的一个新的空的解决方案。然后,只是不加入现有的网站,在你的网站文件夹指向它,你定!您可能需要定制一些设置为你的网站,以配合您以前所。

  2. 如果您已经有一个现有的解决方案文件(你可能做的地方在磁盘上),你可以将它移动到你想要的路径,然后更新相对文件路径到网站。该解决方案文件的内容会是这个样子的网站项目:

  1. Create a new empty solution in the folder you want. Then just do Add Existing Website, point it at your web site folder, and you're set! You may need to customize some settings for your web site to match what you had before.
  2. If you already have an existing solution file (which you probably do somewhere on disk), you can move it to the path you want, then update the relative file paths to the web site. The contents of the solution file will look something like this for a web site project:

Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "WebSite1", "..\..\WebSites\WebSite1\", "{AB75CF01-6B54-4BB1-A14A-01A26727FEF2}"
    ProjectSection(WebsiteProperties) = preProject
        TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0"
        Debug.AspNetCompiler.VirtualPath = "/WebSite1"
        Debug.AspNetCompiler.PhysicalPath = "..\..\WebSites\WebSite1\"
        Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\WebSite1\"
        ... snip ...
        Release.AspNetCompiler.VirtualPath = "/WebSite1"
        Release.AspNetCompiler.PhysicalPath = "..\..\WebSites\WebSite1\"
        Release.AspNetCompiler.TargetPath = "PrecompiledWeb\WebSite1\"
        ... snip ...
        VWDPort = "47656"
        DefaultWebSiteLanguage = "Visual C#"
    EndProjectSection
EndProject

您可以看到到该网站实际上所在的文件夹中的相对路径。

You can see the relative paths to the folder where the web site actually resides.

这篇关于如何创建从Web站点在Visual Studio 2010解决方案文件(的.sln)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆