简体   繁体   English

.NET Core Azure function -> error: could not load file or assembly System.Windows.Forms

[英].NET Core Azure function -> error: could not load file or assembly System.Windows.Forms

I have project running on .NET Core 3.1.我有在 .NET Core 3.1 上运行的项目。 I've created an Azure Function that references a 3rd party library (a SyncFusion library, if it makes any difference).我创建了一个 Azure Function ,它引用了一个第三方库(一个 SyncFusion 库,如果它有任何区别的话)。 When I try to use a specific function from that library I get the following error:当我尝试使用该库中的特定 function 时,出现以下错误:

Could not load file or assembly 'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.无法加载文件或程序集“System.Windows.Forms,版本=4.0.0.0,文化=中性,PublicKeyToken=b77a5c561934e089”。 Reference assemblies should not be loaded for execution.不应加载引用程序集以供执行。 They can only be loaded in the Reflection-only loader context.它们只能在 Reflection-only loader 上下文中加载。

Any idea how to fix this?知道如何解决这个问题吗?

Thank you for your attention!感谢您的关注!

--Try this in your csproj. --在你的csproj中试试这个。 It should keep the console window open of a winforms app.它应该使控制台 window 保持打开 Winforms 应用程序。

<PropertyGroup>
<OutputType>Exe</OutputType>
</PropertyGroup>

--If you get a error that a dll is not connected then reference the Packages in your.csproj. --如果您收到 dll 未连接的错误,请参考 your.csproj 中的包。 Dlls you have to reference like this:你必须像这样引用的DLL:

<ItemGroup>
<Reference Include="YourAssembly">
<HintPath>Path/To/YourAssembly.dll</HintPath>
</Reference>
</ItemGroup>

暂无
暂无

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

相关问题 .NET Core 2.2 Assembly System.Windows.Forms 缺失 - .NET Core 2.2 Assembly System.Windows.Forms missing 无法加载一种或多种请求的类型。 无法加载文件或程序集 'System.Windows.Forms,版本 = 5.0.0.0 - Unable to load one or more of the requested types. Could not load file or assembly 'System.Windows.Forms, Version=5.0.0.0 在 .Net Core 中添加 System.Windows.forms 的引用 - Add reference of System.Windows.forms in .Net Core Nunit 测试项目无法加载 System.Windows.Forms 程序集来测试 windows 表单基于应用程序定位.Net 4.6.1 - Nunit test project cannot load System.Windows.Forms assembly to test a windows form based application targeting .Net 4.6.1 .NET Framework 4.6.1 System.Windows.Forms错误 - .NET Framework 4.6.1 error with System.Windows.Forms 点网核心和Azure存储:无法加载文件或程序集系统,版本= 4.0.0.0 - Dot Net Core and Azure Storage: Could not load file or assembly System, Version=4.0.0.0 错误System.IO.FileLoadException:&#39;无法加载文件或程序集&#39;log4net,版本= 2.0.8.0在.NET Core中 - Error System.IO.FileLoadException: 'Could not load file or assembly 'log4net, Version=2.0.8.0 in .NET Core 无法使用.Net Core dll加载文件或程序集&#39;System.Runtime&#39; - Could not load file or assembly 'System.Runtime' with .Net Core dll 如何修复“无法加载文件或程序集System.Core”错误? - How to fix “Could not load file or assembly System.Core” error? VS Code 中的 System.Windows.Forms 程序集参考 - System.Windows.Forms assembly reference in VS Code
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM