mhutch / MonoDevelop.AddinMaker

Extension to make it easier to create Visual Studio for Mac / MonoDevelop extensions
MIT License
50 stars 26 forks source link

Allow setting dependency to older MD/addin versions #19

Closed cwensley closed 7 years ago

cwensley commented 9 years ago

The required version for addin references doesn't seem to have an effect.

I've set it in the properties of the reference in Xamarin Studio, and it saves to the .csproj. However, the built addin dll has an AddinDependency attribute with the current version, not the explicitly specified version.

I believe this line is the culprit, where it uses the addin's current version rather than checking if something is specified by addinName.GetMetadata("Version") first.

Also, there does not seem to be a way to specify the required version for MonoDevelop.Core and MonoDevelop.Ide.. unless I missed something? I tried adding the AddinDependencyAttribute to the assembly with an explicit required version, but it was just duplicated by the addin with the current version of Xamarin Studio.

mhutch commented 8 years ago

The version on an addin reference is a compile-time check, i.e. the version you have at compile time must be compatible with the version specified in the reference.

However, the generated dependencies currently all use the versions that were resolved at compile time. I could allow explicitly overriding this (at your own risk) but it would need another metadata value, and I'm not sure how to surface it for the core addins.

cwensley commented 8 years ago

Ah, ok, I misunderstood what the addin reference version was for. Thanks for clarifying!

I ran into this trying to test my addin on linux with md 5.10 when compiled with 5.10.1 on OS X. Given that monodevelop.com doesn't list previous version downloads (afaik?), it makes it hard to build and test an addin with an older version.

If there's gotcha's that this would expose then it's probably not worth doing, and just using an older version is a better way.. Just need to find those downloads! (;

mhutch commented 7 years ago

This is now fixed :)

The fix will go out next time I update the NuGet.

cwensley commented 7 years ago

Awesome, thanks for getting around to this! It'll definitely come in handy trying to support specific versions. (;