简体   繁体   English

在 .Net Core 项目中使用 .Net Framework dll (v4.7.2)

[英]Use .Net Framework dll (v4.7.2) in .Net Core project

The .Net Framework dll which I am using gets included in the .Net core project(Azure Functions v2) perfectly fine but at runtime it gives error "我正在使用的 .Net Framework dll 包含在 .Net 核心项目(Azure Functions v2)中非常好,但在运行时它给出了错误“

System.Runtime.Caching: Could not load file or assembly 'System.Configuration.ConfigurationManager". System.Runtime.Caching:无法加载文件或程序集“System.Configuration.ConfigurationManager”。

I tried including it via Nuget.我尝试通过 Nuget 包含它。 Still not working.还是行不通。 The external dll which I am trying to use which is in .Net Framework seems to use Configuration Manager.我试图在 .Net Framework 中使用的外部 dll 似乎使用了配置管理器。 Is there any workaround to make it work?有什么解决方法可以使它工作吗?

Tried using .Net Standard and included the Framwork dll, still getting the same error尝试使用 .Net Standard 并包含 Framwork dll,仍然出现相同的错误

您是否在应用程序中引用了System.ConfigurationSystem

Looks like you are using some packages based on .NetFramework?看起来您正在使用一些基于 .NetFramework 的软件包? The problem should comes from they based on ConfigurationManager.问题应该来自他们基于ConfigurationManager。 Azure function v2 and later version didn't support ConfigurationManager any more. Azure 函数 v2 及更高版本不再支持 ConfigurationManager。 If you want to use those package, you can use azure function v1 instead of function v2.如果要使用这些包,可以使用 azure 函数 v1 而不是函数 v2。

Or you can show the .csproj file in your question.或者您可以在问题中显示 .csproj 文件。 Those package maybe too old and have another version that works on .Net Core.这些包可能太旧了,并且有另一个可以在 .Net Core 上运行的版本。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Framework 4.6项目中使用.net核心DLL - Use .net core DLL in Framework 4.6 project 从 .NET v4.7.2 切换到 .NET 标准 v2.0 时,在 DefaultContractResolver 中找不到 IgnoreSerializableAttribute - IgnoreSerializableAttribute not found in DefaultContractResolver when switching from .NET v4.7.2 to .NET Standard v2.0 在分支之间转换时生成错误:您的项目未引用“.NETFramework,Version=v4.7.2”框架 - Build error while transitioning between branches: Your project is not referencing the ".NETFramework,Version=v4.7.2" framework WPF.Net v4.7.2 令人担忧的调试和直接运行的区别 - WPF .Net v4.7.2 worrying difference between running in debug and direct 当项目升级到 .Net Framework 4.7.2 时,从面向项目的 .Net Framework 4.6 引用的 DLL 不再出现在 bin 中 - Referenced DLL From Project Targeting .Net Framework 4.6 is no longer appearing in bin When Project Upgraded to .Net Framework 4.7.2 我需要我的 .NET Framework 4.7.2 网站才能使用我的 .NET 核心网站的身份验证 - I need my .NET Framework 4.7.2 website to be able to use the authentication of my .NET Core Website 是否可以使用 dotnet new 创建一个 ASP.NET Web Application Empty .Net Framework 4.7.2 项目? - Is it possible to use dotnet new to create an ASP.NET Web Application Empty .Net Framework 4.7.2 project? .NET Core Httpclient可以工作但.Net Framework 4.7.2 httpclient却没有 - .NET Core Httpclient works but .Net Framework 4.7.2 httpclient doesn't 无法在 .NET Core 3.1 和 5 中连接,但在 .NET 框架 4.7.2 中工作正常 - Unable to connect in .NET Core 3.1 and 5, but working fine in .NET Framework 4.7.2 .Net Framework 4.7.2 引用.Net Standard 2.0 项目 - .Net Framework 4.7.2 Referencing .Net Standard 2.0 project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM