1 minute read

Today I was busy working in one of WPF apps that I am holding from last few days. Everything is going on, I have made Release build 2 days ago 11 of July.

Suddenly I need to give it to another person. I delete package and hand over and come back and change to release and compile. Boom, Compile Failed.

Suddenly my first xaml file (Splash is also failed to work). It's happen in morning, Could be disaster because I just finished my work. I restore the package from Recycle bin but still nothing compiled.

I first individually go to to my splash.xaml.cs and import all namespace. ( I am not sure how they gone by just change to Release). 

The problem in my case was

Nuget.org Aka Nuget Gallery doesn't have any information about 103 version (2016). It's failed to restore from Nuget site. I see that it's also have reference in my .csproj file. I upgrade to 108 (which is latest but VS doesn't remove 103 from .csproj and not done anything). My project might have reference to 108 Sqlite dll but it's  referenced to 103. 

This means

103 will not be copied to my executable directory since my package folder doesn't exist or empty or don't have that DLL. 

VS will not be able to help since they are not exist anymore, I am not sure what VS do internally, maybe it's assume that my reference are local from my system.

I remove the 103 version by uninstall it, The bad thing is VS not remove 103 from .csproj (2 time mentioned in .csproj file). I opened my .csproj file and remove it manually.

I install the 108 version of Sqlite in my WPF C# project and now everything work awesome. If you stuck in situation like this, Better have a old backup (or git repos something), Try to learn some .csproj file, It's helpful if you stuck in situation like this.

Few days ago I stuck in xamarin issue that the code I compile (XAML,C#,UWP) is not match with the code I have, Later I got help from Nico on Stackoverflow on this issue and thing become running flawlessly.

Here is the reference to that answer https://stackoverflow.com/a/51166764/713789