【发布时间】:2020-05-14 14:42:31
【问题描述】:
我正在将我的项目从 .net 框架转移到 .Net core 3.1 web api。 .Net 似乎不包含 app.config 文件,我需要添加它。我添加了一个,但它无法识别。有没有办法将 app.config 文件添加到 .Net 核心应用程序?还是 app.config .net core 的替代品?
App.config:
<configSections>
<section name="corememorycache" type="NHibernate.Caches.CoreMemoryCache.CoreMemoryCacheSectionHandler,NHibernate.Caches.CoreMemoryCache" />
<section name="hibernate-configuration"
type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" />
</configSections>
<corememorycache expiration-scan-frequency="00:05:00">
<cache region="foo" expiration="500" sliding="true" />
<cache region="noExplicitExpiration" sliding="true" />
</corememorycache>
【问题讨论】:
-
嗨,约翰尼,欢迎来到社区!您是否已经阅读了documentation here 中的步骤大纲并且您还没有找到解决方案?通常 .Net 核心配置发生在 Startup.cs 文件中,并且可以在 AppSettings.json 文件中添加其他配置。如果您还没有,请创建一个新的 .NET 核心应用程序并查看结构和包含的文件以获取提示,并报告回来。如果您发现自己的问题受到鼓励,请发布答案。
标签: asp.net-core asp.net-core-webapi app-config asp.net-core-3.1