I do not understand where to look for the error. Debug works fine.

An unhandled exception of type "System.Windows.Markup.XamlParseException" in PresentationFramework.dll Additional Information: Setting the property "System.Windows.Controls.Primitives.RangeBase.Value" caused an exception.

System.Windows.Markup.XamlParseException not processed Message: An unhandled exception of type "System.Windows.Markup.XamlParseException" in PresentationFramework.dll Additional information: The setting of the property "System.Windows.Controls.Primitives.RangeBase.Value" caused an exception.

Does not reach to

InitializeComponent(); 

Does not reach to

  public partial class App : Application { App() { } } 

Yes Removed "Only my code" and send errors

More information: The assembly "WpfXamlDiagnosticsTap" was downloaded from "file: /// C: /Users/7636~1/AppData/Local/Temp/VisualStudio.XamlDiagnostics.9236/WpfXamlDiagnosticsTap.dll" using the LoadFrom context. Using this context can lead to unexpected behavior during serialization, type casting, and dependency resolution. In almost all cases, it is recommended to avoid using the LoadFrom context. This can be achieved by installing assemblies in the Global Assembly Cache or in the ApplicationBase directory and using Assembly.Load when explicitly loading assemblies.

{"An attempt was made to load a program that has the wrong format. (Exception from HRESULT: 0x8007000B)"}

  • Show your XAML code - RusArt
  • check your properties, the compiler may not understand AccelerationRatio = ". 9" and must be set as AccelerationRatio = "0.9". Does not speak a line on which swears? - user2455111
  • @ user2455111 It does not reach InitializeComponent (), then it is definitely not XAML - RusArt
  • And Value at you is not attached anywhere? Any ProgressBar , for example? - Surfin Bird
  • Give the full error text of the call stack, please - RusArt

2 answers 2

In order to catch an error, you need to catch an exception at the stage of its occurrence. To do this in VisualStudio you need to press the key combination:

Ctrl + Alt + E

Then, in the window that appears, put a check mark on the Common Language Runtime Exceptions , although tick all the check boxes, it is possible that not only it should be ticked, as far as I remember, here:

enter image description here

After that, you can look at the Inner Exception and catch the error.

An attempt was made to download a program that has the wrong format.

Here the essence of the problem seems to be clarified. The problem is that some library refuses to work under x64, so it’s a 32-bit build. I think that all the same problem in the assembly settings. Go to Configuration Manager :

enter image description here

We go inside and what we do, we see (this is for example):

enter image description here

And we do for Release same build settings in the projects and the solution.

And we go here:

Project Properties -> Build -> Platform Target

And we look at what we have in Debug and in Release , we look for differences and fix them. I think x86 should fix the problem.


The solution was trivial. As it turned out, the reason that the build didn't work was that there were libraries compiled for 64 and 32-bit digits. What it took to build the project worked: to clear the solution, to restore the NuGet packages (since I did not have them), in the settings for building the solution, it was necessary to put Any CPU in the Debug and Release . Reopen VisualStudio (for the author of the question). After that, the construction of the project earned in both configurations.

  • Added screen. I can not get more information about the error. Or I do not see stupidly - Paul Anuliev
  • @ Anuliev Pavel, that with libraries in folders, I added at the end of the answer. - Denis Bubnov
  • @DenisBubnov I'm talking about the same thing - RusArt
  • Bass does not want to work. - Pavel Anuliev
  • one
    I would love to see what is wrong, it is interesting to understand. Maybe on Github or Bitbucket you fill in the project? I 'll try to help in the evening then) - Denis Bubnov

If you are compiling Debug and not compiling Release, then most likely some kind of library is missing. Compare the contents of the debug and release folders, copy the missing files in the release.

  • I also thought about it. There are bass.dll with which there were problems in debug. Bass.Net.dll is connected via a link, a bass.dll is in the project root and is compiled as "Content". But in any case, it appears during assembly in a folder - Pavel Anuliev
  • @ AnulievPavel Check also the digit capacity match, try to install x86 - RusArt
  • x64, x86, Anu CPU - all the same - Pavel Anulev
  • @ AnulievPavel Try to set properties for bass.dll: action at build - no, copy to output directory - always copy - RusArt
  • Made - the same mistake - Pavel Anuliev