c# - Could not load file or assembly 'Microsoft.UpdateServices.BaseApi' with the referenced "Microsoft.

I'm developing an "ASP.Net Core Web API" in Framework .Net 8.0 working with Microsoft WS

I'm developing an "ASP.Net Core Web API" in Framework .Net 8.0 working with Microsoft WSUS, I have referenced the file :

C:\Program Files\Update Services\Api\Microsoft.UpdateServices.Administration.dll

When I try to run the code :

AdminProxy proxy = new AdminProxy();

objUpdateServer = proxy.GetRemoteUpdateServerInstance(sServerName, false, iPort);

I get this exception at the 2nd line :

{"Could not load file or assembly 'Microsoft.UpdateServices.BaseApi, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.":"Microsoft.UpdateServices.BaseApi, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"}

at System.Reflection.RuntimeAssembly.InternalLoad(AssemblyName assemblyName, StackCrawlMark& stackMark, AssemblyLoadContext assemblyLoadContext, RuntimeAssembly requestingAssembly, Boolean throwOnFileNotFound) at System.Reflection.Assembly.Load(String assemblyString) at Microsoft.UpdateServices.Administration.AdminProxy.CreateUpdateServer(Object[] args) at Microsoft.UpdateServices.Administration.AdminProxy.GetUpdateServer(String serverName, Boolean useSecureConnection, Int32 portNumber) at Microsoft.UpdateServices.Administration.AdminProxy.GetRemoteUpdateServerInstance(String serverName, Boolean useSecureConnection, Int32 portNumber) at iWSUS_Server.WSUSAPI..ctor(String sServerName, Int32 iPort, Logger pm_Logger) in C:\GitLab\Projects\iWSUS-Server\iWSUS_Server\Classes\WSUSAPI.cs:line 32

How can I fix this problem ?

I had developed a WCF service in Framework 4.7.2 with the same referenced dll and this was working properly.

Thanks per advance for your help :)

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745615655a4636219.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信