TargetInvocationException with Azure autoscaling

Apr 30, 2013 at 1:45 AM
Hi, firends. I am a newbie to C#.
When i develop an Azure autoscaling project, one error happend:
Microsoft.WindowsAzure.ServiceRuntime Critical: 31337 : System.Reflection.TargetInvocationException: 调用的目标发生了异常。 ---> System.IO.FileLoadException: 未能加载文件或程序集“Microsoft.WindowsAzure.StorageClient, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。 (异常来自 HRESULT:0x80131040)
   在 Microsoft.Practices.EnterpriseLibrary.WindowsAzure.Autoscaling.AzureStorage.AzureStorageAccount..ctor(String storageAccount)
   在 lambda_method(Closure )
   --- 内部异常堆栈跟踪的结尾 ---
   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   在 System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   在 System.Delegate.DynamicInvokeImpl(Object[] args)
   在 Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.ConstantParameterValue..ctor(Expression expression)
   在 Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.TypeRegistration.BuildDependencyParameter(Expression arg)
   在 Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.TypeRegistration.<get_ConstructorParameters>b__0(Expression arg)
   在 System.Linq.Enumerable.<>c__DisplayClass12`3.<CombineSelectors>b__11(TSource x)
   在 System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   在 System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   在 System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   在 Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.Unity.UnityContainerConfigurator.GetInjectionMembers(TypeRegistration registrationEntry)
   在 Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.Unity.UnityContainerConfigurator.Register(TypeRegistration registrationEntry)
   在 Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.Unity.UnityContainerConfigurator.RegisterAllCore(IConfigurationSource configurationSource, ITypeRegistrationsProvider rootProvider)
   在 Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.ChangeTrackingContainerConfigurator.RegisterAll(IConfigurationSource configurationSource, ITypeRegistrationsProvider rootProvider)
   在 Microsoft.Practices.EnterpriseLibrary.Common.Configuration.EnterpriseLibraryContainer.ConfigureContainer(ITypeRegistrationsProvider locator, IContainerConfigurator configurator, IConfigurationSource configSource)
   在 Microsoft.Practices.EnterpriseLibrary.Common.Configuration.EnterpriseLibraryContainer.ConfigureContainer(IContainerConfigurator configurator, IConfigurationSource configSource)
   在 Microsoft.Practices.EnterpriseLibrary.Common.Configuration.EnterpriseLibraryContainer.CreateDefaultContainer(IConfigurationSource configurationSource)
   在 Microsoft.Practices.EnterpriseLibrary.Common.Configuration.EnterpriseLibraryContainer.CreateDefaultContainer()
   在 Microsoft.Practices.EnterpriseLibrary.Common.Configuration.EnterpriseLibraryContainer.SetCurrentContainerIfNotSet()
   在 Microsoft.Practices.EnterpriseLibrary.Common.Configuration.EnterpriseLibraryContainer.get_Current()
   在 MonitorRole.WorkerRole.OnStart() 位置 E:\c\vc\OnvelopPaasTest\MonitorRole\WorkerRole.cs:行号 52
   在 Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.InitializeRoleInternal(RoleType roleTypeEnum)
   在 Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.InitializeRole(RoleType roleType)
   在 Microsoft.WindowsAzure.ServiceRuntime.Implementation.Loader.RoleRuntimeBridge.<InitializeRole>b__0()
sorry for that my ide was not in english environment. It was about to say:when call
Autoscaler scaler =
    EnterpriseLibraryContainer.Current.GetInstance<Autoscaler>();
Microsoft.WindowsAzure.StorageClient or one of its dependency can not be load,
due to some manifest of program found was not match the manifest of program which was referenced.

Any advide will be apprepriated.
Apr 30, 2013 at 5:37 PM
This discussion area is about the CodePlex website itself. You might want to post this on some other forums, dedicated for such discussions.