Page 1 of 1

Could not load file or assembly 'System.Diagnostics.PerformanceCounter

Posted: Thu 14 Mar 2019 20:59
by srinivaskacham
Hello,

We bought license for DevArt DotConnect Oracle Professional 9.6. Installed successfully and referenced below .dlls from installed folder (C:\Program Files....) to the project.

1. DevArt.Data
2. DevArat.Data.Oracle.
3. DevArt.Data.Oracle.EFCore (9.6.646) - from Nuget copy

I am getting below error when I run my Asp.Net Core application.
System.IO.FileNotFoundException: Could not load file or assembly 'System.Diagnostics.PerformanceCounter, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
File name: 'System.Diagnostics.PerformanceCounter, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
at CPQ.Web.Areas.Common.Controllers.BaseController.HandleException(Exception ex, String Message) in



I am not getting any error when I reference above references from NuGet.

I am confused and am not sure what is the correct way to reference these dlls?

Thanks in Advance.

Re: Could not load file or assembly 'System.Diagnostics.PerformanceCounter

Posted: Fri 15 Mar 2019 12:39
by Shalex
Current implementation of dotConnect for Oracle includes two sets of assemblies:

a) the .NET Framework Devart.* assemblies which are shipped with installation:
* assemblies are created in C:\Program Files (x86)\Devart\dotConnect\Oracle\ , GAC 2.0 (C:\Windows\assembly\GAC_MSIL\), GAC 4.0 (C:\Windows\Microsoft.NET\assembly\GAC_MSIL\)
* licensing approach is described at https://www.devart.com/dotconnect/oracl ... nsing.html

b) the .NET Standard (.NET Core) Devart.* assemblies which are available via NuGet:
* you can download packages from https://www.nuget.org/packages/devart.d ... cle.efcore
* licensing approach is described at https://www.devart.com/dotconnect/oracl ... ndard.html
srinivaskacham wrote:I am getting below error when I run my Asp.Net Core application.

Code: Select all

System.IO.FileNotFoundException: Could not load file or assembly 'System.Diagnostics.PerformanceCounter, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
You should not mix up .NET Standard and .NET Framework provider assemblies in the same application. If target framework of your project is .NET Standard (or .NET Core), please install all Devart.* assemblies from nuget.

If this doesn't help, specify:
1) Target framework set in the properties of your project
2) run the project in the debug mode, navigate to Debug > Windows > Modules and tell us the Path values of Devart.* assemblies loaded in the process of your application