ESB 2.2 EsbImportUtil.exe The type initializer for 'Microsoft.Practices.ESB.Configuration.ConfigHelper' throw exception - biztalk-deployment

when importing the itineries using ESB 2.2 EsbImportUtil.exe following error is displayed
I have EnterpriseLibrary 5 installed and GAC contain EnterpriseLibrary 4.1 dll also.
The type initializer for 'Microsoft.Practices.ESB.Configuration.ConfigHelper' threw an exception.[A]Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection cannot be cast to [B]Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection. Type A originates from 'Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.Practices.EnterpriseLibrary.Common\5.0.414.0__31bf3856ad364e35\Microsoft.Practices.EnterpriseLibrary.Common.dll'. Type B originates from 'Microsoft.Practices.EnterpriseLibrary.Common, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.Practices.EnterpriseLibrary.Common\4.1.0.0__31bf3856ad364e35\Microsoft.Practices.EnterpriseLibrary.Common.dll'.
Thanks for the help

Have you made any changes to esb.config file. Added new orchestation, try removing it. I had similar issue; fixed by removing wrong configuration.
Check:-
http://social.msdn.microsoft.com/Forums/en-US/bf2446fd-87fb-462a-8b78-cde7026bfdf5/the-type-initialize-for-microsoftpracticesesbconfigurationconfighelper-threw-an-exception?forum=biztalkesb

Related

Could not load file or assembly 'Launch, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified : Migration Error

I have been working on Entity framework recently i'm facing some challenging like when attempt to run the migration command it will show this Error
"Could not load file or assembly 'Launch, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified"
please if can help with i will be appreciated a lot
in my case. I solved this error by correcting the spelling of my target project from where I was calling it in the extension of my services for the startup class.
In my case as well, the error was due to the project name being misspelt in my startup class within the ConfigureServices method.
public void ConfigureServices(IServiceCollection services)
{
Constants.connectionString = Configuration.GetConnectionString("DefaultConnection");
// Add framework services.
services.AddDbContext<AppDbContext>(options =>
options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"),
b => b.MigrationsAssembly("ProjectNameHereWasMisspelt")));

Using Quartz.NET with a custom connection provider

I'm trying to use Quartz.NET with ReliableDbProvider, to allow Quartz to connect to our Azure SQL databases without transient connection issues.
Here's the configuration I'm using (re-formatted for readability; I actually initialize them in a NameValueCollection...):
quartz.jobStore.dirverDelegateType: Quartz.Impl.AdoJobStore.StdAdoDelegate, Quartz
quartz.jobStore.tablePrefix: QRTZ_
quartz.dataSource.default.connectionString: Data Source=(localdb)\\mssqllocaldb;Initial Catalog=Foo;Integrated Security=True
quartz.dataSource.default.connectionProvider.type: ReliableDbProvider.SqlAzure.SqlAzureProvider
quartz.jobStore.useProperties: true
When trying to create a scheduler, I get an exception
InvalidCastException: Unable to cast object of type ReliableDbProvider.SqlAzure.SqlAzureProvider to type Quartz.Impl.AdoJobStore.Common.IDbProvider.
I guess that's not so surprising - but how do I work around it? I took a look at the IDbProvider interface from Quartz, but it wasn't straightforward how to forward that to an instance of the ReliableDbProvider, as the latter did not implement all the features of the former.
What's the best way to use a custom connection provider that Quartz doesn't know about?
It is a QUART.NET IDbProvider....
Quartz.Impl.AdoJobStore.Common.IDbProvider
Not just the some/any standard microsoft one.
(Which you kinda make mention of, but at the same time, it doesn't look like it really clicked as to what that means)
Somebody (out there in internet land ... or you) has to WRITE a concrete that supports Azure. To my knowledge, it hasn't been done.
Here is the list:
https://www.quartz-scheduler.net/documentation/quartz-2.x/tutorial/job-stores.html
Currently following database providers are supported:
SqlServer-20 - SQL Server driver for .NET Framework 2.0
OracleODP-20 - Oracle’s Oracle Driver
OracleODPManaged-1123-40 Oracle’s managed driver for Oracle 11
OracleODPManaged-1211-40 Oracle’s managed driver for Oracle 12
MySql-50 - MySQL Connector/.NET v. 5.0 (.NET 2.0)
MySql-51 - MySQL Connector/:NET v. 5.1 (.NET 2.0)
MySql-65 - MySQL Connector/:NET v. 6.5 (.NET 2.0)
SQLite-10 - SQLite ADO.NET 2.0 Provider v. 1.0.56 (.NET 2.0)
Firebird-201 - Firebird ADO.NET 2.0 Provider v. 2.0.1 (.NET 2.0)
Firebird-210 - Firebird ADO.NET 2.0 Provider v. 2.1.0 (.NET 2.0)
Npgsql-20 - PostgreSQL Npgsql
APPEND
Hmm. I found something interesting.
In the Quartz.Net source code, in this file:
\src\Quartz\Impl\AdoJobStore\Common\dbproviders.properties
or another place to see it
https://github.com/quartznet/quartznet/blob/master/src/Quartz/Impl/AdoJobStore/Common/dbproviders.properties
Database provider configuration data
Core information taken from Spring Framework .NET - All credits to their great work!
..
# SQL SERVER
quartz.dbprovider.SqlServer-20.productName=Microsoft SQL Server, provider V2.0.0.0 in framework .NET V2.0
quartz.dbprovider.SqlServer-20.assemblyName=System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
quartz.dbprovider.SqlServer-20.connectionType=System.Data.SqlClient.SqlConnection, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
quartz.dbprovider.SqlServer-20.commandType=System.Data.SqlClient.SqlCommand, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
quartz.dbprovider.SqlServer-20.parameterType=System.Data.SqlClient.SqlParameter, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
quartz.dbprovider.SqlServer-20.commandBuilderType=System.Data.SqlClient.SqlCommandBuilder, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
quartz.dbprovider.SqlServer-20.parameterDbType=System.Data.SqlDbType, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
quartz.dbprovider.SqlServer-20.parameterDbTypePropertyName=SqlDbType
quartz.dbprovider.SqlServer-20.parameterNamePrefix=#
quartz.dbprovider.SqlServer-20.exceptionType=System.Data.SqlClient.SqlException, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
quartz.dbprovider.SqlServer-20.useParameterNamePrefixInParameterCollection=true
quartz.dbprovider.SqlServer-20.bindByName=true
quartz.dbprovider.SqlServer-20.dbBinaryTypeName=Image
So it may be possible to try and do the above mappings for Azure items. No idea how close you might get.
I was expecting to see something like
public class SqlServer20 : Quartz.Impl.AdoJobStore.Common.IDbProvider
but that led me to find the "dbproviders.properties" file.

Updating to last version of the monodroid and now the solution not builds

Today I update my monodroid to the its last version. Before this my solution works fine but no I got this errors:
MyProjectPath\Classes\Presentation Layer\Class Override\ImageLoaderListener.cs(15,15): Error CS0012: The type 'Java.Lang.Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=c4c4237547e4b6cd'. (CS0012) (RPLAndroidApp)
and also this:
MyProjectPath\Class Override\ImageLoaderListener.cs(15,15): Error CS0012: The type 'Android.Runtime.IJavaObject' is defined in an assembly that is not referenced. You must add a reference to assembly 'Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=c4c4237547e4b6cd'. (CS0012) (RPLAndroidApp)
I tried to recompile my java library that I build by 'JavaBindingLibraryProject' and add them again to project but When I build them I get many errors.
I'm confused what should I do?
Rebuild all your projects with the new version of Mono for Android. You have to do this because of the changes in Assembly strongnames.

"A type load exception has occurred." using DbContext with MySql connector with Mono

I am trying to use the MySQL Database with the Entity Framework Version 4.1.0.0 and Mono 2.11.4 in a ASP.NET MVC 3 Project.
On my Local Windows system everything works great but when I publish it to my Ubuntu 12.04 LTS System I get a lot of errors.
First I get:
Could not load type 'System.Data.Entity.Infrastructure.DbUpdateException' from assembly 'EntityFramework, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
when I press F5 I get different errors every time the page refreshes:
Could not load type 'System.Data.Entity.Infrastructure.DbUpdateConcurrencyException' from assembly 'EntityFramework, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
Could not load type 'System.Data.Entity.Infrastructure.DbCompiledModel' from assembly 'EntityFramework, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
Could not load type 'System.Data.Entity.Infrastructure.ReplacementDbQueryWrapper`1[TElement]' from assembly 'EntityFramework, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
Could not load type 'MySql.Data.VisualStudio.Editors.SqlEditor' from assembly 'MySql.VisualStudio, Version=6.6.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d'.
Could not load type 'MySql.Data.VisualStudio.WebConfig.WebConfigDlg' from assembly 'MySql.VisualStudio, Version=6.6.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d'.
A type load exception has occurred.
The last error occurred when I try to use the database with this code:
using (var db = new DefaultContext())
{
db.Persons.Add(new Person() { Name = "hallo", Address = "bllaaa" });
db.SaveChanges();
var persons = db.Persons.ToList();
return View(persons);
}
Did anybody have a similar problem and solved it? I do not know what to do.
P.S.: I use Code First Migration
From my understanding, Mono is bundling the open source version of Entity Framework, which is essentially yet-to-be-released v6.
http://weblogs.asp.net/scottgu/archive/2012/07/19/entity-framework-and-open-source.aspx
So it would seem you can't target EF v4.x, since the code has likely undergone major changes. Although, if you discover that the seemingly missing types are still there, you could attempt to work around the issue with an assembly redirect (just search for bindingRedirect).
I know why this happend.
I installed the mono-fastcgi-server4 through apt-get after i installed mono from source. So i had 2 mono versions installed and the older one was active. (2.10.8)
And the Entity Framework seems totally useless to me because only the new EF6 works with a database but there arent any provider who suppot EF6 and work with mono.

ASP.NET MVC 4 Beta Breaks Developer Preview Projects

After upgrading to my ASP.NET MVC 4 Developer Preview assemblies to the latest MVC 4 beta, the following exception occurs for my MVC 4 projects:
Could not load type 'System.Web.WebPages.DisplayModes' from assembly
'System.Web.WebPages, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35'.
...
Exception Details: System.TypeLoadException: Could not load type
'System.Web.WebPages.DisplayModes' from assembly 'System.Web.WebPages,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
How do I fix this?
Update: I installed the new MVC 4 Beta NuGet package, which added most of the right assemblies, but now I get the missing DisplayModes error on compile:
The name 'DisplayModes' does not exist in the current context.
For the following piece of code in Global.asax.cs:
DisplayModes.Modes.Insert(0, new DefaultDisplayMode("iPhone") { ... });
2nd Update: Solved.
The DisplayModes syntax has changed to:
DisplayModeProvider.Instance.Modes.Insert(0, new DefaultDisplayMode("iPhone")
{
...
});

Resources