asp.net-core – AppSettings.*.json文件未在ASP.NET CORE 1.1中
发布时间:2020-12-16 09:32:38 所属栏目:asp.Net 来源:网络整理
导读:我正在使用.csproj文件发布一个ASP.NET Core 1.1项目… 当我发布它时,项目被编译并且所有文件(包括wwwroot中的文件)都被复制,但是所有appsettings.*.json文件都丢失了. 我不确定为什么,因为我有以下内容: Content Include="***.json" / 我错过了什么?这是
我正在使用.csproj文件发布一个ASP.NET Core 1.1项目…
当我发布它时,项目被编译并且所有文件(包括wwwroot中的文件)都被复制,但是所有appsettings.*.json文件都丢失了. 我不确定为什么,因为我有以下内容: <Content Include="***.json" /> 我错过了什么?这是完整的.csproj文件. <Project> <Import Project="$(MSBuildExtensionsPath)$(MSBuildToolsVersion)Microsoft.Common.props" /> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp1.1</TargetFramework> <PreserveCompilationContext>true</PreserveCompilationContext> <PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback> </PropertyGroup> <ItemGroup> <Compile Include="***.cs" /> <Content Include="***.json" /> <EmbeddedResource Include="***.resx" /> </ItemGroup> <ItemGroup> <PackageReference Include="System.Runtime" Version="4.3.0" /> <PackageReference Include="Microsoft.NETCore.App" Version="1.1.0" /> <PackageReference Include="Microsoft.NET.Sdk.Web" Version="1.0.0-alpha-20161104-2-112"> <PrivateAssets>All</PrivateAssets> </PackageReference> <PackageReference Include="Microsoft.AspNetCore.Authentication.Cookies" Version="1.1.0" /> <PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="1.1.0" /> <PackageReference Include="Microsoft.AspNetCore.Identity" Version="1.1.0" /> <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.0" /> <PackageReference Include="Microsoft.AspNetCore.Razor.Tools" Version="1.1.0-preview4-final" /> <PackageReference Include="Microsoft.AspNetCore.ResponseCaching" Version="1.1.0" /> <PackageReference Include="Microsoft.AspNetCore.ResponseCompression" Version="1.0.0" /> <PackageReference Include="Microsoft.AspNetCore.Rewrite" Version="1.0.0" /> <PackageReference Include="Microsoft.AspNetCore.Routing" Version="1.1.0" /> <PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.1.0" /> <PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.1.0" /> <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.0" /> <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="1.1.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.1.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.1.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="1.1.0" /> <PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.0" /> <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.0" /> <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.0" /> </ItemGroup> <ItemGroup> <DotNetCliToolReference Include="Microsoft.Extensions.SecretManager.Tools" Version="1.0.0-msbuild1-final" /> </ItemGroup> <Import Project="$(MSBuildToolsPath)Microsoft.CSharp.targets" /> <Target Name="Prepublish" BeforeTargets="PrepareForPublish" Condition=" '$(IsCrossTargetingBuild)' != 'true' "> <Exec Command="npm install" /> <Exec Command="bower install" /> <Exec Command="gulp build" /> </Target> </Project> 解决方法
我有一个类似的问题,我使用的四个json文件作为angular-translate的翻译文件.我所做的包括它们是明确地将它们标记为内容.
<Content Include="Languagelocale-en.json" /> <Content Include="Languagelocale-fr.json" /> <Content Include="Languagelocale-es.json" /> <Content Include="Languagelocale-pt.json" /> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net – 总是显示FooterTemplate,甚至没有数据
- asp.net-web-api – 从数据存储实现动态OAuthBearerServerO
- asp.net – SQL Timeout过期2秒查询
- asp.net-web-api – 密码更改时如何使OAuth令牌无效?
- 在ASP.NET MVC中使用MySQL的AccountController
- .NET Framework 3.5中有哪些有用的新ASP.NET功能?
- 什么是ASP.NET MVC中的环境路由值及其工作原理?
- asp.net-mvc – 如何改变jslint(VS 2010扩展)忽略文件?
- ASP.NET网站或Web项目
- asp.net – Model-Repository-Service-Validator-View-View
推荐文章
站长推荐
- asp.net-mvc – ACS安装,但MVC 4.0应用程序仍然重
- asp.net – CSS中的内联样式与样式
- asp.net – Wiki Content是否可移植?
- 在ASP.NET网站中使用单例连接是一个好主意
- asp.net – 使用Groups进行分页的SignalR
- asp.net-mvc – 使用ASP.NET会员资格和配置文件与
- mono – 使用Kestrel ASP.NET 5时出现错误的空白
- ASP.NET MVC的Razor引擎:IoC在View激活过程中的
- asp.net – 你能用Javascript来检测服务器端创建
- asp.net-mvc – 服务txt的asp.net mvc被截断
热点阅读