如何更改网站项目目录参考 [英] How to change website project directory reference

查看:66
本文介绍了如何更改网站项目目录参考的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个ASP.NET网站.

我正在尝试整合网站及其所有子项目.其中一些项目是在文件系统上的不同位置创建的,因为要么我在一个位置上创建了项目而没有引起注意,要么后来决定重构/重命名.

我正在尝试将所有这些项目放到一个全新的目录中.然后,我想压缩目录并将其提供给客户端.我希望客户端能够将项目解压缩到他们选择的任何目录/子目录中.

到目前为止,这似乎对所有类库都适用.但是,即使我将网站复制到了新位置,仍直接从旧位置打开了直接属于主网站的文件.

如何使Visual Studio从新位置打开网站文件?我用记事本打开了网站sln文件,并找到了网站的以下路径:

".. \ .. \ .. \ .. \ .. \ .. \ PROJECTS \ MyWebSite \"

因此,这似乎是一条相对路径,但我不确定它相对于什么.如果我知道这条路应该是相对的,那么我可能会改变它.

因此,如果我希望从"C:\ MyClientDirectory \ MyWebsite \"打开网站,那么我应该更新sln文件中的路径吗?另外,是否有UI可以将网站的sln进行此更改,还是只应在记事本中进行此更改?

I have created an ASP.NET website.

I''m trying to consolidate the website and all of it''s child projects. Some of these projects have been created in different locations on my filesystem because either I created it in a location without paying attention or I decided to refactor/rename later on.

I''m trying to put all of these projects into a brand new directory. Then I want to zip up the directory and give it to the client. I''d like the client to be able to unzip the projects into any directory/subdirectory of their choice.

So far this seems to work well for all of the class libraries. However, the files belonging directly to the main website are still getting opened from the old location even though I copied the website to a new location.

What can I do to make Visual Studio open up the website files from the new location? I opened up the website sln file with notepad and found the following path for the website:

"..\..\..\..\..\..\PROJECTS\MyWebSite\"

So this appears to be a relative path but I''m not sure what it''s relative to. If I knew what this path was supposed to be relative to then I could probably change it.

So if I want the website to open from "C:\MyClientDirectory\MyWebsite\" then what should I update the path to in the sln file? Also, is there a UI to make this change to the sln for the website or am I just supposed to make this change in notepad?

推荐答案

您好,

我认为您看到的路径是相对于.sln文件的

但是,您可以直接在VS中打开该网站,文件> open>网站

仅指定网站文件夹上的信息
Hi,

I think the path you ar seeing is relative to the .sln file ,

howerver you can open the web site directly in VS, file>open>website

on specifying only the web site folder


这可能会有所帮助:

解析多文件夹网站中的路径 [ ^ ]
This might help:

Resolving Paths in a Multi-Folder WebSite[^]


这篇关于如何更改网站项目目录参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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