Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't build release configuration because of 'missing' references

I've got a solution containing 6 or so projects which all build fine when in debug configuration. However, when I try and build it in release mode, I get 53 errors all complaining that DLL's can't be found. This is just a few of the messages:

Errors:

  • 'AnimatedSplashScreen' does not contain a definition for 'Message' and no extension method 'Message' accepting a first argument of type 'AnimatedSplashScreen' could be found (are you missing a using directive or an assembly reference?)
  • The name 'DataContext' does not exist in the current context.
  • The name 'InitializeComponent' does not exist in the current context.
  • The tag 'MetroProgressBar' does not exist in XML namespace 'clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro'.39

Warnings

  • Could not resolve this reference. Could not locate the assembly "EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
  • Could not resolve this reference. Could not locate the assembly "Fluent, Version=3.5.1.198, Culture=neutral, PublicKeyToken=3e436e32a8c5546f, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
  • Could not resolve this reference. Could not locate the assembly "GalaSoft.MvvmLight, Version=5.2.0.37222, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

How do I start to fix this?

The debug paths have been left as they are, but each project release path has been set to build into a specific folder.

EDIT: This is what my Error List looks like. All of the errors appear to be related to third party packages. Errors and Warnings

like image 547
Jake Avatar asked Oct 19 '15 10:10

Jake


People also ask

How do I fix missing references in Visual Studio?

To fix a broken project reference by correcting the reference path. In Solution Explorer, right-click your project node, and then select Properties. The Project Designer appears. If you're using Visual Basic, select the References page, and then click the Reference Paths button.

How do I set Release configuration?

In Solution Explorer, right-click the project and choose Properties. In the Configuration list, choose Debug or Release. In the side pane, choose Linker > Debugging, then select options for Generate Debug Info. In most C++ projects, the default value is Generate Debug Information (/DEBUG).

How do I compile in Release mode?

To compile in release mode, we just need to add the --release flag to the flutter run command and have a physical device connected.


3 Answers

I had a similar problem. Project builds fine in Debug mode but in Release mode some references were missing.

I found out, the dll's of the missing references were all located in the bin/debug folder. I moved them towards a neutral location, added them again to the project and the problem was solved.

like image 88
Ephedra Avatar answered Nov 01 '22 07:11

Ephedra


As pointed out by Filburt. There were some broken reference paths in the project files. After correcting these paths, everything builds as expected.

Not sure how they got broken to begin with though. Any thoughts?

like image 38
Jake Avatar answered Nov 01 '22 07:11

Jake


I was facing the same issue when I changed from Debug to release mode. I was trying different suggestions posted above but nothing has solved the issue. However, for me, when I did right click on Reference > Migrate packages.config to PackageReference... select OK, it started working.

Right-click References

like image 1
SavindraSingh Avatar answered Nov 01 '22 08:11

SavindraSingh