Alturos.Yolo icon indicating copy to clipboard operation
Alturos.Yolo copied to clipboard

System.DllNotFoundException: 'Microsoft Visual C++ 2017-2019 Redistributable (x64)'

Open pmengal opened this issue 4 years ago • 29 comments

I get this exception when I try to use the nuget package in my own project. However, if I run the test GUI, everything run just fine. I also tried to reference the project directly and it ran correctly as well.

pmengal avatar Apr 19 '20 11:04 pmengal

On which platform (Any CPU, x64, x86) do you compile / debug?

actopozipc avatar Apr 20 '20 09:04 actopozipc

Hi. I had exactly same problem.

The reason that i found why is because the recent Microsoft Visual C++ 2017 - 2019 has the different name coded in YoloWrapper.cs where it finds the name from the registry(Microsoft Visual C++ 2015 - 2019) .

So if you followed the instruction in read.me, you will be fine with everything except "Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 und 2019 x64" in system Requirement part.

I think the main developer of the project is working on it, (thanks for the nice works) but before that i will share the Microsoft Visual C++ Redistributable file first so some people want to check the project result first.

vcredist_x64.zip

What you have to do is

  1. if you already downloaded and installed "Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 und 2019 x64" from the instruction, double click the file again and select remove.

  2. Download vcredist_x64.zip that I have uploaded above and unzip it.

  3. Install the file and test the project program.

If the problem is solved good for you. If not it would be other problem.

I set two pc and started from installing Win10 to start the project code. Everything worked fine.

win 10 pro / cuda 10.2 / cudnn 7.6.5 / alturos 2.6.4 / x64 debug

win 10 pro / cuda 10.1 / cudnn 7.6.3 / alturos 2.6.2 / x64 debug

Two versions were ok.

I think there are many people having same issue. So I am sharing.

Thank you and sorry for my bad english. (Hope you can understand : D )

And again I would like to thank the developers of this project for their hard works.

KoreanPro avatar Apr 21 '20 08:04 KoreanPro

My recommanded solution may not work on the recent alturos version(3 ~ 3.0.6).

Currently from the nuget package in Visual studio, the recent alturos I can get is version 2.6.4.

If those who can't find 3.0.6 you can download it from

https://www.nuget.org/packages/Alturos.Yolo/3.0.6-alpha

here.

image

See if the problem is solved.(The recent alturos version needs recent CUDA and CUDnn)

KoreanPro avatar Apr 29 '20 00:04 KoreanPro

I followed this but anyway I have new one error - "Could not load file or assembly 'Microsoft.Win32.Registry, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified."

IharrYeuseenka avatar May 16 '20 01:05 IharrYeuseenka

It worked for me... thanks

massaynus avatar May 23 '20 04:05 massaynus

@IharrYeuseenka Hello~ Did you solved the problem or any updates? What is your operating system, Cuda version, Cudnn version. I am not sure I can solve the problem but I will try to solve your problem.

OS : Cuda Version : Cudnn Version :

KoreanPro avatar May 26 '20 00:05 KoreanPro

I m facing the same problem,

Win 10 (will deploy on CentOS 7) Net Core 3.1 Cuda 11.0

Please help

dev-ptdi avatar Jun 15 '20 04:06 dev-ptdi

@dev-ptdi HI~ Is there reason why you are using cuda 11.0?(maybe running other program on cuda 11.0)

If that is not the reason, let's start from below version. Contact me afterward please

cuda 10.2 / cudnn 7.6.5 / alturos 2.6.4

KoreanPro avatar Jun 15 '20 06:06 KoreanPro

because the link always brings me to Cuda 11 and I did not find Cuda 10 there

dev-ptdi avatar Jun 15 '20 06:06 dev-ptdi

ok try below links~

cuda 10.2 : https://developer.nvidia.com/cuda-10.2-download-archive cudnn 7.6.5 : https://developer.nvidia.com/rdp/cudnn-download alturos 2.6.4 : You can find it in Nuget on your Visual Studio

you will need to log in for cudnn.

image

see if these works for you.

KoreanPro avatar Jun 15 '20 06:06 KoreanPro

Ok.. I am download it .. btw, does it support Net Core 3.1? .. or did I miss something?

Capture

dev-ptdi avatar Jun 15 '20 06:06 dev-ptdi

Sorry never tried Net Core yet.

At the moment I use .net Framework. Hope you can figure it out and succeed on the project.

KoreanPro avatar Jun 15 '20 07:06 KoreanPro

Ok, I have downloaded cuda 10.2, cudnn 7.6.5 and I copy cudnn64_7.dll in /bin folder

the problem still occurs :( .. I suspect this is because Net Core? .. since this is unconfirm to run on Net Core 3.1

Untitled

Capture

dev-ptdi avatar Jun 15 '20 07:06 dev-ptdi

You can see Microsoft Visual C++ 2015-2019 Redistributable in your second image, while in your first image it finds Microsoft Visual C++ 2017-2019 Redistributable.

So uninstall Microsoft Visual C++ 2015-2019 Redistributable first.

then download this zip file, unzip it and install.

Tell me what happens next.

vcredist_x64.zip

KoreanPro avatar Jun 15 '20 07:06 KoreanPro

Hi,

mine is: 14.26.28720 and suggested is 14.22.27821

mine is newest!, I confirm this only run on vcredist 14.22.27821

thanks

dev-ptdi avatar Jun 15 '20 08:06 dev-ptdi

Yes. Yours is newest.

Alturos version 2.6.x requires old vcredist.

You can use newest vcredist version on Alturos version 3. .

:-D good luck and have a good day.

KoreanPro avatar Jun 15 '20 08:06 KoreanPro

Now, I deployed it on CentOS 7.. does it support cross platform? why it uses Microsoft.Win32.Registry?

Object.DetectAsync: System.TypeInitializationException: The type initializer for 'Microsoft.Win32.Registry' threw an exception. ---> System.PlatformNotSupportedException: Registry is not supported on this platform. at Microsoft.Win32.RegistryKey.OpenBaseKeyCore(RegistryHive hKey, RegistryView view) at Microsoft.Win32.Registry..cctor() --- End of inner exception stack trace --- at Alturos.Yolo.YoloWrapper.IsMicrosoftVisualCPlusPlus2017Available() at Alturos.Yolo.YoloWrapper.GetEnvironmentReport() at Alturos.Yolo.YoloWrapper.Initialize(String configurationFilename, String weightsFilename, String namesFilename, Int32 gpu, Boolean ignoreGpu, Boolean ignoreCPlusPlusDetection) at Alturos.Yolo.YoloWrapper..ctor(YoloConfiguration yoloConfiguration, Boolean ignoreGpu) at PrimeAI.Models.Object.DetectAsync(Byte[] _bytes) in D:\Project\PTDigital\PrimeAI\Models\Object.cs:line 32

dev-ptdi avatar Jun 15 '20 09:06 dev-ptdi

Oh this project will not work in linux. The purpose of this project is to run yolo on C# in windows. In the discription on the project, it says "In the background we are use the Windows Yolo version of AlexeyAB/darknet."

If you want to run in centos or linux. Why not use AlexeyAB/darknet?

Alturos is C# package for windows.

KoreanPro avatar Jun 15 '20 23:06 KoreanPro

The Alturos.Yolo v2.6.x was run well before in my PC. However, I installed "Cuda 11.0" "cudnn v7.6.4" and "2015-2019 C++ redistributable" yesterday, and the project can't run then. The error is-- Alturos.Yolo.YoloInitializeException: 'Microsoft Visual C++ 2017-2019 Redistributable (x64)' .
Can anybody help me to fix it?

PHHUANG1970 avatar Jul 05 '20 05:07 PHHUANG1970

Hello @PHHUANG1970

Sorry for late reply. I was a bit busy..

I think the problem is your C++ redistributable is the recent one.

Alturos v2.6.x requires old redistributable.

Here is one for you.

vcredist_x64.zip

What you have to do is

  1. if you already downloaded and installed "Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 und 2019 x64" from the instruction, double click the file again and select remove.

  2. Download vcredist_x64.zip that I have uploaded above and unzip it.

  3. Install the file and test the project program.

If it didn't help let me know.

KoreanPro avatar Jul 13 '20 01:07 KoreanPro

@KoreanPro I have fixed my problem using the old version of vcredist_x64.zip. Thank you for your help.

PHHUANG1970 avatar Jul 19 '20 02:07 PHHUANG1970

Hi. I had exactly same problem.

The reason that i found why is because the recent Microsoft Visual C++ 2017 - 2019 has the different name coded in YoloWrapper.cs where it finds the name from the registry(Microsoft Visual C++ 2015 - 2019) .

So if you followed the instruction in read.me, you will be fine with everything except "Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 und 2019 x64" in system Requirement part.

I think the main developer of the project is working on it, (thanks for the nice works) but before that i will share the Microsoft Visual C++ Redistributable file first so some people want to check the project result first.

vcredist_x64.zip

What you have to do is

  1. if you already downloaded and installed "Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 und 2019 x64" from the instruction, double click the file again and select remove.
  2. Download vcredist_x64.zip that I have uploaded above and unzip it.
  3. Install the file and test the project program.

If the problem is solved good for you. If not it would be other problem.

I set two pc and started from installing Win10 to start the project code. Everything worked fine.

win 10 pro / cuda 10.2 / cudnn 7.6.5 / alturos 2.6.4 / x64 debug

win 10 pro / cuda 10.1 / cudnn 7.6.3 / alturos 2.6.2 / x64 debug

Two versions were ok.

I think there are many people having same issue. So I am sharing.

Thank you and sorry for my bad english. (Hope you can understand : D )

And again I would like to thank the developers of this project for their hard works.

However, when I use this in the unity project it didn't go well. (I have installed the new redistributable one and I can run Alturos on .NET core.)

Tyler871203 avatar Jul 31 '20 05:07 Tyler871203

Hi. I had exactly same problem.

The reason that i found why is because the recent Microsoft Visual C++ 2017 - 2019 has the different name coded in YoloWrapper.cs where it finds the name from the registry(Microsoft Visual C++ 2015 - 2019) .

So if you followed the instruction in read.me, you will be fine with everything except "Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 und 2019 x64" in system Requirement part.

I think the main developer of the project is working on it, (thanks for the nice works) but before that i will share the Microsoft Visual C++ Redistributable file first so some people want to check the project result first.

vcredist_x64.zip

What you have to do is

  1. if you already downloaded and installed "Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 und 2019 x64" from the instruction, double click the file again and select remove.
  2. Download vcredist_x64.zip that I have uploaded above and unzip it.
  3. Install the file and test the project program.

My problem is solved, thank you!

Kirill-Sakov avatar Dec 07 '20 23:12 Kirill-Sakov

For those of you who need to fix this in v2.x without installing a back version of the vcredist_x64.zip file provided by @KoreanPro, adding the details of the latest vcredist release number to the IsMicrosoftVisualCPlusPlus2017Available method in DefaultYoloSystemValidator.cs will solve the issue.

As of Feb 5th 2021, the redist is V14.28. You can find this by using Regedit and finding Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Dependencies\VC,redist.x64,amd64,14.28,bundle.

or similar for the version you have installed.

If you add { @"Installer\Dependencies\VC,redist.x64,amd64,14.28,bundle", "Microsoft Visual C++ 2015-2019 Redistributable (x64)" }

to the end of the dictionary of VC releases, as below, it should overcome the exception:

image

I hope this helps others trying to resolve the issue.

DarrenWray avatar Feb 05 '21 19:02 DarrenWray

Hi, I'm having this problem: WhatsApp Image 2021-02-24 at 15 00 50

I've already tried the solution of korean pro about the Microsoft Visual C++ 2015-2019 but it didn't work for me. I also added { @"Installer\Dependencies\VC,redist.x64,amd64,14.28,bundle", "Microsoft Visual C++ 2015-2019 Redistributable (x64)" } into checkKeys but nothing.

Anyone can help me ? I'm working on a i7 7th gen pc without graphic card (8GB ram)

M2V2 avatar Feb 24 '21 18:02 M2V2

Hi, I'm having this problem: WhatsApp Image 2021-02-24 at 15 00 50

I've already tried the solution of korean pro about the Microsoft Visual C++ 2015-2019 but it didn't work for me. I also added { @"Installer\Dependencies\VC,redist.x64,amd64,14.28,bundle", "Microsoft Visual C++ 2015-2019 Redistributable (x64)" } into checkKeys but nothing.

Anyone can help me ? I'm working on a i7 7th gen pc without graphic card (8GB ram)

Did you try looking in your registry (using Regedit) for the entry: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Dependencies\VC,redist.x64,amd64,14.28,bundle.

That will give you the name of the bundle name installed on your machine, it should match one of those in the DefaultYoloSystemValidator.cs file.

I hope that helps,

Darren

DarrenWray avatar Feb 25 '21 13:02 DarrenWray

Hi, I'm having this problem: WhatsApp Image 2021-02-24 at 15 00 50 I've already tried the solution of korean pro about the Microsoft Visual C++ 2015-2019 but it didn't work for me. I also added { @"Installer\Dependencies\VC,redist.x64,amd64,14.28,bundle", "Microsoft Visual C++ 2015-2019 Redistributable (x64)" } into checkKeys but nothing. Anyone can help me ? I'm working on a i7 7th gen pc without graphic card (8GB ram)

Did you try looking in your registry (using Regedit) for the entry: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Dependencies\VC,redist.x64,amd64,14.28,bundle.

That will give you the name of the bundle name installed on your machine, it should match one of those in the DefaultYoloSystemValidator.cs file.

I hope that helps,

Darren

I did it too, but not working, I put a list of bundles including that one that appears in HKEYLocal. Now I change PC, I will try on a i7 10th gen, 16GB RAM and RTX2070 hope that works!! I guess it's something about the graphic cards P.S: I also edited on YoloWrapper.cs all the parts where it enables the gpu I change to use cpu

M2V2 avatar Feb 25 '21 22:02 M2V2

@KoreanPro Thanks, it only worked after reinstalling vcredist_x64.zip

anvarj avatar Apr 10 '21 12:04 anvarj

Hi. I had exactly same problem.

The reason that i found why is because the recent Microsoft Visual C++ 2017 - 2019 has the different name coded in YoloWrapper.cs where it finds the name from the registry(Microsoft Visual C++ 2015 - 2019) .

So if you followed the instruction in read.me, you will be fine with everything except "Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 und 2019 x64" in system Requirement part.

I think the main developer of the project is working on it, (thanks for the nice works) but before that i will share the Microsoft Visual C++ Redistributable file first so some people want to check the project result first.

vcredist_x64.zip

What you have to do is

  1. if you already downloaded and installed "Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 und 2019 x64" from the instruction, double click the file again and select remove.
  2. Download vcredist_x64.zip that I have uploaded above and unzip it.
  3. Install the file and test the project program.

If the problem is solved good for you. If not it would be other problem.

I set two pc and started from installing Win10 to start the project code. Everything worked fine.

win 10 pro / cuda 10.2 / cudnn 7.6.5 / alturos 2.6.4 / x64 debug

win 10 pro / cuda 10.1 / cudnn 7.6.3 / alturos 2.6.2 / x64 debug

Two versions were ok.

I think there are many people having same issue. So I am sharing.

Thank you and sorry for my bad english. (Hope you can understand : D )

And again I would like to thank the developers of this project for their hard works.

thanks you! I have used it!

Dungiot avatar Apr 26 '21 07:04 Dungiot