无法找到虚拟路径的物理目录,在Windows Azure项目SDK 1.8 [英] Cannot find the physical directory for virtual path, in Windows Azure project SDK 1.8

查看:333
本文介绍了无法找到虚拟路径的物理目录,在Windows Azure项目SDK 1.8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经升级Windows Azure的SDK从V1.7到V1.8

I have upgraded windows Azure SDK from V1.7 to V1.8

在我的配置的升级换代部分是

Before Upgradation part of my config was

<Site name="Web">
    <VirtualApplication name="MyprojectService"        physicalDirectory="../../Myproject.Hosts.WebHost" />
</Site>

SDK的升级换代后

After Upgradation of SDK

我收到以下错误。

错误1找不到合适的物理目录   'D:\Projects\Myproject\branches\Release_092012\Hosts\Myproject.Hosts.AzureHost\MyprojectAzureHost\Myproject.Hosts.WebHost'   虚拟路径   网络/ MyprojectService /。 D:\Projects\Myproject\branches\Release_092012\Hosts\Myproject.Hosts.AzureHost\MyprojectAzureHost\bin\Release\ServiceDefinition.csdef 1 MyprojectAzureHost

Error 1 Cannot find the physical directory 'D:\Projects\Myproject\branches\Release_092012\Hosts\Myproject.Hosts.AzureHost\MyprojectAzureHost\Myproject.Hosts.WebHost' for virtual path Web/MyprojectService/. D:\Projects\Myproject\branches\Release_092012\Hosts\Myproject.Hosts.AzureHost\MyprojectAzureHost\bin\Release\ServiceDefinition.csdef 1 1 MyprojectAzureHost

我已经通过链接<一个走了href="http://stackoverflow.com/questions/13365254/did-azure-1-8-oct-2012-change-the-way-you-configure-multiple-sites-in-the-serv">Azure Service.Csdef 。 我追加../"to路径:

i have gone through the link Azure Service.Csdef. and I appended "../"to the path:

<Site name="Web">
    <VirtualApplication name="MyprojectService"        physicalDirectory="../../../Myproject.Hosts.WebHost" />
</Site>

但是当我做一个包是越来越自动删除,我一次又一次地得到上述错误。

but when i make a package it is getting removed automatically and i am getting the above error again and again.

我也试过把完整路径。D:/项目/../ Myproject.Hosts.WebHost但没有锁

I have also tried putting the Complete path "D:/Projects/../Myproject.Hosts.WebHost" but no lock.

这是完美的工作SDK 1.7。但不工作的SDK 1.8

It was perfectly working in SDK 1.7. but not working in SDK 1.8

推荐答案

我会尝试(使用相同的示例应用程序)来解释的变化有两种最新的Windows Azure的SDK之间如下,请看看每个案件和在错误信息中显示的路径:

I will try to explain the changes in between two latest Windows Azure SDK (by using same sample app) as below so please have a look at each case and the path shown in the error message:

在previous SDK的虚拟目录源设置但是现在最新的SDK的虚拟目录源设置为项目输出目录,你可以在下面的案例#1看到默认的项目的根。

In previous SDK the virtual directory source was set to default at the root of the project however now in latest SDK the virtual directory source is set at project output directory which you can see in Case #1 below.

案例1:(失败)

<VirtualApplication name="MyWeb" physicalDirectory="MvcWebRole1">

Error: Cannot find the physical directory 
    'C:\Users\avkashc\Documents\Visual Studio 2012\Projects\WindowsAzure2012\WindowsAzure2012\bin\Release\MvcWebRole1' for virtual path Web/MyWeb/.

第2种情况:(失败)

Case 2: (Failed)

 <VirtualApplication name="MyWeb"  physicalDirectory="..\MvcWebRole1">

 Error: Cannot find the physical directory 'C:\Users\avkashc\Documents\Visual Studio 2012\Projects\WindowsAzure2012\WindowsAzure2012\bin\MvcWebRole1' for virtual path Web/MyWeb/.

案例3:(失败)

Case 3: (Failed)

 <VirtualApplication name="MyWeb"  physicalDirectory="..\..\MvcWebRole1">

 Error: Cannot find the physical directory 'C:\Users\avkashc\Documents\Visual Studio 2012\Projects\WindowsAzure2012\WindowsAzure2012\MvcWebRole1' for virtual path Web/MyWeb/.

案例4:(成功)

Case 4: (Success)

 <VirtualApplication name="MyWeb"
                     physicalDirectory="..\..\..\MvcWebRole1">

由于上述情况#4文件夹设置不匹配我的实际MvcWebRole1的文件夹结构(如下所示),在这就是为什么...... \设置确实在我的PhysicalDirectory制定工作。

Because above case #4 folder setting does match with my actual MvcWebRole1 folder structure (seen below) at thats why "......\" setting does work in my "PhysicalDirectory" setting.

您需要遍历文件夹结构,从释放*作为源,然后再跟踪所有的地方以往任何时候都存在,然后组装的完整路径的方式。

You would need to walk through your folder structure from release* as your source and then back track all the way where ever it exist and then assemble the full path.

这篇关于无法找到虚拟路径的物理目录,在Windows Azure项目SDK 1.8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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