2013-02-23 137 views
0

我有一個​​項目和一個單獨的BusinessLayer項目包含在解決方案中。當我試圖通過本地git存儲庫將我的網站部署到Azure時,出現以下錯誤:'<remote_path>\BusinessLayer\BusinessLayer.csproj' is not a deployable project.。日誌中沒有提供其他信息。網站完全部署在我的本地服務器上。所以我想知道這個錯誤發生的原因。提前致謝。將asp.net mvc 3項目部署到Windows Azure網站時出錯

這是我的.csproj文件,如果需要的話:

<?xml version="1.0" encoding="utf-8"?> 
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 
    <PropertyGroup> 
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> 
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> 
    <ProductVersion>8.0.30703</ProductVersion> 
    <SchemaVersion>2.0</SchemaVersion> 
    <ProjectGuid>{31F2F6FE-10D8-4510-AC61-CBE1962D3940}</ProjectGuid> 
    <OutputType>Library</OutputType> 
    <AppDesignerFolder>Properties</AppDesignerFolder> 
    <RootNamespace>BusinessLayer</RootNamespace> 
    <AssemblyName>BusinessLayer</AssemblyName> 
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> 
    <FileAlignment>512</FileAlignment> 
    </PropertyGroup> 
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> 
    <DebugSymbols>true</DebugSymbols> 
    <DebugType>full</DebugType> 
    <Optimize>false</Optimize> 
    <OutputPath>bin\Debug\</OutputPath> 
    <DefineConstants>DEBUG;TRACE</DefineConstants> 
    <ErrorReport>prompt</ErrorReport> 
    <WarningLevel>4</WarningLevel> 
    </PropertyGroup> 
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> 
    <DebugType>pdbonly</DebugType> 
    <Optimize>true</Optimize> 
    <OutputPath>bin\Release\</OutputPath> 
    <DefineConstants>TRACE</DefineConstants> 
    <ErrorReport>prompt</ErrorReport> 
    <WarningLevel>4</WarningLevel> 
    </PropertyGroup> 
    <ItemGroup> 
    <Reference Include="MongoDB.Bson"> 
     <HintPath>..\..\Libs\MongoDB.Bson.dll</HintPath> 
    </Reference> 
    <Reference Include="MongoDB.Driver"> 
     <HintPath>..\..\Libs\MongoDB.Driver.dll</HintPath> 
    </Reference> 
    <Reference Include="System" /> 
    <Reference Include="System.Core" /> 
    <Reference Include="System.Drawing" /> 
    <Reference Include="System.Xml.Linq" /> 
    <Reference Include="System.Data.DataSetExtensions" /> 
    <Reference Include="Microsoft.CSharp" /> 
    <Reference Include="System.Data" /> 
    <Reference Include="System.Xml" /> 
    </ItemGroup> 
    <ItemGroup> 
    <Compile Include="Battle.cs" /> 
    <Compile Include="BattleManager.cs" /> 
    <Compile Include="BattlePlace.cs" /> 
    <Compile Include="Helpers\ConvertHelper.cs" /> 
    <Compile Include="Helpers\ImageHelper.cs" /> 
    <Compile Include="Message.cs" /> 
    <Compile Include="Picture.cs" /> 
    <Compile Include="Place.cs" /> 
    <Compile Include="PlaceManager.cs" /> 
    <Compile Include="Subject.cs" /> 
    <Compile Include="User.cs" /> 
    <Compile Include="Helpers\DBHelper.cs" /> 
    <Compile Include="Properties\AssemblyInfo.cs" /> 
    </ItemGroup> 
    <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 
    <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
     Other similar extension points exist, see Microsoft.Common.targets. 
    <Target Name="BeforeBuild"> 
    </Target> 
    <Target Name="AfterBuild"> 
    </Target> 
    --> 
</Project> 

回答

1

您可能需要告訴Azure它應該部署哪個項目,您可以在項目的根目錄下使用.deployment文件進行部署。例如

[config] 
project = WebProject/WebProject.csproj 

有關詳細信息,請參閱this page

0

聽起來像是你試圖部署BusinessLayer項目,而不是網站項目。只要您的MVC網站項目有對BusinessLayer的參考,只需部署網站。 BusinessLayer將作爲參考。 您無法單獨部署BusinessLayer,因爲它是一個庫而不是應用程序。