Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
485 views
in Technique[技术] by (71.8m points)

asp.net - Cannot find the physical directory for virtual path, in Windows Azure project SDK 1.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>

After Upgradation of SDK

I am getting following Error.

Error 1 Cannot find the physical directory 'D:ProjectsMyprojectranchesRelease_092012HostsMyproject.Hosts.AzureHostMyprojectAzureHostMyproject.Hosts.WebHost' for virtual path Web/MyprojectService/. D:ProjectsMyprojectranchesRelease_092012HostsMyproject.Hosts.AzureHostMyprojectAzureHostinReleaseServiceDefinition.csdef 1 1 MyprojectAzureHost

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.

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

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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:

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.

Case 1: (Failed)

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

Error: Cannot find the physical directory 
    'C:UsersavkashcDocumentsVisual Studio 2012ProjectsWindowsAzure2012WindowsAzure2012inReleaseMvcWebRole1' for virtual path Web/MyWeb/.

Case 2: (Failed)

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

 Error: Cannot find the physical directory 'C:UsersavkashcDocumentsVisual Studio 2012ProjectsWindowsAzure2012WindowsAzure2012inMvcWebRole1' for virtual path Web/MyWeb/.

Case 3: (Failed)

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

 Error: Cannot find the physical directory 'C:UsersavkashcDocumentsVisual Studio 2012ProjectsWindowsAzure2012WindowsAzure2012MvcWebRole1' for virtual path Web/MyWeb/.

Case 4: (Success)

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

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.

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...