asp.net核心从生成中排除文件 [英] asp.net core exclude files from the build

查看:76
本文介绍了asp.net核心从生成中排除文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将量角器添加到我的asp.net-core应用程序中.

I'm trying to add Protractor to my asp.net-core application.

我通过npm添加了它,并安装了包含文件 Page.aspx.cs 的selenium-webdriver.这会导致生成错误,但是我的项目甚至不需要编译它.

I added it via npm and it installs the selenium-webdriver which contains a file Page.aspx.cs. This is causing a build error but my project doesn't even need to compile it.

所以我试图使用project.json排除node_modules

So I'm trying to exclude node_modules using project.json

"buildOptions": {
  "emitEntryPoint": true,
  "preserveCompilationContext": true,
  "compile": {
    "excludeFiles": "node_modules"
  }
},

给出路径中的非法字符,如下所示:

 "excludeFiles": ["node_modules"]

这似乎与_字符有关,但我不知道为什么这会成为问题.

This seems to be related to the _ character but I can't work out why that would be an issue.

谢谢

推荐答案

我设法使用 exclude 代替了 excludeFiles

"buildOptions": {
  "emitEntryPoint": true,
  "preserveCompilationContext": true,
  "compile": {
    "exclude": ["node_modules"]
  }
},

这篇关于asp.net核心从生成中排除文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆