ASP.3.5 Error while using Enterprise Library - asp.net

I have a VisualStudio solution created in Vs2005 which is making use of Microsoft Enterprise Data Library.Now I converted this to Visual studio 2008 .Now when i buid the project ,i am getting an error like the below
An error occurred creating the configuration section handler for dataConfiguration: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) (D:\dotnet\Test\Test.UI\web.config line 4)
My Web.Config 4 th line is as follows
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=3.5.0.0, Culture=neutral, PublicKeyToken=null"/>
I chanegd the version from 2.0.0.0 to 3.5.0.0 .But no result.Same error i am getting.
Can anyone help me to solve this ? Thanks in advance

Have you checked if the public key token is in fact null? You can do this with sn –T Microsoft.Practices.EnterpriseLibrary.Data.dll

Related

Could not load assembly System.Runtime in Xamarin.Forms UWP Project with .NET Standard library

I'm in the process of setting up a Xamarin.Forms app using .NET Standard for the shared library instead of a PCL. I've followed the instructions for doing so laid out here: https://channel9.msdn.com/Shows/XamarinShow/Snack-Pack-15-Upgrading-to-XamarinForms-to-NET-Standard
This is with a brand new Xamarin.Forms app, created using Visual Studio 2017 with a PCL, which was replaced with a .NET Standard library as described in the video.
The UWP app compiles fine, but throws this exception when I try to start it (on the call to Xamarin.Forms.Forms.Init)
System.IO.FileLoadException: 'Could not load file or assembly 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)'
I've tried specifically adding the nuget package for System.Runtime, version 4.1.0 to the UWP project, but that doesn't seem to help. It runs fine in Android, but keeps giving me this exception running the UWP project. Can anyone tell me what might be causing this and how I can fix it?
edit:
there is a very similar error in the build log:
Could not resolve this reference. Could not locate the assembly "System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
Followed by an extremely long list of places it has checked.
I also found this, which seems like it may be the problem:
2> There was a conflict between "System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
2> "System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was chosen because it was primary and "System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was not.
Does anyone know how I can resolve this conflict?
edit 2:
There's also this in the build logs right after the above, which is even more perplexing, as it seems to indicate the only thing referencing version 4.0.20.0 of System.Runtime is... version 4.3.0 of System.Runtime???
2> References which depend on "System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [C:\Users\Katie.nuget\packages\system.runtime\4.3.0\ref\netcore50\System.Runtime.dll].
2> C:\Users\Katie.nuget\packages\system.runtime\4.3.0\ref\netcore50\System.Runtime.dll
2> Project file item includes which caused reference "C:\Users\Katie.nuget\packages\system.runtime\4.3.0\ref\netcore50\System.Runtime.dll".
2> C:\Users\Katie.nuget\packages\system.runtime\4.3.0\ref\netcore50\System.Runtime.dll

Unable to find reference to assembly in a Visual Studio website

I have a legacy WebSite project (as opposed to a Web Application project). It was using .net 3.5 but I am updating it to 4.0.
Due to the compilation error ...
Compiler Error Message: CS1705: Assembly 'System.Web.Mvc, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35' uses 'System.Web.WebPages,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has
a higher version than referenced assembly 'System.Web.WebPages,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
... I added a reference to the newer version of System.Web.WebPages. This added the following line to the web.config file:
<add assembly="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
However, when I try to build the website I get this error:
The type 'System.Web.WebPages.WebPage' exists in both
c:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Web.WebPages\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.dll'
and 'c:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Web.WebPages\v4.0_1.0.0.0__31bf3856ad364e35\System.Web.WebPages.dll'
I cannot seem to find a reference anywhere in the project to the v4.0 1 version of WebPages. I assume this means that some other assembly is probably referring to it but I'm not sure where to go from here.
Any idea how to track down what is referring to the assembly and either remove the reference or update the calling the assembly?

Assembly version mismatch with system.web.mvc, syncFusion

I am trying to execute a sample provided by Syncfusion and I get an assembly error.
(0): error CS1705: Assembly 'Syncfusion.Schedule.Mvc, Version=10.104.0.44, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89' uses 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
I thought I just had to remove the failing reference and add my higher version, number 4. Unfortunatly, on the build, the project keeps on trying to build with the version 2.
I should at least have this:
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
But on the build I get this:
<add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, ublicKeyToken=31BF3856AD364E35" />
Make sure that the project you are building is an ASP.NET MVC 3 project and not an ASP.NET MVC 2 project. Given this error, it looks like you are using SyncFusion components that are designed for MVC 3 only.
Please check the below,
If you are using Syncfusion samples, then we would suggest you to check the Configuration Manager. If you are using MVC-2 then please set Configuration Manager as debug and if you are using MVC-3 then please set Configuration Manager as debug-MVC3.
Note: Configuration Manager will be available in Build Menu
If you have created your own sample we would suggest you to check the dll reference in the project and run the MVC switcher and assembly manager. Please refer the below link.
http://help.syncfusion.com/resources/Content/ug_101/user%20interface/asp.net%20mvc/grid/documents/612howtoswitchbetwee.htm
Regards,
Sridhar N

ASP.NET WEb.config Referencing an assembly

Hi I have 3 lines of code generated in my Web.config (.net 4.0) project as below
<configSections>
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral,PublicKeyToken=31bf3856ad364e35" requirePermission="false" />
</configSections>
When I run the project I get the error
: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
However I am referencing that assembly Microsoft.Practices.EnterpriseLibrary.Data from a private folder where it may not have a strong name etc in the project(I do Add references,Browse to private folder and add the Microsoft.Practices.EnterpriseLibrary.Data
library).
I hope I can find the added library somewhere in project configuration(No idea where - I searched properties etc. So I can substitute that value without strong name etc in Web.config and get going. Can somebody give a hand ?
thanks
Open a new project and try adding the references via NuGet and compare your config entries.
You just have the wrong version of the assembly referenced.
I found there was a problem in my connect string . I was having a connection for SQL Server Compact and I did not have the providename. This was leading to problems.

Error with <add assembly="System.Data.SqlClient, Version=10.50.1600, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

Why do I get this error? How I can fix it? I'm connecting from Web.config in an application that I started to do but I finish school issues because it is a team effort. The teacher has told me I should put that online so that my connection is well made ​​but not if publicToken or something else this evil at the time of writing the line is enclosed in asterisks. I need to indicate that I am writing wrong Please will thank you.
Server Error in '/' Application.
Configuration Error
Description: Error during processing of a configuration file required to service this request. Check the specific error details below and modify your configuration file accordingly.
Parser Error Message: Could not load file or assembly 'System.Data.SqlClient, Version = 10.50.1600, Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a'or one of its dependencies. The system can not find the file specified.
Source Error:
Line 51: <add assembly="System.Data.Services, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
Line 52: <add assembly="System.Data.Services.Client, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
Line 53: **<add assembly="System.Data.SqlClient, Version=10.50.1600, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>**
In .NET there is no such assembly as System.Data.SqlClient, Version=10.50.1600, .... SqlClient is the part of standart .NET Framework distribution.
For example, System.Data.SqlClient.SqlConnection:
Namespace: System.Data.SqlClient
Assembly: System.Data (in System.Data.dll)
How to determine fully qualified assembly name
Download the previous, free version of .NET Reflector, load assembly into (simply drag it onto) and you will see it's FQN
Have you checked to make sure that the dll indicated is being deployed and that the version number matches the version you specify above? The error is pretty clear. The system can't find the assembly that the code refers to on this line.
Well, you can browse the GAC (Global Assembly Cache) for meet the assembly data. Use the following command from de command prompt :
gacutil -l
This list the content of the GAC with the information that you need.

Resources