-
-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MSBuild AssemblyVersion property should always have 4 integer components #26
Comments
Thanks for reporting this, @adrianvmsft. We only just started setting the |
It doesn't find the assembly in memory (it is already loaded) because it ends up comparing "14.1" against "14.1.0.0". I know, perhaps the comparison should succeed but it doesn't. In that case you end up in a situation where the assembly is already loaded, but it tries to load it anyways and if that fails it throws exception. I think it is a corner case - I encountered it with a VS extension that has WPF UI. |
I see. I suspect that .NET considers versions to always have 4 components, but this project initializes the MSBuild property with only 2. If we force it to always be 4 components long, in effect like this:
Then that should resolve it. Do you agree? |
I have confirmed that the CLR always considers that an AssemblyVersion has 4 integer components to it, regardless of how it is formatted in the |
GitVersioning may interfere with Markup Compilation for WPF applications and cause assembly load exception at runtime
This may not be a common scenario, and it has a simple workaround, so may not need a fix. I am logging it here in case other people encounter it.
Symptom: System.IO.FileLoadException thrown when wpf is trying to load resources in InitializeComponent
Background:
Workaround: Insert the following snippet in the affected projects
This will clear up the AssemblyVersion right before the MarkupCompilePass1 target gets executed. This will cause the version not to be specified in the generated file, and it will successfully match the assembly against the version already loaded in memory
The text was updated successfully, but these errors were encountered: