Print Page | Close Window

Deployment on Azure

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3622
Printed Date: 13-May-2026 at 1:03am


Topic: Deployment on Azure
Posted By: halloweenx8
Subject: Deployment on Azure
Date Posted: 11-Sep-2012 at 8:19pm
I'm having an issue deploying on Azure from TFSPreview.com
I checkin my code, it builds and the test fails with these:
Failed TestGetClient GlobalDMSTest.GlobalDMSTest.TestGetClient Unable to create instance of class GlobalDMSTest.GlobalDMSTest. Error: IdeaBlade.Core.IdeaBladeException: Unable to initialize EntityManager
Unable to get metadata for GlobalDMS.Login. Make sure it is a valid entity type or POCO type with a KeyAttribute ---> System.ArgumentException: Unable to get metadata for GlobalDMS.Login. Make sure it is a valid entity type or POCO type with a KeyAttribute.
The website does not work either with a similar message
 
ArgumentException: Unable to get metadata for Security.LoginUser. Make sure it is a valid entity type or POCO type with a KeyAttribute
Any ideas?


-------------
Jean

"If You are Not Making Mistakes, then You are Not Doing Anything.”



Replies:
Posted By: halloweenx8
Date Posted: 12-Sep-2012 at 6:21pm
Anybody had success building a DevForce app with TFSPreview  and deploying on Azure?

-------------
Jean

"If You are Not Making Mistakes, then You are Not Doing Anything.”


Posted By: sbelini
Date Posted: 13-Sep-2012 at 9:35am
Hi Jean,
 
Are you working with Code First entities?
Based on the error message, it looks like the .ibmmx might not be embedded in the model assembly.
 
Silvio.


Posted By: halloweenx8
Date Posted: 13-Sep-2012 at 10:12am
Hi Silvio,
 
Yes I'm using code first entities. Since that first post I changed te way i deploy my application to azure instead of using Team Foundation Service (tfspreview.com I use Visual Studio deploy to Azure.
 
I get this error now
System.Runtime.InteropServices.SEHException: External component has thrown an exception.
[SEHException (0x80004005): External component has thrown an exception.]
   IdeaBlade.EntityModel.EntityServerProxy.CheckConnection(Exception e) +12
   IdeaBlade.EntityModel.EntityServerProxy.ExecFunc(Func`1 func, Boolean funcWillHandleException) +165
   IdeaBlade.EntityModel.EntityServerProxy.ExecuteOnServer(Func`1 func, Boolean funcWillHandleException) +344
   IdeaBlade.EntityModel.EntityManager.ExecuteServerQuery(IEntityQuerySurrogate entityQuery) +368

[EntityServerException: External component has thrown an exception.]
   IdeaBlade.EntityModel.EntityManager.HandleEntityServerException(Exception ex, Boolean tryToHandle, PersistenceOperation operation, Boolean throwOnError) +280
   IdeaBlade.EntityModel.EntityManager.ExecuteServerQuery(IEntityQuerySurrogate entityQuery) +456
   IdeaBlade.EntityModel.EntityManager.ExecuteFetch(IEntityFinder finder) +305
   IdeaBlade.EntityModel.EntityQueryFinder.Execute() +277
   IdeaBlade.EntityModel.EntityManager.ExecuteQueryCore(IEntityQuery query, Boolean isAsync) +488
   IdeaBlade.EntityModel.EntityManager.ExecuteQuery(IEntityQuery`1 query) +24
   IdeaBlade.EntityModel.EntityQuery`1.GetEnumerator() +59
   System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +446
   System.Linq.Enumerable.ToList(IEnumerable`1 source) +80
   ClientService.Authentication.DealerliveAuthentication.ValidateDealerCode(String dealerCode) in c:\Users\Jean\Documents\Visual Studio 2012\Projects\Dealerlive\trunk\DealerLiveDMS\ClientService\Authentication\DealerliveAuthentication.cs:62
   ClientService.Authentication.DealerliveAuthentication.AuthenticationPhase1(String dealerCode, String userName) in c:\Users\Jean\Documents\Visual Studio 2012\Projects\Dealerlive\trunk\DealerLiveDMS\ClientService\Authentication\DealerliveAuthentication.cs:26
   WebRole1.Default.BtnSigninClick(Object sender, EventArgs e) in c:\Users\Jean\Documents\Visual Studio 2012\Projects\Dealerlive\trunk\DealerLiveDMS\WebRole1\Default.aspx.cs:32
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +155
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3804
Nice error message right?
 


-------------
Jean

"If You are Not Making Mistakes, then You are Not Doing Anything.”


Posted By: halloweenx8
Date Posted: 13-Sep-2012 at 10:13am
I mean this error
 
[ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.]
   System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) +0
   System.Reflection.Assembly.GetTypes() +159
   System.ComponentModel.Composition.Hosting.AssemblyCatalog.get_InnerCatalog() +126
   System.ComponentModel.Composition.Hosting.AssemblyCatalog.get_Parts() +9
   IdeaBlade.Core.Composition.DefaultsCatalog.LoadCatalog() +305
   IdeaBlade.Core.Composition.CompositionHost..ctor() +46
   IdeaBlade.Core.Composition.CompositionHost.get_Instance() +102
   IdeaBlade.Core.Composition.CompositionContext.GetByName(String compositionContextName) +85
   IdeaBlade.EntityModel.EntityManager.InitializeFromContext(EntityManagerContext entityManagerContext) +114
   IdeaBlade.EntityModel.EntityManager..ctor(EntityManagerContext context) +395

[IdeaBladeException: Unable to initialize EntityManager
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.]
   IdeaBlade.EntityModel.EntityManager..ctor(EntityManagerContext context) +996
   ClientService.Authentication.DealerliveAuthentication.ValidateDealerCode(String dealerCode) +124
   WebRole1.Default.BtnSigninClick(Object sender, EventArgs e) +140
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +154
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3707


-------------
Jean

"If You are Not Making Mistakes, then You are Not Doing Anything.”


Posted By: mgood
Date Posted: 13-Sep-2012 at 10:32am
The original error happens when the PostSharp build tasks don't run during the build. That's a common problem if PostSharp fails to install properly due to a running process in the background. For build servers on the other hand, you have to take steps in your project to make the PostSharp build tasks work. See the following link.
 
http://doc.sharpcrafters.com/postsharp-2.1/##PostSharp-2.1.chm/html/522bb950-5fdf-4601-b75e-7c60c8b3ae08.htm - http://doc.sharpcrafters.com/postsharp-2.1/##PostSharp-2.1.chm/html/522bb950-5fdf-4601-b75e-7c60c8b3ae08.htm


Posted By: halloweenx8
Date Posted: 13-Sep-2012 at 10:43am
mgood, by original you mean the one posted on 2012-Sep-11 at 8:19pm
I realized it and published to Azure using Visual Studio, so that should solved that issue.

-------------
Jean

"If You are Not Making Mistakes, then You are Not Doing Anything.”


Posted By: mgood
Date Posted: 13-Sep-2012 at 10:48am
Yes


Posted By: halloweenx8
Date Posted: 13-Sep-2012 at 10:58am
though now i get this...
 
[ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.]
   System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) +0
   System.Reflection.Assembly.GetTypes() +159
   System.ComponentModel.Composition.Hosting.AssemblyCatalog.get_InnerCatalog() +126
   System.ComponentModel.Composition.Hosting.AssemblyCatalog.get_Parts() +9
   IdeaBlade.Core.Composition.DefaultsCatalog.LoadCatalog() +305
   IdeaBlade.Core.Composition.CompositionHost..ctor() +46
   IdeaBlade.Core.Composition.CompositionHost.get_Instance() +102
   IdeaBlade.Core.AuthHelper.LoadRuntimeLicense(Boolean failIfBadLicense, Action`2 statusCallback) +152
   IdeaBlade.Core.AuthHelper.LoadLicense(Action`2 statusCallback) +178
   IdeaBlade.Core.IdeaBladeConfig.Initialize() +242
   IdeaBlade.Core.IdeaBladeConfig.get_Instance() +27
   IdeaBlade.Core.IdeaBladeConfig.AssertNonDefaultVersion(Boolean throwIfDefault) +24
   IdeaBlade.EntityModel.EntityManager..ctor(EntityManagerContext context) +285
   ClientService.Authentication.DealerliveAuthentication.ValidateDealerCode(String dealerCode) +124
   WebRole1.Default.BtnSigninClick(Object sender, EventArgs e) +140
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +154
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3707


-------------
Jean

"If You are Not Making Mistakes, then You are Not Doing Anything.”


Posted By: mgood
Date Posted: 13-Sep-2012 at 11:08am
This looks like you are not deploying all the required assemblies. The question is which one is missing. Unfortunately, if you test this outside of Azure any required assemblies that didn't get deployed to the bin folder are simply loaded from the GAC. That's not gonna happen on Azure. You need to deploy every assembly into the bin folder. Make sure all your referenced assemblies have "Copy Local" set to true. This is most likely a dependency of one of your referenced assemblies that is missing and is not easy to track down.


Posted By: halloweenx8
Date Posted: 13-Sep-2012 at 8:50pm
Thanks it does work now.

-------------
Jean

"If You are Not Making Mistakes, then You are Not Doing Anything.”



Print Page | Close Window