1

I checked related question in stackoverflow. It doesn't resolve my issue. I tried all that solution mention in stackoverflow. Unfortunately I can't resolve the error.

I tried these solution:(which is mentioned in SO)

  1. Check the Target framework version are all same.In my project I used .Net framework 4.5.1.I checked that.

  2. Reference properties->Copy Local-> True.

  3. Clean and ReBuild the solution.

In my project floder does not contain the specified project dll file.(projectfloder/bin/Debug)and I checked (obj/Debug)

I tried these above methods even though still I getting this issue.

Metadata file:'projectfloderpath\bin\Debug\projectname.dll' could not be found.

Means application shows that it can't able to find the dll.

User6667769
  • 745
  • 1
  • 7
  • 25
user688
  • 361
  • 3
  • 22
  • What dll that cannot be found? – Willy David Jr Apr 25 '17 at 05:55
  • You gave everything, except the dll name. Also can you give the SO link pls. – Nikhil Agrawal Apr 25 '17 at 05:55
  • @WillyDavidJr Metadata file:'projectfloderpath\bin\Debug\projectname.dll' could not be found. – user688 Apr 25 '17 at 05:56
  • @NikhilAgrawal [Link1](http://stackoverflow.com/questions/12992286/how-to-add-a-dll-reference-to-a-project-in-visual-studio) [Link2](http://stackoverflow.com/questions/1421862/metadata-file-dll-could-not-be-found) and more....... – user688 Apr 25 '17 at 06:04
  • 1
    Have you checked Configuration Manager on Build settings? Also you may change Build Order to include missing DLL in [related issue](http://stackoverflow.com/questions/898559/metadata-file-release-project-dll-could-not-be-found-in-visual-studio). – Tetsuya Yamamoto Apr 25 '17 at 06:05
  • @TetsuyaYamamoto Yes. All are checked. Configuration is Debug, Platform is Any CPU and Build is checked. – user688 Apr 25 '17 at 06:11
  • That's not what your question says, it talks about the Release configuration. In which case it of course should never be found, it got deleted when you used Clean. So this is all entirely normal. Surely you simply added the wrong reference. Do make sure you use a *project reference*, not a file reference. – Hans Passant Apr 25 '17 at 07:53
  • @HansPassant I used a project reference. – user688 Apr 25 '17 at 08:09
  • Your main app should be targeted to specific platform (Win32 or Win64 or sth else). Your dll should be targeted to AnyCPU. In your post you write that there is no dll in RELEASE folder and then give as a message that dll cannot be found in DEBUG folder. Maybe this is some kind of mistake. I understand that this dll is part of your solution, right? – Adam Jachocki Apr 25 '17 at 09:10
  • @AdamJachocki I edit my question. How can I get the missing DLL in the project folder – user688 Apr 25 '17 at 09:41
  • Is there any way to recover the deleted DLL in the project folder? – user688 Apr 25 '17 at 10:48

5 Answers5

0

Make sure your project .Net FrameWork Version same as to all project in the solution.

If your FrameWork Version 4.5.1 means, Make sure all your project having the same FrameWork Version 4.5.1 in your solution.

Hope it helps

User6667769
  • 745
  • 1
  • 7
  • 25
0

May be you have a mistake in the configuration of app work directory so the app looks in the wrong directory?

Or you may have incompatible platform settings of DLL and main application.

SENya
  • 1,083
  • 11
  • 26
  • Thanks, But I checked the directory . Its in a correct path – user688 Apr 25 '17 at 10:26
  • It depends also on the way you load dll - if it's loaded dynamically, then there can be a problem with the specified path. Sometimes VS for some reasons, unclear to me, breaks the references (here I mean normal references which you create in VS by "Add reference"). So, I had to delete reference from the project and add it once again. Also sometimes it wasn't enough and I had to manually edit project file, to specify the dll version. – SENya Apr 25 '17 at 10:38
  • Your right, I delete and re-added the references to the project. Still getting this error. – user688 Apr 25 '17 at 10:41
  • Can be an issue with the versions, may be you should look in the project file to see what version of the dll is specified there. Also, I'm not sure, but may be you could use AppDomain.CurrentDomain.AssemblyResolve event which happens when the resolution of assembly by CLR fails. – SENya Apr 25 '17 at 10:51
  • In my project folder, there is Missing DLL.How would I see the version of the dll? – user688 Apr 25 '17 at 10:59
  • Well, you can unload your main project in the VS (Context menu) and then edit a project file (Context Menu). Or open project file manually in some text editor. There you can see a version of dll which your project expect. I had a situation where for some reason the difference appeared between the actual version of dll and the expected one Also do you actually have the dll file in the specified folder? – SENya Apr 25 '17 at 11:27
  • if I change the target framework as 4.5.1 to 4.6. Doing this I get the DLL file in the project folder. But I need the version as 4.5.1. why because in my solution contain more number of projects all are should be in 4.5.1. when I changed the target version I got the dll. But I re changed as 4.5.1 then Dll got missing in that project folder. – user688 Apr 25 '17 at 11:36
  • Or. I think I get it. This dll file was built for .Net 4.6. So it's not compatible with previous versions of framework. – SENya Apr 25 '17 at 11:48
  • If you own this dll, you should rebuild it for .net 4.5.1. If not - then try to get appropriate version if it exists. Also may be you can switch your other projects to .Net 4.6? – SENya Apr 25 '17 at 11:49
  • Thanks for your help, I will try it. If It will work. I will make it as answer. – user688 Apr 25 '17 at 11:54
0

Make Sure build configuration of your projects is same. Any CPU/x86/x64

Aman Seth
  • 196
  • 6
0

Click Project > ProjectName Properties > Target Framework: Change from Client Profile to .NET Framework 4 or any version

ronIT
  • 1,035
  • 1
  • 9
  • 6
0

This error is solved to me like this: In the solution explorer press "show all files", then ReBuild project by project and then ReBuild the Solution, I hope it is the solution for you!