question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error with .netcore project

See original GitHub issue

Hi,

I’m converting the sidebardiagnostics project to .net core, and running into an issue. I changed the dependency to librehardwaremonitor’s .net standard build, but it still fails due to a (seemingly) .net framework issue. Error report:

{"Could not load file or assembly 'System.Management, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.":"System.Management, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"}

Stacktrace: " at OpenHardwareMonitor.Hardware.SMBIOS..ctor()\r\n at OpenHardwareMonitor.Hardware.Computer.Open()\r\n at SidebarDiagnostics.Monitoring.MonitorManager..ctor(MonitorConfig[] config) in C:\\Users\\Robin\\Documents\\SidebarDiagnostics\\SidebarDiagnostics\\Monitoring.cs:line 34\r\n at SidebarDiagnostics.Models.SidebarModel.InitMonitors() in C:\\Users\\Robin\\Documents\\SidebarDiagnostics\\SidebarDiagnostics\\SidebarModel.cs:line 100\r\n at SidebarDiagnostics.Models.SidebarModel..ctor() in C:\\Users\\Robin\\Documents\\SidebarDiagnostics\\SidebarDiagnostics\\SidebarModel.cs:line 14\r\n at SidebarDiagnostics.Sidebar.<<BindModel>b__10_0>d.MoveNext() in C:\\Users\\Robin\\Documents\\SidebarDiagnostics\\SidebarDiagnostics\\Sidebar.xaml.cs:line 180\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.GetResult()\r\n at SidebarDiagnostics.Sidebar.<BindModel>d__10.MoveNext() in C:\\Users\\Robin\\Documents\\SidebarDiagnostics\\SidebarDiagnostics\\Sidebar.xaml.cs:line 172\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.GetResult()\r\n at SidebarDiagnostics.Sidebar.<Initialize>d__7.MoveNext() in C:\\Users\\Robin\\Documents\\SidebarDiagnostics\\SidebarDiagnostics\\Sidebar.xaml.cs:line 107\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.GetResult()\r\n at SidebarDiagnostics.Sidebar.<Window_Loaded>d__19.MoveNext() in C:\\Users\\Robin\\Documents\\SidebarDiagnostics\\SidebarDiagnostics\\Sidebar.xaml.cs:line 245"

Can anyone help me out why this error is happening?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
ThaChilleracommented, Feb 1, 2020

Thanks, this solved it, it was indeed a dependency issue.

0reactions
ottovillescommented, Jul 24, 2020

Hi @Phyxion!

This is an old issue, but I’m facing very similiar problem so I did not create a new issue. After adding a reference to System.Management, cleaning and building the project a new dependency problem appeared. This time error message was:

System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Threading.AccessControl, Version=4.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.'

I installed a refrence to System.Threading.AccessControl via NuGet package manager, cleaned and build the project and tried to run it again. This error was resolved, but new error appeared:

System.MissingMethodException: 'Method not found: 'Void System.Threading.Mutex..ctor(Boolean, System.String, Boolean ByRef, System.Security.AccessControl.MutexSecurity)'.'

Any ideas how to solve this error?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handle errors in ASP.NET Core
Discover how to handle errors in ASP.NET Core apps. ... For an MVC app, the project template includes an Error action method and...
Read more >
ASP.Net Core: Hundreds of Build Errors Suddenly
What might cause an ASP.Net Core web application to display hundreds of build errors suddenly without explanation? I suspect you broke something ......
Read more >
Handle errors in ASP.NET Core web APIs
Show 2 more. This article describes how to handle errors and customize error handling with ASP.NET Core web APIs.
Read more >
After upgrading to ASP.NET Core 2.1, get error that project ...
Here is the error I receive when I build the application after upgrading to 2.1, The project was restored using Microsoft.NETCore.
Read more >
Building a .NET Core project not working · Issue #512
NET Core Web application. Visual Studio isn't generating any files in my bin folder. ... I don't have this problem when I create...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found