2017-02-21 37 views
0

我们拥有一个带有“旧”xaml构建的tfs 2015,我想用webpack部署一个Angular 2网站。TFS 2015 xaml在ASP.NET MVC4中构建TypeScript 2.x“experimentalDecorators”

我可以通过添加简单的Target来安装npm并在tfs上编译我的项目,通过添加简单的Target,我可以在tfs temp目录上看到我的node_modules文件夹和已编译的wwwroot。

<PropertyGroup> 
    <WebsitePath>$(MSBuildProjectDirectory)/../../Gui/Web/</WebsitePath> 
    ... 
</PropertyGroup> 

<Target Name="npminstall"> 
<Exec WorkingDirectory="$(WebsitePath)" Command="npm install" /> 
<Exec WorkingDirectory="$(WebsitePath)" Command="npm run build:dev" /> 
</Target> 

但是,当它试图编译.NET的DLL

Build: Experimental support for decorators is a feature that is subject to change in a future release. 
Set the 'experimentalDecorators' option to remove this warning. 

我知道这个错误我与VS和NG2开始了我需要添加一些TFS代理给了我一个错误信息在我的csproj节点文件

<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DevMvc|AnyCPU'"> 
    <TypeScriptTarget>ES5</TypeScriptTarget> 
    <TypeScriptJSXEmit>None</TypeScriptJSXEmit> 
    <TypeScriptCompileOnSaveEnabled>True</TypeScriptCompileOnSaveEnabled> 
    <TypeScriptNoImplicitAny>False</TypeScriptNoImplicitAny> 
    <TypeScriptModuleKind>CommonJS</TypeScriptModuleKind> 
    <TypeScriptRemoveComments>False</TypeScriptRemoveComments> 
    <TypeScriptOutFile /> 
    <TypeScriptOutDir /> 
    <TypeScriptGeneratesDeclarations>False</TypeScriptGeneratesDeclarations> 
    <TypeScriptNoEmitOnError>True</TypeScriptNoEmitOnError> 
    <TypeScriptSourceMap>True</TypeScriptSourceMap> 
    <TypeScriptMapRoot /> 
    <TypeScriptSourceRoot /> 
    <TypeScriptExperimentalDecorators>True</TypeScriptExperimentalDecorators> 
    <TypeScriptEmitDecoratorMetadata>True</TypeScriptEmitDecoratorMetadata> 
    <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked> 
</PropertyGroup> 

,然后在VS的项目编译,我又添加了此行我的csproj,但它不是帮助/为TFS工作建立

在VS我目前使用tsconfig.json

{ 
    "compilerOptions": { 
    "target": "es5", 
    "module": "commonjs", 
    "moduleResolution": "node", 
    "sourceMap": true, 
    "emitDecoratorMetadata": true, 
    "experimentalDecorators": true, 
    "removeComments": false, 
    "noImplicitAny": false, 
    "types": [ 
     "node" 
    ] 
    }, 
    "awesomeTypescriptLoaderOptions": { 
    "useWebpackText": true 
    }, 
    "exclude": [ 
     "node_modules", 
     "dist", 
     "typings/main", 
     "typings/index.d.ts" 
    ], 
    "compileOnSave": true 
    } 

有人有一个想法是什么我必须做的就是这个项目在2015年TFS

打字稿2.0.6还安装compilled在生成服务器上。

+0

您是否尝试过使用VS在构建代理/服务器上手动运行项目?也许这是一个环境问题,当您使用TFS2015上的xaml构建项目运行项目时,详细错误是什么? –

回答

0

当我们从tfs 2010升级时,我们不会将我们的xaml Processtemplate更改为新的。我所要做的只是选择包含在TFS 2015中的新Xaml Buildprocess模板之一