1

I'm creating a program in visual studio using the fly capture camera libraries. My goal is to build the program into a standalone application. When run in debug mode the program behaves normally, but in release mode I get a 'System.IO.FileNotFoundExeception':

Could not load file or assembly 'FlyCapture2Managed_v140.dll' or one of its dependencies. The specified module could not be found.

So I'm missing a dll file, but why do I only get this error in release mode? How can I properly link the file in visual studios?

Jaitnium
  • 621
  • 1
  • 13
  • 27
  • 1
    "or one of its dependencies" would be a likely explanation whenever you work with a camera. Be sure to copy any firmware DLLs with a post-build event, copy-paste the one you use in the Debug build into the one for the Release build. Do avoid forcing us to guess at this. – Hans Passant Dec 06 '17 at 17:23
  • @HansPassant Could you reference me to an article/video where I can learn to do this? I'm new to visual studios. – Jaitnium Dec 06 '17 at 17:57

3 Answers3

4

If you right click on the reference, select properties, then set 'Copy Local' to True it will be published when you release a build.

Sean T
  • 2,414
  • 2
  • 17
  • 23
3

Check uour configuration, you just need to desactivate OptimzeCode.

1-Right click on your Project, click on Properties 2-go to tabItem Build, in section General desactivate Optimize Code.

enter image description here

ChrisMM
  • 8,448
  • 13
  • 29
  • 48
1

Check your configuration, it may well be that you release configuration isn't set to build the project that produces 'FlyCapture2Managed_v140.dll'.

Right-click on your solution, select Configuration Manager, choose Release configuration and confirm the project has the Build column ticked.

Jynx
  • 90
  • 4
  • Yep, looks good - in which case I assume your reference is an external one, in which case see Sean T's answer and try that. If not, then I would suggest posting your project file. – Jynx Dec 06 '17 at 17:30