Dear support team,
We have been using Syncfusion.AspNet.Mvc5 package for some time now, and decided to also use EJ2 essentials (Syncfusion.EJ2.MVC5) and ran into reference package version incompatibility. Maybe you could help.
We have a AspNet .NET 4.6.1 MVC 5 application, which now references (through PackageReference, Nuget) both Syncfusion.AspNet.Mvc5 and Syncfusion.EJ2.MVC5 at version 18.1.0.44 (but any version would give the same effect). Both those packages reference Syncfusion.Licensing in order to activate the license with a key. However, as seen in the dlls folder, Syncfusion.AspNet.Mvc5 is a .NET 4.6 package which downloads .NET 4.6 Syncfusion.Licensing.dll, while Syncfusion.EJ2.MVC5 is a .NET 4.5 package so it is looking for a compatible .NET 4.5 Syncfusion.Licensing.dll which is not there. As a result we get the following error:
Could not load file or assembly 'Syncfusion.Licensing, Version=18.1450.0.44, Culture=neutral, PublicKeyToken=632609b4d040f6b4' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Currently our .csproj looks like this
<PackageReference Include="Syncfusion.AspNet">
<Version>18.1.0.44</Version>
</PackageReference>
<PackageReference Include="Syncfusion.AspNet.Mvc5">
<Version>18.1.0.44</Version>
</PackageReference>
<PackageReference Include="Syncfusion.Compression.Base">
<Version>18.1.0.44</Version>
</PackageReference>
<PackageReference Include="Syncfusion.EJ2.MVC5">
<Version>18.1.0.44</Version>
</PackageReference>
I tried methods from a blog post https://michaelscodingspot.com/how-to-resolve-net-reference-and-nuget-package-version-conflicts/ but assembly binding didn't really work for me. The only thing that worked was manually adding code to resolve the dll path having copied another Syncfusion.Licensing.dll into an extra folder, but this is not a real solution, it just allows to work locally for now. Naturally, we can't use the AspNet.Core version of EJ2 either.
I would like to ask if you have advice how to resolve this problem. Thanks in advance.
Hi Aleksandr Makarov,
Greetings from Syncfusion.
We have validated the reported issue, unfortunately we are unable to replicate the issue at our end. However, we have prepared a sample for your reference which you can download from the below link.
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/SyncfusionMVCApp-1156506468
Syncfusion EJ2 components are compatible with EJ1 components. If you want to add EJ1 controls along with EJ2 controls in the same application, you can add without any issues. Please refer the below link
https://ej2.syncfusion.com/aspnetmvc/documentation/common/compatible-with-essentialjs1
Kindly try with the above information and sample and get back to us if you have any queries.
Regards,
Joshna L
In your example you clearly use dependentAssembly version override to make it work - so there would totally be an issue with just installing nugets from scratch. Also you use old VS2017 package.config which we do not.
Luckily, copying the dependentAssembly xml from web.config worked for my issue, so thanks for the help.
Hi Aleksandr Makarov,
Thanks for the update.
We are glad to hear that the issue was resolved.
Query: In your example you clearly use dependentAssembly version override to make it work - so there would totally be an issue with just installing nugets from scratch. Also you use old VS2017 package.config which we do not.
We don’t explicitly override any Assemblies explicitly, the assemblies will be added in the package.config file at the time of installing NuGet packages in the application.
Please get back to us if you need further assistance.
Regards,
Joshna L
Thank you! I had the exact same issue. Added nuget packages from scratch and every time I add an EJS.ScriptManager received:
Could not load file or assembly 'Syncfusion.Licensing, Version=21.1450.39.0
I added the redirect into web.config and it's all working now.
Hi Georg Thomas,
We are glad to hear that the issue has been resolved. Please get back to us if need any further assistance.
Regards,
Silambarasan Ilango