영업: 1-800-867-1380

 none
Getting Azure Solution To Build on Build Server

    질문

  • Is there anyway to get the Azure dlls and components need to build an Azure solution onto my build server without out installing everything?  I am using Cruise Control as the build server and kick off the build using msbuild.  I don't want to install SQL Server or Visual Studio onto this system.  It just needs to very that the solution builds and run some unit test that are not dependent on the Azure features.

    I get the below errors when it does try to build.

    C:\CI\MyProjects\content\MyProjects\MyProjects.ccproj(57,11): error MSB4019: The imported project "C:\Program Files\MSBuild\Microsoft\Cloud Service\v1.0\Microsoft.CloudService.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

    C:\CI\MyProjects\content\MyProjects\MyProjects.ccproj(57,11): error MSB4019: The imported project "C:\Program Files\MSBuild\Microsoft\Cloud Service\v1.0\Microsoft.CloudService.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

    WorkerRole.cs(8,17): error CS0234: The type or namespace name 'WindowsAzure' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

    WorkerRole.cs(9,17): error CS0234: The type or namespace name 'WindowsAzure' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

    WorkerRole.cs(13,31): error CS0246: The type or namespace name 'RoleEntryPoint' could not be found (are you missing a using directive or an assembly reference?)

    WorkerRole.cs(41,61): error CS0246: The type or namespace name 'RoleEnvironmentChangingEventArgs' could not be found (are you missing a using directive or an assembly reference?)

    C:\CI\MyProjects\content\MyProjects\MyProjects.ccproj(57,11): error MSB4019: The imported project "C:\Program Files\MSBuild\Microsoft\Cloud Service\v1.0\Microsoft.CloudService.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

    C:\CI\MyProjects\content\MyProjects\MyProjects.ccproj(57,11): error MSB4019: The imported project "C:\Program Files\MSBuild\Microsoft\Cloud Service\v1.0\Microsoft.CloudService.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

    WorkerRole.cs(8,17): error CS0234: The type or namespace name 'WindowsAzure' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

    WorkerRole.cs(9,17): error CS0234: The type or namespace name 'WindowsAzure' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

    WorkerRole.cs(13,31): error CS0246: The type or namespace name 'RoleEntryPoint' could not be found (are you missing a using directive or an assembly reference?)

    WorkerRole.cs(41,61): error CS0246: The type or namespace name 'RoleEnvironmentChangingEventArgs' could not be found (are you missing a using directive or an assembly reference?)

    Failed to start MSBuild.

    2010년 1월 5일 화요일 오전 1:11

답변

  • Hello, if you have a look at the ccproj file in a text editor, you will see it depends on Microsoft.CloudService.targets. It also relies on Microsoft.CloudService.MSBuildTasks.dll. The simplest solution is to copy the files to "C:\Program Files\MSBuild\Microsoft\Cloud Service\v1.0\" on the build machine. Note on an x64 machine, you need to change "Program Files" to "Program Files (x86)".

    In addition, you must copy (recommended all) dlls and exes existed under "C:\Program Files\Windows Azure SDK\v1.0\bin" to the build machine. Then please refer to the Microsoft.CloudService.targets file:

        <ServiceHostingSDKInstallDir Condition=" '$(ServiceHostingSDKInstallDir)' == '' ">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\ServiceHosting\v1.0@InstallPath)</ServiceHostingSDKInstallDir>
        <ServiceHostingSDKSupport    Condition=" '$(ServiceHostingSDKSupport)' == '' ">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\ServiceHosting\v1.0@ToolsVersionSupportLevel)</ServiceHostingSDKSupport>
        <!-- Ensure ServiceHostingSDKInstallDir has a trailing slash, so it can be concatenated -->
        <ServiceHostingSDKInstallDir Condition=" '$(ServiceHostingSDKInstallDir)' != '' and !HasTrailingSlash('$(ServiceHostingSDKInstallDir)')">$(ServiceHostingSDKInstallDir)\</ServiceHostingSDKInstallDir>

        <ServiceHostingSDKBinDir     Condition=" '$(ServiceHostingSDKBinDir)' == '' ">$(ServiceHostingSDKInstallDir)bin\</ServiceHostingSDKBinDir>

        <ServiceHostingSDKTaskPath   Condition=" '$(ServiceHostingSDKTaskPath)' == '' ">$(ServiceHostingSDKBinDir)Microsoft.ServiceHosting.Tools.MSBuildTasks.dll</ServiceHostingSDKTaskPath>


    You can either register the paths in registry as illustrated above, or modify the .targets file to point to the path on your build machine.

    I haven't tried to build a project on a machine without installing the SDK. But I think as long as you configure MSBuild correctly, you should be fine. Just refer to the .targets file to see what you need to do.


    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
    • 답변으로 표시됨 dosborn 2010년 1월 7일 목요일 오전 12:23
    2010년 1월 5일 화요일 오전 6:11

모든 응답

  • Hello, if you have a look at the ccproj file in a text editor, you will see it depends on Microsoft.CloudService.targets. It also relies on Microsoft.CloudService.MSBuildTasks.dll. The simplest solution is to copy the files to "C:\Program Files\MSBuild\Microsoft\Cloud Service\v1.0\" on the build machine. Note on an x64 machine, you need to change "Program Files" to "Program Files (x86)".

    In addition, you must copy (recommended all) dlls and exes existed under "C:\Program Files\Windows Azure SDK\v1.0\bin" to the build machine. Then please refer to the Microsoft.CloudService.targets file:

        <ServiceHostingSDKInstallDir Condition=" '$(ServiceHostingSDKInstallDir)' == '' ">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\ServiceHosting\v1.0@InstallPath)</ServiceHostingSDKInstallDir>
        <ServiceHostingSDKSupport    Condition=" '$(ServiceHostingSDKSupport)' == '' ">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\ServiceHosting\v1.0@ToolsVersionSupportLevel)</ServiceHostingSDKSupport>
        <!-- Ensure ServiceHostingSDKInstallDir has a trailing slash, so it can be concatenated -->
        <ServiceHostingSDKInstallDir Condition=" '$(ServiceHostingSDKInstallDir)' != '' and !HasTrailingSlash('$(ServiceHostingSDKInstallDir)')">$(ServiceHostingSDKInstallDir)\</ServiceHostingSDKInstallDir>

        <ServiceHostingSDKBinDir     Condition=" '$(ServiceHostingSDKBinDir)' == '' ">$(ServiceHostingSDKInstallDir)bin\</ServiceHostingSDKBinDir>

        <ServiceHostingSDKTaskPath   Condition=" '$(ServiceHostingSDKTaskPath)' == '' ">$(ServiceHostingSDKBinDir)Microsoft.ServiceHosting.Tools.MSBuildTasks.dll</ServiceHostingSDKTaskPath>


    You can either register the paths in registry as illustrated above, or modify the .targets file to point to the path on your build machine.

    I haven't tried to build a project on a machine without installing the SDK. But I think as long as you configure MSBuild correctly, you should be fine. Just refer to the .targets file to see what you need to do.


    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
    • 답변으로 표시됨 dosborn 2010년 1월 7일 목요일 오전 12:23
    2010년 1월 5일 화요일 오전 6:11
  • I had this working fine with the project under vs2008, but after upgrading it to vs2010 I have issues.  I copied the files over from C:\Program Files (x86)\MSBuild\Microsoft\Cloud Service\1.0 and the reg keys from HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\ServiceHosting\v1.1 along with install .Net Framework 4.0 RC on the build server, but I get the below error.  Any suggestions?

    C:\Program Files\MSBuild\Microsoft\Cloud Service\1.0\Visual Studio 10.0\Microsoft.CloudService.targets(208,5): error WAT050:
     The version of the Windows Azure SDK currently installed is not compatible with this version of Windows Azure Tools for Microsoft
    Visual Studio. Please download and install the latest version of both the Windows Azure SDK and the Windows Azure Tools for Microsoft Visual Studio

    2010년 2월 15일 월요일 오전 2:17
  • Hi, i also have the same problem, on my DevMachine i have the Azure SDK installed, but not in the Build Machine.

    How to exclude a project (Azure) from the build process, is there a configuration? I only need the project local in my solution, but not in the Build! Any suggestions?

    2010년 9월 28일 화요일 오전 10:14