I’m trying to configure my Solution to publish multiple web sites to Azure using the 1.3 SDK and I want them to run under one Web Role. I’ve added the entry to the Sites element as per the CHM file and when I deploy to Azure the Instance starts up. Now for the symptoms:
- Browsing to the “Primary” (first site added to the solution) everything works fine.
- Browsing to the “Secondary” site throws the following error:
Exception type: ConfigurationErrorsException
Exception message: Could not load file or assembly ‘System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified. (E:\approot_WASR_\1\web.config line 28)
What have I tried so far without success (sigh):
1. I noticed that by default VStudio (2010 Ultimate) did not include the “Secondary” project output in the cspkg file. Setting a project dependency seems to have fixed that problem (or at least I now see it in the output window during the build process).
2. I’ve set “Copy Local=true” for the System.Web.Mvc on the “Secondary” project still nothing.
3. I have a CName setup for the “Secondary” project and use the hostHeader parameter on the Binding element so I haven’t found a good way of testing this local so I’m limited in diagnostic info.
One thought that I had was that both projects now contain a WebRole.cs file, should that be the case in this configuration? As both of those handle startup events could that be the issue?
I’m not really sure what may be helpful to provide in this scenario so will be happy to fill in the blanks if someone could please direct me a bit. Am I doing this all wrong?
Thanks in advance!
One thing you’ll want to make sure is that the second website is built before packaging. It sounds like setting the project dependency probably took care of that.
You can test locally by adding an entry to your hosts file (edit %windir%\system32\drivers\etc\hosts as admin, and add “127.0.0.1 http://www.mysite.com” at the bottom). This might help you get to the bottom of it.
After you run locally, you should be able to find the .csx directory and check what’s in there… make sure the second site (under “_wasr_\1”, I believe) looks like you expect it to.
Oh, the second webrole.cs is probably not an issue. (It should be safely ignored.)