2016-02-16 35 views
2

我有这样定义的Visual Studio 2015年Powershell的工具项目:PowerShell的工具模块项目构建工作不正常

<?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> 
    <SchemaVersion>2.0</SchemaVersion> 
    <ProjectGuid>6CAFC0C6-A428-4d30-A9F9-700E829FEA51</ProjectGuid> 
    <OutputType>Exe</OutputType> 
    <RootNamespace>MyApplication</RootNamespace> 
    <AssemblyName>MyApplication</AssemblyName> 
    <Name>PS.TEST</Name> 
    <DebugArguments> 
    </DebugArguments> 
    <Author /> 
    <CompanyName /> 
    <Copyright /> 
    <Description /> 
    <Version>1.0.0.1</Version> 
    <Guid>29a8500a-c449-43f5-b9ba-610546db8cc2</Guid> 
    <FormatsToProcess /> 
    <FunctionsToProcess /> 
    <ModuleList> 
    </ModuleList> 
    <ModuleToProcess /> 
    <NestedModules /> 
    <TypesToProcess /> 
    </PropertyGroup> 
    <PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> 
    <DebugSymbols>true</DebugSymbols> 
    <DebugType>full</DebugType> 
    <Optimize>false</Optimize> 
    <OutputPath>bin\Debug\</OutputPath> 
    <DefineConstants>DEBUG;TRACE</DefineConstants> 
    <ErrorReport>prompt</ErrorReport> 
    <WarningLevel>4</WarningLevel> 
    </PropertyGroup> 
    <ItemGroup> 
    <Compile Include="PS-TEST.psd1" /> 
    <Compile Include="PS-TEST.psm1" /> 
    <Compile Include="Tools\Release.ps1" /> 
    </ItemGroup> 
    <ItemGroup> 
    <Folder Include="Files\" /> 
    <Folder Include="Tools\" /> 
    <Folder Include="Public\" /> 
    <Folder Include="Private\" /> 
    </ItemGroup> 
    <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> 
    <Target Name="CoreCompile" /> 
    <Target Name="Build"> 
    <Exec Command="Powershell.exe Tools\Release.ps1 $(version)" /> 
    </Target> 
</Project> 

当我打造整体解决方案“构建”不执行任务的执行命令。为什么?

当我建立这个与的MSBuild控制台应用程序,它成功并执行“构建”任务exec命令,在Visual Studio 2015年社区不显示这个项目不过“Build命令”当我右键单击解决方案项目节点探险家。如何启用此功能?

我已经添加了节点<Target Name="CoreCompile" />,但没有效果 - 该命令仍未在用户界面中显示。 XML中是否还有某些东西缺失?

回答

1

PowerShell工具扩展未定义Visual Studio命令来“构建”PowerShell模块项目。如果您在解决方案资源管理器中右键单击项目,您会注意到没有构建选项。

但是,生成菜单下有一个选项。我认为这只是Visual Studio的标准版本,而不是扩展提供者的做法。因为点击这个本质上是没有任何操作的。

目前,msbuild是完成你所需要的工具。

您可以在此处提出问题:https://github.com/adamdriscoll/poshtools/issues