Could not load file or assembly Telerik.Sitefinity - sitefinity

having some issues upgrading my Sitefinity 4.1.1339.0 installation to 4.3 (and ultimately to Sitefinity 5). It is giving me the following error:
Could not load file or assembly 'Telerik.Sitefinity, Version=4.1.1339.0, Culture=neutral, PublicKeyToken=b28c218413bdf563' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I was thinking it was the /bin/Telerik.Sitefinity.dll file but everything seems to be updated in there.
Any ideas?
Thanks!

I agree with #Josh, plus you might try looking through all your files in the App_Data\Sitefinity\Configuration folder. I had to update all of the references in those files manually for some reason to match the exact DLL version. Make sure you completely restart your cassini/IIS/sitefinity instance to pick up the changes.

If you are using 'assemblyBinding' in your Sitefinity web.config, you will need to update that section of the config to the latest dll versions. Assembly Binding is a common solution to map out of date third party Sitefinity modules/plugins to the current Sitefinity dlls.
The following are correct versions for Sitefinity 5.1.3210. Note that Telerik.Web.UI is a different version as it is from a different Telerik product line.
<!-- From web.config - not complete file -->
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Telerik.Sitefinity" publicKeyToken="b28c218413bdf563" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="5.1.3210.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Telerik.Sitefinity.Model" publicKeyToken="b28c218413bdf563" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="5.1.3210.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Telerik.Web.UI" publicKeyToken="121fae78165ba3d4" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="2012.2.607.40"/>
</dependentAssembly>
</assemblyBinding>
If you will be upgrading through many versions 4.1 -> 4.4 -> 5.0 -> 5.1, you may wish to comment out this section of the config until you are complete with your upgrades, then add it back in. Otherwise, you'll have to edit these three lines after each upgrade.
Note: to get the dll version, browse to the bin folder. Right click dll file, click properties, then select the 'details' tab.

Related

Assembly binding redirect in .NET Core

How do I do assembly binding redirect in .NET Core?
I found this question asked a few time with no solutions offered. The situation is trivial. I have a package refering to assembly A in version 10. I want to use assembly A in version 12. In a standard .NET it works perfectly with this:
<dependentAssembly>
<assemblyIdentity name="Microsoft.AnalysisServices.AdomdClient" publicKeyToken="89845dcd8080cc91" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-15.1.52.23" newVersion="12.0.0.0" />
</dependentAssembly>
With help of Rena, adding
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
to the project file helped. The .config file got autogenerated with the correct binding redirect.

Using 2 versions of log4net in one application

I have a need to reference 2 different versions of log4net in my application.
An older assembly I am referencing uses log4net-net-1.0.dll version 1.2.0.30507,
whereas my newer dependencies use log4net V1.2.15.
I have tried placing this in the web.config to have my application look in a different folder when trying to find the older log4net dll:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="log4net-net-1.0" publicKeyToken="b4df9eabc7e0e71e" />
<codeBase version="1.2.0.30507" href="log4netv1.2.0\log4net-net-1.0.dll" />
</dependentAssembly>
</assemblyBinding>
</runtime>
But the dll is not getting found.
Is there something else I need to do in order for this to work.

how to change web.config when upgrading to Microsoft.WindowsAzure.StorageClient 4.3

I'd like to know how to change web.config when upgrading to Microsoft.WindowsAzure.StorageClient 4.3. Current web.config is like
<assemblyIdentity name="Microsoft.WindowsAzure.StorageClient" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.7.0.0" newVersion="1.7.0.0" />
You can directly delete it. This configuration is used for binding "Microsoft.WindowsAzure.StorageClient" reference which is older than 1.7.0.0 to the assembly whose version is 1.7.0.0. For example, originally the project references Microsoft.WindowsAzure.StorageClient 1.5.0.0 in compile time, after this part is added to web.config, it can leverage Microsoft.WindowsAzure.StorageClient 1.7.0.0 instead of 1.5.0.0 in run time, as long as the assembly is backward-compatible.
Because you have replaced "Microsoft.WindowsAzure.StorageClient.dll" with "Microsoft.WindowsAzure.Storage.dll" (both name and version are different), this configuration is not needed at all.

Error adding policy file to GAC

I'm trying to add a publisher policy file to the gac as per this thread but I'm having problems when I try and add the file on my test server.
I get "A module specified in the manifest of assembly 'policy.3.0.assemblyname.dll' could not be found"
My policy file looks like this:
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="*assemblyname*"
publicKeyToken="7a19eec6f55e2f84"
culture="neutral" />
<bindingRedirect oldVersion="3.0.0.0"
newVersion="3.0.0.1"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Please help!
Thanks
Ben
I've recreated the problem from scratch with a new assembly that has no dependancies (apart from the defaults) itself - all works fine on my local development machine (and redirects fine too) but gives the same error adding the policy file to the GAC on the server!
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="TestAsm"
publicKeyToken="5f55456fdcc9b528"
culture="neutral" />
<bindingRedirect oldVersion="3.0.0.0"
newVersion="3.0.0.1"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
linked in the following way
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\al.exe /link:PublisherPolicy.xml /out:policy.3.0.TestAsm.dll /keyfile:..\..\key.snk /version:3.0.0.0
pause
Please help!
Wow - ok got it.
I should have paid more attention to exactly what this meant
(MSDN) How to: Create a Publisher Policy
Important Note: The publisher policy
assembly cannot be added to the global
assembly cache unless the original
publisher policy file is located in
the same directory as the assembly .
That requirement is, frankly, so bizarre that it didn't register. The original policy file, that was compiled into the assembly i'm trying to add to the gac, has to be in the same folder as the policy assembly as you add the policy assembly.
Ok...just want to check some basics....
You definitely have got both versions of the dependent assembly installed to GAC?
And have you verified that the version numbers in the [assembly: AssemblyVersion()] attribute are correct.
And you did use [assembly: AssemblyVersion()] and NOT [assembly: AssemblyFileVersion("1.0.0.1")].
Update: My mistake, you only need the latest version of the assembly in the GAC. I just tried that here and it works. My only other thoughts are to check that the public key tokens are the same and that you've not misspelled the assembly name.
Also when you generate the policy file make sure you use the /version switch in the assembly linker to explicitly set the version number to 3.0.0.0 AND don't specify the /platform switch. e.g.
al.exe /link:assembly.config /out:policy.3.0.assembly.dll
/keyfile:mykey.snk /version:3.0.0.0
To add policy assemblies to the GAC using Wise, you do the same thing as you do to add the assembly the policy is for. So you add the policy assembly to the "Global Assembly Cache" in Wise, and as long as you have the policy file (.config) in the same location on the machine, Wise will automatically add it to GAC as well.

Cache provider for NHibernate 2.0.1.GA using ASP.NET Cache object

I have migrated my application from NHibernate 1.2.1 to NHibernate 2.0.1. Now i am geting the error "Version Conflict error while compiling". It shows that application still using the NHibernate V1 but i have changed the Version by deleteing the old dll and added the new dll in application refference.
The only thing i have not changes is NHibernate.Caches.SysCache.SysCacheProvider and it is still pointing to the old version "1.0.1".
How could i migrate this, please help me
-Gunasekaran sambandhan
NHibernate.Caches is part of the contrib package. You need to download the latest version and update your assembly.
U can use an Assemmbly redirect provided in your application config file or the webconfig file like this
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="NHibernate" publicKeyToken="AA95F207798DFDB4" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-2.1.0.2001" newVersion="2.1.0.1002"/>
</dependentAssembly>
</assemblyBinding>
</runtime>