Support Forums

Could not load file…
 
Notifications
Clear all

[Solved] Could not load file or assembly 'Microsoft.Win32.Primitives' or one of its dependencies.

12 Posts
2 Users
0 Likes
1,336 Views
Posts: 0
Topic starter
(@Anonymous)
Joined: 1 second ago

Hello. When I’m trying to open CloudPanel web page, I’m getting a IIS Error. Full error message attached bellow.

Server Error in ‘/CloudPanel’ Application.
Could not load file or assembly ‘Microsoft.Win32.Primitives’ or one of its dependencies. An API call exited abnormally. (Exception from HRESULT: 0x800300FA (STG_E_ABNORMALAPIEXIT))
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileLoadException: Could not load file or assembly ‘Microsoft.Win32.Primitives’ or one of its dependencies. An API call exited abnormally. (Exception from HRESULT: 0x800300FA (STG_E_ABNORMALAPIEXIT))

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[FileLoadException: Could not load file or assembly 'Microsoft.Win32.Primitives' or one of its dependencies. An API call exited abnormally. (Exception from HRESULT: 0x800300FA (STG_E_ABNORMALAPIEXIT))]
   Nancy.Helpers.ProxyNancyReferenceProber.HasReference(AssemblyName assemblyNameForProbing, AssemblyName referenceAssemblyName) +0
   Nancy.AppDomainAssemblyCatalog.LoadNancyReferencingAssemblies(IEnumerable`1 loadedAssemblies) +623
   Nancy.AppDomainAssemblyCatalog.GetAvailableAssemblies() +21
   System.Lazy`1.CreateValue() +734
   System.Lazy`1.LazyInitValue() +189
   Nancy.DefaultTypeCatalog.GetTypesAssignableTo(Type type) +35
   System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory) +88
   Nancy.DefaultTypeCatalog.GetTypesAssignableTo(Type type, TypeResolveStrategy strategy) +147
   Nancy.Bootstrapper.NancyBootstrapperLocator.GetBootstrapperType(ITypeCatalog typeCatalog) +91
   Nancy.Bootstrapper.NancyBootstrapperLocator.LocateBootstrapper() +119
   Nancy.Bootstrapper.NancyBootstrapperLocator.get_Bootstrapper() +48
   Nancy.Hosting.Aspnet.NancyHttpRequestHandler.GetBootstrapper() +39
   Nancy.Hosting.Aspnet.NancyHttpRequestHandler..cctor() +21

[TypeInitializationException: The type initializer for 'Nancy.Hosting.Aspnet.NancyHttpRequestHandler' threw an exception.]
   Nancy.Hosting.Aspnet.NancyHttpRequestHandler..ctor() +0

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +142
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +107
   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) +1476
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +186
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +28
   System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +80
   System.Web.Configuration.HandlerFactoryCache..ctor(String type) +33
   System.Web.HttpApplication.GetFactory(String type) +98
   System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +493
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +220
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +134

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4330.0

CloudPanel version 3.2.0335.0

Env: WS Server 2016 with AD, SQLEXPRESS and CloudPanel. 

Last updates was installed in March 2021.

11 Replies
Posts: 1563
Admin
(@jdixon)
Noble Member
Joined: 9 years ago

This was working and just all of sudden this happened? What happens if you stop the CloudPanel application pool, wait a few minutes and start it again?

Reply
10 Replies
(@Anonymous)
Joined: 1 second ago

Posts: 0

@jdixon Yes, I just installed it in March, copied all data from old infrastructure and didn’t open CP about half year.
Tried:
Restart site in IIS
Restart App Pool
Recycle App Pool
Reboot server

So now I started CP installer from Windows Control Panel and choose “Repair” option and it stuck in “Extracting files from archive” step.

Reply
Admin
(@jdixon)
Joined: 9 years ago

Noble Member
Posts: 1563

@w3xtr What I would do is backup the CloudPanel folder, uninstall, then reinstall CloudPanel but check the checkbox to NOT update the database. This will install all the files fresh and link it back to your existing SQL database. Then if you had documentation stuff or branding, you can copy the files from the folder you backed up to the new one. We haven’t actually had anyone have this issue before but it seems like the Microsoft.Win32.Primitives dll is missing somehow.

There should be a Microsoft.Win32.Primitives.dll in the BIN folder where CloudPanel is. Can you tell me what file version it says on the details tab under properties?

Reply
(@Anonymous)
Joined: 1 second ago

Posts: 0

@jdixon Here is screenshot with Microsoft.Win32.Primitives.dll from C:\Program Files x86\Know More IT\CloudPanel\BIN folder. 
If I understand correctly, I need to backup CloudPanel folder from Program Files, then uninstall and reinstall same CP version without updating database?

Reply
Admin
(@jdixon)
Joined: 9 years ago

Noble Member
Posts: 1563

@w3xtr Before you do that, can you make sure the DLL isn’t blocked under the properties?

Reply
(@Anonymous)
Joined: 1 second ago

Posts: 0

@jdixon What did you mean by “isn’t blocked”?

Reply
Admin
(@jdixon)
Joined: 9 years ago

Noble Member
Posts: 1563

@w3xtr When you copy files across the network to other servers Windows will sometimes block DLL files:

dll file won't load - How to unblock a dll file? - CloudShell Community

Reply
(@Anonymous)
Joined: 1 second ago

Posts: 0

@jdixon Yes, this dll isn’t blocked.

Reply
Admin
(@jdixon)
Joined: 9 years ago

Noble Member
Posts: 1563

@w3xtr Ok. Make a copy of the CloudPanel folder and put it some where else, backup the SQL database, then uninstall CloudPanel from the Programs and Features. Then either install the same version or the latest version but click on the checkbox on the SQL page of the install to not update/change the database during the install. Make sure you point it back to your existing database.

If that doesn’t work then I will have to connect and look.

Reply
(@Anonymous)
Joined: 1 second ago

Posts: 0

@jdixon Ok. I reinstalled CP, but I think that I did mistake. In install wizard I checked box “Skip database configuration” and now I’m getting error “Unable to complete operation. The supplied SqlConnection does not specify an initial catalog or AttachDBFileName.”

Reply
Admin
(@jdixon)
Joined: 9 years ago

Noble Member
Posts: 1563

@w3xtr You are going to have to connect me so I can look: https://bit.ly/3blYNOu

Reply
Share: