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

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>

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.

Attempt by 'System.Web.Mvc.PreApplicationStartCode.Start()' to critical method 'System.Web.WebPages.Razor.PreApplicationStartCode.Start()' failed

My application was working fine and after I did some upgrades I am getting this error.
Server Error in '/' Application.
Attempt by security transparent method 'System.Web.Mvc.PreApplicationStartCode.Start()' to access security critical method 'System.Web.WebPages.Razor.PreApplicationStartCode.Start()' failed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.MethodAccessException: Attempt by security transparent method 'System.Web.Mvc.PreApplicationStartCode.Start()' to access security critical method 'System.Web.WebPages.Razor.PreApplicationStartCode.Start()' failed.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18055
I cannot remember the updates I did. Is there a way to fix this?
I think the issue has been solved, but if not, use this package from Nuget:
Install-Package Microsoft.AspNet.Mvc -Version 5.0.0
I have wasted a day for this error but this single line has done the work for me
tried . . . Install-Package Microsoft.AspNet.Mvc -Version 5.0.0
and. . . Install-Package -Id Microsoft.AspNet.WebHelpers
both with no success, finally had to update all packages via nuget. . worked!!
http://www.3dbuzz.com/forum/threads/202082-ASP-net-MVC-Error-before-application-start
If you're using visual studio open the nuget packages windows and run
Update-Package, this will update all your dll to the last version. If
it still not work, see this page:
http://www.asp.net/mvc/tutorials/mvc-5/how-to-upgrade-an-aspnet-mvc-4-and-web-api-project-to-aspnet-mvc-5-and-web-api-2
I got this error when deploying a site where Mvc had been upgraded from 4 to 5 but I had not updated web.config.
Changing from this:
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
to this:
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
solved the problem for me.
For me also same error occured.
It was fixed by installing the NuGet package
Install-Package -Id Microsoft.AspNet.WebHelpers
I had a similar problem, and solved it by based on the article Updating Razor 2.0 to 3.0 with Asp.net MVC by by Anthony Fassett
The following block of code was missing from my Web.Config:
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
In my case it was an incompatibility issue. I had theses pacakges:
Microsoft.AspNet.Mvc version 4.x
Microsoft.AspNet.Razor and Microsoft.AspNet.WebPages, version 3.x
I suppose that upgrading Mvc to 5.x would have worked, but I needed to keep Mvc 4.x, so i had to downgrade Razor and Mvc to 2.x. To do so, you just have to install the older version, like this:
Install-package Microsoft.AspNet.WebPages -version 2.0.30506
Install-Package Microsoft.AspNet.Razor -Version 2.0.30506
After downgrading these packages, the first error disappeared, but there was still another error related to a problem in web.config. I had to change the binding redirect for Razor:
<dependentAssembly>
<assemblyIdentity name="System.Web.Razor" ... />
<!--bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" /-->
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
I don't know why, but the binding redirect wasn't updated by the Nuget installation, which should have done it.
There are multiple solutions for this problem:
Follow the tutorial on upgrading your asp.net solution
Don't forget to remove the Microsoft-Web-Helpers dll and install the nuget package Microsoft.AspNet.WebHelpers
Then, make sure you have upgraded all your nuget Packages (use "Upgrade-Package") and check your dll's in web.config.
The error is probably an action in an old DLL, when you are converting your project.
In my case, a nuget installation had changed my Web.Config:
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-5.1.0.0" newVersion="1.1.0.0" />
</dependentAssembly>
newVersion="1.1.0.0"** should be newVersion="5.1.0.0"
Right Click to Project -> Manage Nuget Packages for solution than find
Microsoft.AspNet.Mvc and Microsoft.Net.Compilers update latest versions
I solved my problem by applying the "Install-Package Microsoft.AspNet.Mvc" command.
After that I solved my project with Web API.
I received this error when I upgraded a NuGet package - 'Microsoft.AspNet.Web Pages' version 3.2.3. I am using VS2012, starting a new vanilla 'ASP.NET MVC 4 Web Application' with template 'Internet Application' using Windows Authentication or Windows Azure authentication.
Perhaps the update is not compatible with other components, and these other components must also be upgraded. Other answers suggest updating Microsoft.AspNet.Mvc, Microsoft.Net.Compilers, and/or Microsoft.AspNet.WebHelpers.
I am working on ASP.NET Web API project and fetch same problem after adding following nuget CacheCow.Server.EntityTagStore.SqlServer
It solved installing this one
Install-Package Microsoft.AspNet.Mvc
Install-Package -Id Microsoft.AspNet.WebHelpers
Install-Package Microsoft.AspNet.Mvc -Version 5.0.0
This worked for me

Could not load file or assembly Telerik.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.

NHibernate 2.1.1 references an older version of Spring

NHibernate 2.1.0 references Spring 1.3.0.
NHibernate 2.1.1 references Spring 0.0.0.2.
Is there any special reason for that? I upgraded to NHibernate 2.1.1 and now I'm getting Assembly loading errors.
NHibernate 2.1.2GA has been released and on the 15th of december the springteam is going to release Spring.Net 1.3GA. I updated to a nightly build (they are pretty stable right now and there is a "feature freeze") and it is already compiled against 2.1.2GA. You might want to try that too.
You need to use an assembly redirect in your app/web.config to point to the version of Spring.NET you want to use. The version numbers will depend on the specific version you're using.
I'm guessing you're going to use the proxies generated by Spring.NET instead of i.e. Castle, you'll need to pick up one of the latest builds since there's a bug in Spring.NET 1.3 and the NHibernate provider.
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Spring.Aop"
publicKeyToken="65e474d141e25e07"
culture="neutral" />
<bindingRedirect oldVersion="0.0.0.20110"
newVersion="0.0.0.20310"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Spring.Core"
publicKeyToken="65e474d141e25e07"
culture="neutral" />
<bindingRedirect oldVersion="0.0.0.20110"
newVersion="0.0.0.20310"/>
</dependentAssembly>
</assemblyBinding>
</runtime>