Capgemini / Cauldron

C# Toolkit
MIT License
76 stars 18 forks source link

[Cauldron.Interception.Fody] Wrong version of Cauldron.Interception.Fody referenced #74

Open Dhairya-Sangoi opened 5 years ago

Dhairya-Sangoi commented 5 years ago

Hey,

I have a doubt regarding how Fody chooses which version of the weaver to use.

Let's say, there is a solution having multiple projects, each using different version of Cauldron (Cauldron.BasicInterceptors). Each version of Cauldron brings a corresponding compatible version of Cauldron.Interception.Fody (which is the actual addin of Fody). Now, will Fody choose right version of Cauldron.Interception.Fody, or it would always choose the latest version available in the packages folder?

If we try to build such a solution, then the build fails for the project consuming lower version of Cauldron. I guess this is the expected behavior.

The link AddinSearchPaths mentions that Fody would always take the latest version of the addin.

Could you please help by asserting this assumption.

reflection-emit commented 5 years ago

Yea I have the problem too with different Fody versions. If Fody finds a newer Addin version in the package folder Fody will use it. Following issue is related to this problem: https://github.com/Fody/Fody/issues/524

Dhairya-Sangoi commented 5 years ago

Thanks for the quick reply. I am using PackageReference in my project. But still it doesn't resolve to the correct Addin version. I think, this is the limitation of fody, coz it doesn't know which version of the Addin we are using (maybe because it doesn't parse the csproj/packages.config file to lookup for the version information)

reflection-emit commented 5 years ago

Just found this... https://github.com/Fody/Fody/pull/557 I will look into this... Maybe it fixes these problems.