2013-08-27 3 views
0

У меня есть приложение wcf, которое я пытаюсь создать/опубликовать через командную строку. Я могу получить вывод, но тогда каталог «bin» не имеет такой же структуры папок.Публиковать через командную строку C# wcf

Например:

Когда построен/опубликован через VS папка bin выглядит

bin 
->Test 
    -> Files.dll 

Но когда я бегу то же самое через command line

bin 
->Files.dll 

В папке Test отсутствует. Я попытался сделать xcopy из папки bin. Но оказывается, что в папке bin нет файлов.

Вот командный файл, я уверен, выполнение

SET DestPath = "EmailNotificationPublish" 
C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe EmailNotification.sln /property:OutDir=%DestPath% /p:Configuration=Release;Platform="Any CPU";DeployOnBuild=True 

Пожалуйста, дайте мне знать, если требуются какие-либо другие файлы.

UPDATE Мой .csproj выглядит следующим образом

<PropertyGroup> 
    <Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration> 
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> 
    <ProductVersion> 
    </ProductVersion> 
    <SchemaVersion>2.0</SchemaVersion> 
    <ProjectGuid>{B35C5165-44AD-472F-8071-22AEA022F77B}</ProjectGuid> 
    <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids> 
    <OutputType>Library</OutputType> 
    <OutputPath>D:\EmailNotificationPublish</OutputPath> 
    <AppDesignerFolder>Properties</AppDesignerFolder> 
    <RootNamespace>EmailNotification.Service</RootNamespace> 
    <AssemblyName>EmailNotification.Service</AssemblyName> 
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> 
    <UseIISExpress>false</UseIISExpress> 
    </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="Microsoft.CSharp" /> 
    <Reference Include="System.Web.DynamicData" /> 
    <Reference Include="System.Web.Entity" /> 
    <Reference Include="System.Web.ApplicationServices" /> 
    <Reference Include="System" /> 
    <Reference Include="System.Configuration" /> 
    <Reference Include="System.Core" /> 
    <Reference Include="System.Data" /> 
    <Reference Include="System.Drawing" /> 
    <Reference Include="System.EnterpriseServices" /> 
    <Reference Include="System.Runtime.Serialization" /> 
    <Reference Include="System.ServiceModel" /> 
    <Reference Include="System.ServiceModel.Web" /> 
    <Reference Include="System.Web" /> 
    <Reference Include="System.Web.Extensions" /> 
    <Reference Include="System.Web.Services" /> 
    <Reference Include="System.Xml" /> 
    <Reference Include="System.Xml.Linq" /> 
    </ItemGroup> 
    <ItemGroup> 
    <Content Include="EmailNotificationService.svc" /> 
    <Content Include="Templates\BasicEmailTemplate.txt"> 
     <CopyToOutputDirectory>Always</CopyToOutputDirectory> 
    </Content> 
    <Content Include="Templates\DueDateEmailTemplate.txt"> 
     <CopyToOutputDirectory>Always</CopyToOutputDirectory> 
    </Content> 
    <Content Include="Templates\CompleteEmailTemplate.txt"> 
     <CopyToOutputDirectory>Always</CopyToOutputDirectory> 
    </Content> 
    <Content Include="Web.config"> 
     <SubType>Designer</SubType> 
    </Content> 
    <Content Include="Web.Debug.config"> 
     <DependentUpon>Web.config</DependentUpon> 
    </Content> 
    <Content Include="Web.Release.config"> 
     <DependentUpon>Web.config</DependentUpon> 
    </Content> 
    </ItemGroup> 
    <ItemGroup> 
    <Compile Include="EmailNotificationService.svc.cs"> 
     <DependentUpon>EmailNotificationService.svc</DependentUpon> 
    </Compile> 
    <Compile Include="IEmailNotificationService.cs" /> 
    <Compile Include="Properties\AssemblyInfo.cs" /> 
    </ItemGroup> 
    <ItemGroup> 
    <Folder Include="App_Data\" /> 
    </ItemGroup> 
    <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> 
    <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" /> 
    <ProjectExtensions> 
    <VisualStudio> 
     <FlavorProperties GUID="{349c5851-65df-11da-9384-03265b846f21}"> 
     <WebProjectProperties> 
      <UseIIS>False</UseIIS> 
      <AutoAssignPort>True</AutoAssignPort> 
      <DevelopmentServerPort>64568</DevelopmentServerPort> 
      <DevelopmentServerVPath>/</DevelopmentServerVPath> 
      <IISUrl> 
      </IISUrl> 
      <NTLMAuthentication>False</NTLMAuthentication> 
      <UseCustomServer>False</UseCustomServer> 
      <CustomServerUrl> 
      </CustomServerUrl> 
      <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile> 
      <EnableWcfTestClientForSVCDefaultValue>True</EnableWcfTestClientForSVCDefaultValue> 
     </WebProjectProperties> 
     </FlavorProperties> 
    </VisualStudio> 
    </ProjectExtensions> 
    <!-- 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> 
+0

Есть ли что-нибудь в .csproj, который имеет «Test» в нем сообщение построить событие Нечто Это одна сложно, вам может потребоваться опубликовать весь файл .csproj. – granadaCoder

+0

@granadaCoder Обновлено с полным .csproj – Vinay

+0

Можете ли вы прокомментировать это и посмотреть, не влияет ли оно на что-либо. » D: \ EmailNotificationPublish« – granadaCoder

ответ

0

Я предлагаю открытие вверх .csproj файлов.

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> 
    <OutputPath>.\bin\Debug</OutputPath> 
    </PropertyGroup> 
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> 
    <OutputPath>.\bin\Release</OutputPath> 
    </PropertyGroup> 

И обращая особое внимание на

Вы можете быть (по незнанию), призывающей 2 различных "условий" (как правило, $ (Configuration)). (Обратите внимание, как вы explicitedly настройки «Конфигурация» при вызове этого:?.

C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe EmailNotification.sln /property:OutDir=%DestPath% /p:Configuration=Release;Platform="Any CPU";DeployOnBuild=True 
+0

Спасибо за ответ. У меня есть OutputPath в моем .csproj. Я обновил вопрос с помощью файла .csproj. – Vinay

Смежные вопросы