最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin2浏览0评论

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 :)

发布评论

评论列表(0)

  1. 暂无评论