最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

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

matteradmin4PV0评论

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

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far