vs.net编辑器在哪里存放了web项目中虚拟路径对应的物理路径?

小谁家老谁 2005-08-12 04:51:47
打开某些asp.net项目时,vs.net编辑器会报告诸如:
无法打开Web项目“xxx”。文件路径“D:\xxx\web”与URL“http://localhost/xxx”不符。这两者需要映射到相同的服务器位置。HTTP错误404:Object Not Fount
这样的错误。
当然,我可以通过把web相关文件copy到D:\xxx\web并在IIS中设置将http://localhost/xxx指向D:\xxx\web的方法来解决这个问题。
但是我不想这样做,我想让VS.net能够识别出http://localhost/xxx真正所对应的物理路径。
问题是:vs.net是如果得到D:\xxx\web这样的物理路径的呢?

望兄弟姐妹们指点迷津
...全文
485 22 打赏 收藏 转发到动态 举报
写回复
用AI写文章
22 条回复
切换为时间正序
请发表友善的回复…
发表回复
小谁家老谁 2005-08-23
  • 打赏
  • 举报
回复
小谁家老谁 2005-08-16
  • 打赏
  • 举报
回复
to 楼上:
花几分钟看一下问题描述再做回答,谢谢!
goody9807 2005-08-16
  • 打赏
  • 举报
回复
http://goody9807.611.cn/announce/announce.asp?BoardID=2&ID=509&upflag=1&num=1
goody9807 2005-08-16
  • 打赏
  • 举报
回复
把xxx项目放入wwwroot下,然后你创建一个与xxx同名的虚拟目录名,指向wwwroot下的项目文件夹
小谁家老谁 2005-08-16
  • 打赏
  • 举报
回复
<Files>
<Include>
<File RelPath="AssemblyInfo.cs"
SubType="Code"
BuildAction="Compile"
/>
<File RelPath="book.aspx"
BuildAction="Content"
/>
<File RelPath="book.aspx.cs"
DependentUpon="book.aspx"
SubType="ASPXCodeBehind"
BuildAction="Compile"
/>
<File RelPath="Cart.cs"
SubType="Code"
BuildAction="Compile"
/>
<File RelPath="categories.aspx"
BuildAction="Content"
/>
<File RelPath="Categories.aspx.cs"
DependentUpon="categories.aspx"
SubType="ASPXCodeBehind"
BuildAction="Compile"
/>
<File RelPath="default.aspx"
BuildAction="Content"
/>
<File RelPath="Default.aspx.cs"
DependentUpon="default.aspx"
SubType="ASPXCodeBehind"
BuildAction="Compile"
/>
<File RelPath="errorpage.aspx"
BuildAction="Content"
/>
<File RelPath="ErrorPage.aspx.cs"
DependentUpon="errorpage.aspx"
SubType="ASPXCodeBehind"
BuildAction="Compile"
/>
<File RelPath="global.asax"
BuildAction="Content"
/>
<File RelPath="ModuleBase.cs"
SubType="ASPXCodeBehind"
BuildAction="Compile"
/>
<File RelPath="PageBase.cs"
SubType="ASPXCodeBehind"
BuildAction="Compile"
/>
<File RelPath="searchresults.aspx"
BuildAction="Content"
/>
<File RelPath="SearchResults.aspx.cs"
DependentUpon="searchresults.aspx"
SubType="ASPXCodeBehind"
BuildAction="Compile"
/>
<File RelPath="shoppingcart.aspx"
BuildAction="Content"
/>
<File RelPath="ShoppingCart.aspx.cs"
DependentUpon="shoppingcart.aspx"
SubType="ASPXCodeBehind"
BuildAction="Compile"
/>
<File RelPath="viewsource.aspx"
BuildAction="Content"
/>
<File RelPath="Web.config"
BuildAction="Content"
/>
<File RelPath="css\duwamish.css"
BuildAction="Content"
/>
<File RelPath="css\ViewSource.css"
BuildAction="Content"
/>
<File RelPath="modules\accountmodule.ascx"
SubType="UserControl"
BuildAction="Content"
/>
<File RelPath="modules\AccountModule.ascx.cs"
DependentUpon="accountmodule.ascx"
SubType="ASPXCodeBehind"
BuildAction="Compile"
/>
<File RelPath="modules\bannermodule.ascx"
SubType="UserControl"
BuildAction="Content"
/>
<File RelPath="modules\BannerModule.ascx.cs"
DependentUpon="bannermodule.ascx"
SubType="ASPXCodeBehind"
BuildAction="Compile"
/>
<File RelPath="modules\categoriesmodule.ascx"
SubType="UserControl"
BuildAction="Content"
/>
<File RelPath="modules\CategoriesModule.ascx.cs"
DependentUpon="categoriesmodule.ascx"
SubType="ASPXCodeBehind"
BuildAction="Compile"
/>
<File RelPath="modules\checkoutmodule.ascx"
SubType="UserControl"
BuildAction="Content"
/>
<File RelPath="modules\CheckoutModule.ascx.cs"
DependentUpon="checkoutmodule.ascx"
SubType="ASPXCodeBehind"
BuildAction="Compile"
/>
<File RelPath="modules\dailypickmodule.ascx"
SubType="UserControl"
BuildAction="Content"
/>
<File RelPath="modules\DailyPickModule.ascx.cs"
DependentUpon="dailypickmodule.ascx"
SubType="ASPXCodeBehind"
BuildAction="Compile"
/>
<File RelPath="modules\searchmodule.ascx"
SubType="UserControl"
BuildAction="Content"
/>
小谁家老谁 2005-08-16
  • 打赏
  • 举报
回复
<VisualStudioProject>
<CSHARP OwnerKey="{FE3BBBB6-72D5-11d2-9ACE-00C04F79A2A4}"
ProjectType="Web"
SchemaVersion="2.0"
ProjectGuid="{4F14FCD8-6330-44DD-81A9-9551121A53EF}"
ProductVersion="7.1.2063">
<Build>
<Settings ApplicationIcon=""
AssemblyKeyContainerName=""
AssemblyName="Duwamish7.Web"
AssemblyOriginatorKeyFile=""
DefaultClientScript="JScript"
DefaultHTMLPageLayout="Flow"
DefaultTargetSchema="IE50"
DelaySign="false"
NoStandardLibraries="false"
OutputType="Library"
RootNamespace="Duwamish7.Web"
StartupObject="">
<Config Name="Debug"
AllowUnsafeBlocks="false"
BaseAddress="0"
CheckForOverflowUnderflow="false"
ConfigurationOverrideFile=""
DefineConstants="DEBUG;TRACE"
DocumentationFile=""
DebugSymbols="true"
FileAlignment="4096"
IncrementalBuild="false"
Optimize="false"
OutputPath="bin\"
RegisterForComInterop="false"
RemoveIntegerChecks="false"
TreatWarningsAsErrors="false"
WarningLevel="4"
/>
<Config Name="Release"
AllowUnsafeBlocks="false"
BaseAddress="0"
CheckForOverflowUnderflow="false"
ConfigurationOverrideFile=""
DefineConstants="TRACE"
DocumentationFile=""
DebugSymbols="false"
FileAlignment="4096"
IncrementalBuild="false"
Optimize="true"
OutputPath="bin\"
RegisterForComInterop="false"
RemoveIntegerChecks="false"
TreatWarningsAsErrors="false"
WarningLevel="4"
/>
</Settings>
<References>
<Reference Name="MSCorLib"
AssemblyName="mscorlib"
/>
<Reference Name="System"
AssemblyName="System"
/>
<Reference Name="System.Data"
AssemblyName="System.Data"
/>
<Reference Name="System.Xml"
AssemblyName="System.Xml"
/>
<Reference Name="System.Web"
AssemblyName="System.Web"
/>
<Reference Name="System.Drawing"
AssemblyName="System.Drawing"
/>
<Reference Name="System.Design"
AssemblyName="System.Design"
/>
<Reference Name="System.Web.Services"
AssemblyName="System.Web.Services"
/>
<Reference Name="BusinessFacade"
Project="{437D3697-DE87-464B-9CBA-01C351069DD1}"
Package="{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
/>
<Reference Name="Common"
Project="{ED509F1F-1E3B-4B58-96F9-A3ECA18E6C1F}"
Package="{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
/>
<Reference Name="SystemFramework"
Project="{035AB251-873E-46A2-A8CD-CB62DFD5B3C7}"
Package="{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
/>
</References>
</Build>
小谁家老谁 2005-08-16
  • 打赏
  • 举报
回复
to
cliff1002(.NET中级菜鸟)
JzeroBiao(先知)
gaofeng2000(高老师)
请看清楚我的问题再做回答好吗,不然会误导我这个菜鸟的。

我新建了一个web项目,但是没有在其.csproj文件文件中找到虚拟目录所对应的实际物理路径信息。
以下是vs.net自带的实例duwamish的web项目中的Web.csproj文件内容,请帮我指出哪里记录了物理路径信息,谢谢大家了。
eyych 2005-08-16
  • 打赏
  • 举报
回复
用记事本修改
*.csproj.webinfo文件中的:


<VisualStudioUNCWeb>
<Web URLPath = "http://localhost/*.csproj" />
</VisualStudioUNCWeb>

bitsbird 2005-08-16
  • 打赏
  • 举报
回复
少写了个webinfo 应该是csproj.webinfo
TCat 2005-08-16
  • 打赏
  • 举报
回复
我一般这样对待一个新拷贝来的项目
1 放在一个目录下,当然这个目录没有那么巧的和原来一样
2 在iis设置虚路径
3 修改webinfo文件“XX.csproj.webinfo”
4 打开工程文件,在把其它的工程文件都添加到这个解决方案中去
5 我就不信这样还不行。
lovefootball 2005-08-16
  • 打赏
  • 举报
回复
你贴得是项目文件
你要看解决方案里面的东西

lovefootball 2005-08-16
  • 打赏
  • 举报
回复
物理路径应该是在iis中指定的

vs中存放的是虚拟路径

他会根据.csproj文件中的虚拟路径到iis中去找对应的物理路径

你这个问题,一般就是把iis中的虚拟目录或者站点对应的物理路径跟.csproj文件中的虚拟路径对应起来就可以了

稍微有点无敌 2005-08-16
  • 打赏
  • 举报
回复
我基本上都是修改.csproj解决方案文件里面的路径,有的项目甚至还带有http://eee:8080,我也是通过修改这个文件的!!!
小谁家老谁 2005-08-16
  • 打赏
  • 举报
回复
极客行天下 2005-08-15
  • 打赏
  • 举报
回复
新建一个项目,然后将原项目的相关文件添加进来。
amendajing 2005-08-15
  • 打赏
  • 举报
回复
修改一下.csproj文件里的内容,保证和你的web共享目录一致就可以了
hackate 2005-08-15
  • 打赏
  • 举报
回复
记得可以用记事本打开.SIN文件,修改其中的URL
bitsbird 2005-08-15
  • 打赏
  • 举报
回复
web应用程序的虚拟目录的位置在.csproj文件里用记事本打开查看
JzeroBiao 2005-08-15
  • 打赏
  • 举报
回复
在IIS里把http://localhost/xxx设置为你那个物理位置!
bitsbird 2005-08-15
  • 打赏
  • 举报
回复
如果是web的话,虚拟目录的位置,以及各项目的路径都在.csproj,.sln文件里,用记事本打开即可看到.
加载更多回复(2)

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧