0
我有一個項目,我已經使用.net核心版本1 這是一個SPA,我有一個文件,我想在測試過程中,但是當我發佈我希望它被排除在外。project.json exlcudeFiles不工作
我已閱讀:https://docs.microsoft.com/en-us/dotnet/articles/core/tools/project-json和所有它說是添加任何排除或excludeFiles到publishOptions對象。 所以,我試過了,似乎沒有任何工作。
這裏是我的project.json:
{
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0",
"type": "platform"
},
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
"Microsoft.AspNetCore.Routing": "1.0.0"
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"publishOptions": {
"include": [
"wwwroot",
"web.config"
],
"exclude": [ "js/constants.*" ],
"excludeFiles": [ "js/constants.min.js" ]
},
"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
誰能告訴我什麼,我做錯了什麼?
我在這裏看到你的'constants' JavaScript文件不會被無論如何,因爲包括你沒有包含'js/**'。默認情況下,所有文件都被排除,然後包含你想要的每個文件。所以你可以刪除'exclude'和'excludeFiles',因爲在這個例子中它們是無用的 –