.net 通过命令行c#wcf发布

.net 通过命令行c#wcf发布,.net,deployment,msbuild,.net,Deployment,Msbuild,我有一个wcf应用程序,我正试图通过命令行构建/发布它。我能够获得输出,但是“bin”目录没有相同的文件夹结构 例如: 通过VS构建/发布时,bin文件夹如下所示 bin ->Test -> Files.dll 但是当我通过命令行 bin ->Files.dll 缺少测试文件夹。我试图从bin文件夹中进行xcopy。但事实证明,bin文件夹中没有文件 这是我正在执行的批处理文件 SET DestPath = "EmailNotificationPublish" C:

我有一个wcf应用程序,我正试图通过命令行构建/发布它。我能够获得输出,但是“bin”目录没有相同的文件夹结构

例如:

通过VS构建/发布时,bin文件夹如下所示

bin
->Test
   -> Files.dll
但是当我通过
命令行

bin
->Files.dll
缺少测试文件夹。我试图从bin文件夹中进行xcopy。但事实证明,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
如果需要其他文件,请告诉我

更新 我的.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>

释放
任意CPU
2
{B35C5165-44AD-472F-8071-22AEA022F77B}
{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
图书馆
D:\EmailNotificationPublish
性质
电子邮件通知服务
电子邮件通知服务
v4.0
假的
真的
满的
假的
..\bin\Debug\
调试;痕迹
促使
4.
pdbonly
真的
..\bin\Release\
痕迹
促使
4.
总是
总是
总是
设计师
Web.config
Web.config
EmailNotificationService.svc
假的
真的
64568
/
假的
假的
假的
真的

我建议打开.csproj文件

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

谢谢你的回复。我的.csproj中确实有输出路径。我用.csproj文件更新了这个问题。在.csproj文件中有没有包含“Test”的内容?构建后事件?某物这是一个棘手的问题,您可能需要发布整个.csproj文件。@granadaCoder更新为complete.csprojc您可以对此进行注释,看看它是否会影响任何内容。“D:\EmailNotificationPublish”我已经试过了,但找不到发布的位置。它不在bin文件夹中。能否将此“OutDir=%DestPath%”更改为“OutXXXDirXXX=%DestPath%”,以查看是否会将结果放入\bin\Debug和/或bin\Release目录中?
C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe  EmailNotification.sln /property:OutDir=%DestPath% /p:Configuration=Release;Platform="Any CPU";DeployOnBuild=True