简体   繁体   中英

How to solve side-by-side configuration error in Viual Studio during import dll

I am using Visual Studio 2017 and Windows 10. I received two solutions from my teacher on university. I do not know in which visual studio and on which OS it was coded. One of them is solution which contains two projects(dll source code and code to test functions in dll). Second solution contains project of application. When I run my first solution I create dll file in Release mode and I also test it. Everything works good and source code is fine. But when I run second solution in which I include functionality of dll file using DllImport I got error which tell me "'Unable to load DLL 'file.dll': The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail."

I got error information using Event Viewer "Dependent Assembly Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8" could not be found.". So I realized I miss Visual C++ redistributable package 9.0.21022.8. Of course I installed it and on the occasion few another versions. Unfortunately it did not help me.

It seems very weird for me. First of all I can compile and run dll source code but I can not include it into another project. I think it can be caused because of some solution/project properties in dll or application but I can not find what could I change. I have tried to change Solution->Debug Source File properties because there were paths to folders Visual Studio 9.0/VC which I do not have so I changed it to my paths Visual Studio 10.0/VC but it also did not help me.

What else could I do?

Most likely you've installed the x64 (64-bit) redistributables and you are missing the x86 (32-bit) redistributables. You need to download them separately. If you do have both, then you probably had linked against the 64bit version instead of the 32bit version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM