Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Namespace disappears when building RELEASE, but present on DEBUG

Tags:

c#

wpf

The System.Windows.Interactivity namespace vanishes when I swap from DEBUG build to RELEASE build. My project fails to build (naturally), and gives the error and warning visible in the images below. The namespace simply disappears from the Object Browser as soon as I switch build modes, even though the reference is still present in the Solution Explorer.

What's going on here?! And how do I fix it?

Debug Mode

Release Mode

like image 465
Zak A. Klajda Avatar asked Sep 01 '15 14:09

Zak A. Klajda


2 Answers

The reason can be you have linked to the dll that is placed inside Debug folder. If link shows relative path like ../my.dll when this dll will be not accessible from Release folder. You can replace relative link by full. But better solution will be moving dll above Debug and Release folder in folders hierarchy:

  1. place dll somewhere above Debug and Release folders
  2. remove old dll from References
  3. add new dll to References
like image 100
Vitalij Roscinski Avatar answered Nov 09 '22 16:11

Vitalij Roscinski


Take a look to your build configurations; you can open the .csproj file with some good editor (Vim, Sublime, Notepad++) and take a search the reference you're missing. It is possible to reference different libraries depending on the build configuration, so maybe the reference of this library is not included in the "Build | Release" mode, or it is defined specifically in the "Build | Debug" configuration section instead of the common one.

like image 40
Luis Avatar answered Nov 09 '22 15:11

Luis