首页 \ 问答 \ TypeScript 2.0和VS 2017构建工具不再部署js文件(TypeScript 2.0 and VS 2017 Build Tools no longer deploy js files)

TypeScript 2.0和VS 2017构建工具不再部署js文件(TypeScript 2.0 and VS 2017 Build Tools no longer deploy js files)

我最近从VS 2015 Update 3升级到VS 2017,该解决方案将我的解决方案从TypeScript 1.8升级到TypeScript 2.1。

我将.csproj文件中的TypeScriptToolsVersion1.8更改为2.1如下所示:

在这里输入图像描述

以下是完整的PropertyGroup:

<PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>9.0.30729</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{redacted}</ProjectGuid>
    <ProjectTypeGuids>{redacted};{redacted}</ProjectTypeGuids>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>WebApplication</RootNamespace>
    <AssemblyName>WebApplication</AssemblyName>
    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
    <FileUpgradeFlags>
    </FileUpgradeFlags>
    <OldToolsVersion>4.0</OldToolsVersion>
    <UpgradeBackupLocation />
    <TargetFrameworkProfile />
    <UseIISExpress>false</UseIISExpress>
    <WcfConfigValidationEnabled>True</WcfConfigValidationEnabled>
    <IISExpressSSLPort /><IISExpressAnonymousAuthentication>disabled</IISExpressAnonymousAuthentication>
    <IISExpressWindowsAuthentication>enabled</IISExpressWindowsAuthentication>
    <IISExpressUseClassicPipelineMode>false</IISExpressUseClassicPipelineMode>
    <UseGlobalApplicationHostFile />
    <TypeScriptToolsVersion>2.1</TypeScriptToolsVersion>
  </PropertyGroup>

在升级之前,部署将复制与.ts文件关联的.js.map.js文件。 (注意这些.js文件不是“包含”在解决方案中的。

升级后,部署不会复制关联的.js.map.js文件。

奇怪的是,没有关联TypeScript源文件的.js文件被成功复制,如jquery.js 。 这些文件被“包含”在解决方案中。

我可以确认构建确实具有与预期相关的.js文件......它只是部署步骤不会复制它们。

我正在使用msdeploy进行部署,如下所示:

WebApplication.deploy.cmd https://WEBSERVER01:8172/msdeploy.axd?site=test.example.com TheUser ThePassword

为什么这些文件不能复制,我该如何解决?


I recently upgraded from VS 2015 Update 3 to VS 2017 which upgraded my solution from TypeScript 1.8 to TypeScript 2.1.

I changed TypeScriptToolsVersion in my .csproj file from 1.8 to 2.1 like so:

enter image description here

Here is the full PropertyGroup:

<PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>9.0.30729</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{redacted}</ProjectGuid>
    <ProjectTypeGuids>{redacted};{redacted}</ProjectTypeGuids>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>WebApplication</RootNamespace>
    <AssemblyName>WebApplication</AssemblyName>
    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
    <FileUpgradeFlags>
    </FileUpgradeFlags>
    <OldToolsVersion>4.0</OldToolsVersion>
    <UpgradeBackupLocation />
    <TargetFrameworkProfile />
    <UseIISExpress>false</UseIISExpress>
    <WcfConfigValidationEnabled>True</WcfConfigValidationEnabled>
    <IISExpressSSLPort /><IISExpressAnonymousAuthentication>disabled</IISExpressAnonymousAuthentication>
    <IISExpressWindowsAuthentication>enabled</IISExpressWindowsAuthentication>
    <IISExpressUseClassicPipelineMode>false</IISExpressUseClassicPipelineMode>
    <UseGlobalApplicationHostFile />
    <TypeScriptToolsVersion>2.1</TypeScriptToolsVersion>
  </PropertyGroup>

Prior to the upgrade, the deployment would copy the .js and .map.js files that were associated with a .ts file. (note these .js files were not "included" in the solution.

After the upgrade, the deployment does not copy the associated .js or .map.js files.

Oddly enough, the .js files that had no associated TypeScript sources were copied successfully such as jquery.js. These files are "included" in the solution.

I can confirm the build does have the associated .js files as expected...its just the deployment step does not copy them.

I am using msdeploy for deployment like so:

WebApplication.deploy.cmd https://WEBSERVER01:8172/msdeploy.axd?site=test.example.com TheUser ThePassword

Why are these files not copying anymore and how can I fix it?


原文:https://stackoverflow.com/questions/42954920
更新时间:2024-03-31 11:03

最满意答案

请记住, Stream定义了一个操作而不是存储。 因此,对于大多数操作,当使用CPU寄存器时,使用float仅比double值提供的好处很少。 对于可以使用SSE或GPU加速的操作可能存在理论上的改进,但这与此处无关。

因此,您可以使用DoubleStream进行该操作,您唯一需要的是能够将DoubleStream收集到float[]数组中的收集器:

float[] arrayVertices = listVertices.stream()
    .flatMapToDouble(vertex->DoubleStream.of(vertex.x, vertex.y, vertex.z))
    .collect(FaCollector::new, FaCollector::add, FaCollector::join)
    .toArray();

static class FaCollector {
    float[] curr=new float[64];
    int size;
    void add(double d) {
        if(curr.length==size) curr=Arrays.copyOf(curr, size*2);
        curr[size++]=(float)d;
    }
    void join(FaCollector other) {
        if(size+other.size > curr.length)
            curr=Arrays.copyOf(curr, size+other.size);
        System.arraycopy(other.curr, 0, curr, size, other.size);
        size+=other.size;
    }
    float[] toArray() {
        if(size!=curr.length) curr=Arrays.copyOf(curr, size);
        return curr;
    }
}

这支持并行处理,但是,对于仅由数据复制组成的操作,并行处理没有任何好处。


Keep in mind that a Stream defines an operation rather that a storage. So for most operations, using a float provides only little benefit over double values when CPU registers are used. There might be a theoretical improvement for operations that could be accelerated using SSE or GPU, but that’s not relevant here.

So you can use a DoubleStream for that operation, the only thing you need is a collector capable of collecting a DoubleStream into a float[] array:

float[] arrayVertices = listVertices.stream()
    .flatMapToDouble(vertex->DoubleStream.of(vertex.x, vertex.y, vertex.z))
    .collect(FaCollector::new, FaCollector::add, FaCollector::join)
    .toArray();

static class FaCollector {
    float[] curr=new float[64];
    int size;
    void add(double d) {
        if(curr.length==size) curr=Arrays.copyOf(curr, size*2);
        curr[size++]=(float)d;
    }
    void join(FaCollector other) {
        if(size+other.size > curr.length)
            curr=Arrays.copyOf(curr, size+other.size);
        System.arraycopy(other.curr, 0, curr, size, other.size);
        size+=other.size;
    }
    float[] toArray() {
        if(size!=curr.length) curr=Arrays.copyOf(curr, size);
        return curr;
    }
}

This supports parallel processing, however, for an operation that merely consist of data copying only, there is no benefit from parallel processing.

相关问答

更多
  • 如果你修改你的类来接受一个Stream而不是一个文件名,那就别打扰转换到一个MemoryStream。 让底层的Stream处理操作: public class MyClass { Stream _s; public MyClass(Stream s) { _s = s; } } 但是如果您真的需要一个MemoryStream进行内部操作,则必须将数据从Source Stream复制到MemoryStream中: public MyClass(Stream stream) { ...
  • 你可以写一个逐行读取的方法,如下所示: public IEnumerable ReadLines(Func streamProvider, Encoding encoding) { using (var stream = streamProvider()) using (var reader = new StreamReader(stream, encoding)) { ...
  • File.OpenWrite创建一个不可读的流。 如果您要读取和写入流,则需要使用File.Open(localPath, FileMode.Open, FileAccess.ReadWrite) 。 此外,您可以使用FileMode.OpenOrCreate ,这将消除您的File.Exists条件的需要。 File.OpenWrite creates a non-readable stream. If you're going to be reading and writing to the strea ...
  • 我不知道任何会同时写入多个流的东西,并且在任何情况下都会导致循环。 请注意,如果您使用线程实现(从性能角度来看肯定会有所帮助),请注意Stream.BeginWrite的默认实现是同步 - 派生类必须实现其自己的异步逻辑。 例如, FileStream实现它自己的异步行为,但MemoryStream不行。 I don't know of anything that will simultaneously write to multiple streams, and it would boil down to ...
  • 请记住, Stream定义了一个操作而不是存储。 因此,对于大多数操作,当使用CPU寄存器时,使用float仅比double值提供的好处很少。 对于可以使用SSE或GPU加速的操作可能存在理论上的改进,但这与此处无关。 因此,您可以使用DoubleStream进行该操作,您唯一需要的是能够将DoubleStream收集到float[]数组中的收集器: float[] arrayVertices = listVertices.stream() .flatMapToDouble(vertex->Doub ...
  • 根据文档 , stream.toBlob()期望blob的输出类型,即application/text , application/pdf 。 你可以试试下面的代码, stream.on('finish', function () { //get a blob you can do whatever you like with blob = stream.toBlob('application/pdf'); return blob; }); 请仔细阅读文档。 它在下面说, PDFDocument实例 ...
  • 您可以将flatMap与Collection#stream Stream flatten(Stream> stream){ return stream.flatMap(Collection::stream); } 最终的代码将如下所示: import static java.lang.System.out; import static java.security.Provider.Service; import st ...
  • 您可以使用flatMap将您的Stream>平铺为Stream : IntStream.rangeClosed(this.getYear(), to.getYear()) .boxed() .map(i -> Arrays .stream(Quarters.values()) .map(q -> new Quarter(i, q)) .flatMap(Function.identity()) ...

相关文章

更多

最新问答

更多
  • linux环境下怎么用maven编译一个已有的java项目?
  • Ionic2和IonicDeploy(Ionic2 and IonicDeploy)
  • 尝试分组和别名数据时出错(Error when Attempting to Group and Alias Data)
  • Facebook PHP API错误代码100:API中提供的appsecret_proof无效(Facebook PHP API Error code 100: Invalid appsecret_proof provided in the API)
  • 不用u盘和光盘怎么安装linux系统
  • 表名作为变量参数(Table name as variable parameter)
  • 我想学计算机 在望京花园住 附近那有这样的地方可以学
  • 删除原始记录的重复项(Removing duplicates with original records)
  • Pandas:使用.astype(str)时忽略空值?(Pandas: ignore null values when using .astype(str)?)
  • Python新手阵列 - 列表转换[重复](Python newbie array - list conversion [duplicate])
  • java.lang.String cannot be cast to java.lang.Float
  • 带参数的选择器(Selector with argument)
  • python中的for循环语法(for loop syntax in python)
  • Nunit - 无法检索类别属性(NUnit - Can't retrieve a category property)
  • python3 xpath无法到达子节点(AttributeError:'NoneType'对象没有属性'text')(python3 xpath can't reach a child node (AttributeError: 'NoneType' object has no attribute 'text'))
  • Android自动 - 如何启用开发人员模式(Android auto - how to enable developer mode)
  • java weka stringtowordvector没有正确计算单词出现次数(java weka stringtowordvector is not counting word occurences properly)
  • 如何解释DHT响应中的“节点”?(How to interpret 'nodes' in a DHT response?)
  • 什么是使用opencv和树莓相机模块进行人脸检测的最佳算法(What is the best algorithm for face detection using opencv and raspberry camera module)
  • 可以somone解释这两个问题的解决方案(c程序,mutex,线程)吗?(Can someone explain the solution of these two questions (c program,mutex,threads)?)
  • 如何解决SyntaxError:意想不到的令牌var gulp(How to fix SyntaxError: Unexpected token var in gulp)
  • 在满足R中的第一个实例后,在所有行中分配值(Assign value in all rows following satisfaction of first instance in R)
  • 如何记录Atk4 auth /登录事件(How to log Atk4 auth/login event)
  • 是否有必要在新的scala项目中添加我的自定义scala库依赖项?(is it necessary to add my custom scala library dependencies in new scala project?)
  • Java中对象类的继承(Inheritance of Object Class in Java)
  • 如何在jquery自动完成中获取当前元素?(How to get current element in jquery autocomplete?)
  • 学电子商务甚么大学好
  • @Override在java中(@Override in java)
  • 虚拟机中怎么给linux装office
  • Laravel邮件参数(sendmail / smtp)(Laravel mail parameters (sendmail/smtp))