I'm trying to run a Windows Azure deployment package in the Windows Azure Emulator, using the command line, with no success. My app consists of two roles, a web role and a worker role. It's 64 bit and using .NET Framework 4. I'm using Windwos Azure Sdk 1.4+refresh.
I've created my package using cspack and start csrun:
csrun.exe mypackage serviceconfiguration.cscfg
The output follows:
C:\Temp>csrun mypackage serviceconfiguration.cscfg
Windows(R) Azure(TM) Desktop Execution Tool version 18.104.22.168
for Microsoft(R) .NET Framework 3.5
Copyright (c) Microsoft Corporation. All rights reserved.
Using session id 2
Attempting to bind SSL Certificate with identity sha1:<sha-hash>
<id> for endpoint named Project.Web of role Endpoint2.
Deployment role instances not in "Started" state after 30 seconds.
Deployment input endpoint Microsoft.WindowsAzure.Plugins.RemoteForwarder.RdpInput of role
Project.Web at tcp://127.0.0.1:3390/.
Deployment input endpoint Endpoint2 of role Project.Web at https://127.0.0.1:444/
The output in the Windwos Azure Compute Emulator follows:
[MonAgentHost] Output: Monitoring Agent Started
[Diagnostics]: Starting configuration channel polling
[runtime] Role entrypoint could not be created:
System.BadImageFormatException: Could not load file or assembly 'file:///C:\Temp\mypackage\roles\Project.WorkerRole\approot\Project.WorkerRole.dll' or one of its dependencies. This assembly
is built by a runtime newer than the currently loaded runtime and cannot be loaded.
File name: 'file:///C:\Temp\mypackage\roles\Project.WorkerRole\approot\Project.WorkerRole.dll'
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.CreateRoleEntryPoint(RoleType roleTypeEnum)
at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.InitializeRoleInternal(RoleType roleTypeEnum)
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v2.0.50727\mscorwks.dll
Running under executable C:\Temp\mypackage\roles\Project.WorkerRole\base\x64\WaWorkerHost.exe
So it fails to load the role entry point since it fails to loadmy assembly. The error message indicates that WaWorkerHost.exe is using .NET Framework 2.0 and fails to load my .NET Framework 4 assembly. Surely it must be possible to use CSrun.exe to deploy
.NET Framework 4 packages to the Windows Azure Compute Emulator?
(Reason I'm trying to do this is that I want to automate some tests)
I can reproduce the same issue as yours by deleting that line. Could you please open C:\Temp\mypackage\roles\Project.WorkerRole\base\x64\ and check if WaWorkerHost.exe.config is correct or not? If you cannot find that file, please create a new one and input
above configuration to see if it works.