Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:\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

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

like image 682
sudhAnsu63 Avatar asked Nov 16 '12 13:11

sudhAnsu63


1 Answers

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:\Users\avkashc\Documents\Visual Studio 2012\Projects\WindowsAzure2012\WindowsAzure2012\bin\Release\MvcWebRole1' for virtual path Web/MyWeb/.

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/.

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/.

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

like image 60
AvkashChauhan Avatar answered Oct 26 '22 07:10

AvkashChauhan