Hoping someone can help. I tried to enable the logging feature in my code. When I finished and killed out my dashboard. I now cant launch any dashboards again. I tried disabling the logging but nothing helps, I now just get an error as follows:
Application startup exception: System.MissingMethodException: Method not found: ‘Microsoft.Extensions.Logging.ILoggerFactory NLog.Extensions.Logging.ConfigureExtensions.AddNLog(Microsoft.Extensions.Logging.ILoggerFactory)’.
at UniversalDashboard.ServerStartup.Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IApplicationLifetime lifetime)
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
I will look but this only happend after I enabled logging. No other items are being loaded.
So not sure how this would have happened. Any other thoughts? I was also running this directly from the powershell window and closing/reopening did not solve.
Can you verify that no other modules are loaded? Have you updated anything on this server? .NET Version specifically.
Some assembly is conflicting with the NLogger assembly.
Try running this:
[System.AppDomain]::CurrentDomain.GetAssemblies()
It should give you a list of the assemblies that are loaded and where they are loaded from. We are looking for NLog assemblies and Microsoft.Extensions.Logging.
You can’t unload assemblies, like the one from Devolutions, once they are loaded into .NET. We need to figure out how that assembly is being loaded. Does Remote Desktop Manager have a PS module or is the Devolutions folder on the PSModulePath or PATH?
I’d check $Env:PSModulePath and $Env:PATH to see if it’s on either one of those. The other thing that could be happening is that when UD tries to load those assemblies, it’s finding the one in the RD Manager folder rather than UD for some reason.
So, I have been using devolutions powershell inside the PUD pages with no problems until the other day when I enabled the debugging on a new page. Since then PUD has been giving this error. So I imagine that when I enabled logging it also enabled it for the devolutions powershell too?
For the Devolutions powershell, I have to load it at the start of the scripts, but as I said that has never been an issue until the enable-udlogging was used. tried using disable-udlogging but that has not helped.
I don’t think you will be able to use Enable-UDLogging if you are loading that module. There will always be this assembly loading issue as all the assemblies are loaded into the same process. You might be able to enable logging first and then load the Devolutions PowerShell module second but that may give you problems executing commands in Devolutions.
As I mentioned before, it’s one of the big reasons for the architecture change in PowerShell Universal. It avoids these assembly loading problems by not loading those common assemblies into the same process as the PowerShell modules.
Ok right now my company is not willing to pay for it, and I have a number of PUD’s running but they all fail. I was only testing the logging one time not using it all the time and that seems to have broken everything. I can just rebuild a new windows server and move everything over and it will work again I was just trying to avoid that work. But if there is no other choice then I will. What ever happened the first time I loaded the logging has busted the setup for all services. Puds that where already running are still up its only when you try and launch new ones.
Can I use PU for free in the same way and just run seperate dashboards? Is it the same product? How would I move over to it?
You can still use PU for free. It has pretty much the same licensing setup as UD and UD Community. You can run dashboards without authentication without having to buy anything. It has a v2.9 framework version of UD you can use your existing dashboards with. There are some changes you’ll need to make but those are documented here: https://docs.ironmansoftware.com/dashboard/dashboards/migrating-from-universal-dashboard-2.9
I realize it’s still a switch and work but I don’t know exactly why just enabling logging would cause this issue you all of a sudden. Enabling logging doesn’t persist anything anywhere except a log file. It seems like something has changed on the system, like upgrading the Devolutions module, that could cause this but you’ve already mentioned that nothing has changed so I’m unsure what’s happening.
The root cause is that there is an assembly version conflict with UD and Devolutions module.
Yeah very strange that this happened. Ok so I will look at the changes and build a new server and migrate. Thanks for all your help trouble shooting. Just one of those ghost in the machine moments.