我有一个使用.net核心版本1做的项目,它是一个SPA,我在测试期间想要一个文件,但是在发布时我希望它被排除在外。
我已经读过:publishOptions对象中添加了排除或excludeFiles。所以,我已经试过了,但似乎没有什么效果。
这是我的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%" ]
}
}有人能告诉我我做错了什么吗?
发布于 2016-11-30 14:38:14
您很可能希望将其排除在wwwroot之外,因此适当的修补程序将是
"exclude": [ "wwwroot/js/constants.*" ],
"excludeFiles": [ "wwwroot/js/constants.min.js" ]从主项目目录开始的扩展修补程序
https://stackoverflow.com/questions/40786632
复制相似问题