locked
Problems creating new Azure project in Visual Studio 2010 RRS feed

  • Question

  • Hi,

    I have some difficulties when trying to create new Azure project with web role. First of all for some reason, Azure dll's are not referenced on startup and these messages appear when trying to build project:

    ------ Build started: Project: MvcWebRole1, Configuration: Debug Any CPU ------

    d:\NET\Projects\WindowsAzureProject9\MvcWebRole1\WebRole.cs(4,17): error CS0234: The type or namespace name 'WindowsAzure' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

    d:\NET\Projects\WindowsAzureProject9\MvcWebRole1\WebRole.cs(5,17): error CS0234: The type or namespace name 'WindowsAzure' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

    d:\NET\Projects\WindowsAzureProject9\MvcWebRole1\WebRole.cs(6,17): error CS0234: The type or namespace name 'WindowsAzure' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

    d:\NET\Projects\WindowsAzureProject9\MvcWebRole1\WebRole.cs(10,28): error CS0246: The type or namespace name 'RoleEntryPoint' could not be found (are you missing a using directive or an assembly reference?)

     

    Compile complete -- 4 errors, 0 warnings

    ------ Build started: Project: WindowsAzureProject9, Configuration: Debug Any CPU ------

    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Windows Azure Tools\1.6\Microsoft.WindowsAzure.targets(1029,5): error : WAT070 : The referenced assembly d:\NET\Projects\WindowsAzureProject9\MvcWebRole1\bin\MvcWebRole1.dll was not found. Please make sure to build the role project that produces this assembly before building this Windows Azure Project.

    Done building project "WindowsAzureProject9.ccproj" -- FAILED.

     

    Build FAILED.

    ------ Build started: Project: MvcWebRole1.Tests, Configuration: Debug Any CPU ------

    error CS0006: Metadata file 'd:\NET\Projects\WindowsAzureProject9\MvcWebRole1\bin\MvcWebRole1.dll' could not be found

     

    Compile complete -- 1 errors, 0 warnings

    ========== Build: 0 succeeded, 3 failed, 0 up-to-date, 0 skipped ==========

     

    I can fix those by adding references from Azure SDK folder but when I try to run my project I get another error:

    "Failed to debug the Windows Azure project. The output directory 'd:\NET\Projects\WindowsAzureProject9\WindowsAzureProject9\cxs\Debug' does not exist."

    There has to be something wrong with my environment but I just can't figure it out. I've tried re-installing whole Azure SDK 1.6 but same problems still exist.

     

     

     

    Monday, January 16, 2012 11:11 AM

All replies

  • Hi,

    Accoriding to your description, this issues is occurred with Azure output folder, the Runtime could not generate cxs folder by default. As your Azure dlls and MVC dll cound not be found at beginning, you try to add them from SDK folder manually, right? For this issue, i suggest you to check your target framework is 4.0. If it not works, please check .target files is can works, try to delete project files and re-add Azure MVC web roles.

    Hope it can help you.


    Please mark the replies as answers if they help or unmark if not. If you have any feedback about my replies, please contact msdnmg@microsoft.com Microsoft One Code Framework
    Tuesday, January 17, 2012 7:29 AM
  • Hi,

    Thanks for your reply. Yes, I did add Azure dlls manually from Azure SDK/ref folder. I have tried creating Azure project several times each with framework 4.0. Could you specify which .target files you mean?

    Tuesday, January 17, 2012 8:08 AM
  • Hi,

    I guess the Target framework is ".NET Framework 4 Client profile" in Project->Properties->Application tab of your Visual Studio project. Change it to ".NET Framework 4" and the Azure sdk dlls should become visible to your project, though you will still need to browse and add reference to them.

    -regards,

    Gaurav

     

    Tuesday, January 17, 2012 12:02 PM
  • Hi,

    No, target framework is .NET Framework 4.0. I guess those assemblies should be referenced automatically regardless of which target is used?

    Tuesday, January 17, 2012 12:33 PM
  • This is really starting to bug me, I even tried re-installing Visual Studio, VS SP1 and Azure tools but still keep getting same problems. Do all of you have to reference those assemblies manually when creating Azure project? 

    By the way, if I select on Azure project - publish - Create service package only and try running project after that, the error I get is bit different. First of all publishing shows this message:

    MvcWebRole1(0,0): warning WAT170: The configuration setting 'Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString' is set up to use the local storage emulator for role 'MvcWebRole1' in configuration file 'ServiceConfiguration.Cloud.cscfg'. To access Windows Azure storage services, you must provide a valid Windows Azure storage connection string.

    Transformed Web.config using Web.Debug.config into obj\Debug\TransformWebConfig\transformed\Web.config.

    And after I run project I get this:

    "Failed to debug the Windows Azure project. The service configuration file 'd:\NET\Projects\WindowsAzureProject1\WindowsAzureProject1\bin\debug\ServiceConfiguration.Cloud.cscfg' does not exist."

     

    Tuesday, January 17, 2012 12:44 PM
  • I mean you can delete the project files of Azure projects and re-load your azure roles with a new Azure project.

    And i also want to know, does your VS and Azure SDK is installed success?

    Hope it can help you. 


    Please mark the replies as answers if they help or unmark if not. If you have any feedback about my replies, please contact msdnmg@microsoft.com Microsoft One Code Framework
    Tuesday, January 17, 2012 1:56 PM
  • Hi,

    Deleting project files and reloading does not seem to help. Both VS and Azure SDK installations succeeded. I tried installing Azure SDK on another machine and everything works like a charm there. Assemblies are referenced and I can run project without any problems. By the way, another thing I noticed was that I if I check properties from my web role, there is no "Service configuration" -selection at all?

    Tuesday, January 17, 2012 2:00 PM
  • Hi,

    Do you means you cannot run any azure application in this machine but everything is fine in another machine?

    I suggest you check your soft environment or you can consider to re-install Azure SDK and Visual Studio.

     

    Wednesday, January 18, 2012 2:40 AM