2

Resolved

Installer crash on Server 2008 R2 SP1

description

Exception calling "LoadFrom" with "1" argument(s): "Could not load file or assembly 'file:///C:\program files\cloudinit.net\CloudInit.exe' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded."
At C:\program files\cloudinit.net\install.ps1:34 char:40
  • [System.Reflection.Assembly]::LoadFrom <<<< ("$servicePath\CloudInit.exe")
    • CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    • FullyQualifiedErrorId : DotNetMethodException
Unable to find type [CloudInit.LSAHelper]: make sure that the assembly containing this type is loaded.
At C:\program files\cloudinit.net\install.ps1:35 char:26
  • if([CloudInit.LSAHelper] <<<< ::AddPrivileges($username, "SeServiceLogonRight") -ne 0)
    • CategoryInfo : InvalidOperation: (CloudInit.LSAHelper:String) [ ], RuntimeException
    • FullyQualifiedErrorId : TypeNotFound
PSPath : Microsoft.PowerShell.Core\FileSystem::C:\windows\System32\WindowsPowerShell\v1.0\Modules\CloudInitAdministration
PSParentPath : Microsoft.PowerShell.Core\FileSystem::C:\windows\System32\WindowsPowerShell\v1.0\Modules
PSChildName : CloudInitAdministration
PSDrive : C
PSProvider : Microsoft.PowerShell.Core\FileSystem
PSIsContainer : True
Name : CloudInitAdministration
Parent : Modules
Exists : True
Root : C:\
FullName : C:\windows\System32\WindowsPowerShell\v1.0\Modules\CloudInitAdministration
Extension :
CreationTime : 1/28/2012 5:25:15 PM
CreationTimeUtc : 1/28/2012 5:25:15 PM
LastAccessTime : 1/28/2012 5:25:15 PM
LastAccessTimeUtc : 1/28/2012 5:25:15 PM
LastWriteTime : 1/28/2012 5:25:15 PM
LastWriteTimeUtc : 1/28/2012 5:25:15 PM
Attributes : Directory
BaseName : CloudInitAdministration
Mode : d----

comments

Iristyle wrote Jan 28, 2012 at 4:38 PM

I'm using this script (work in progress) to bootstrap a standard AMI:
https://gist.github.com/1672426

You can see that I tried to run the script twice, per some of the previous discussion I had seen, but that makes no difference here.

bwight4157 wrote Jan 28, 2012 at 5:05 PM

The order in the install file is incorrect. I'll update the script to fix this issue. You need to run the following line before loading the Assembly that's throwing the error.

write-output "<configuration><startup useLegacyV2RuntimeActivationPolicy='true'><supportedRuntime version='v4.0.30319'/><supportedRuntime version='v2.0.50727'/></startup></configuration>" | out-file "$pshome\powershell.exe.config"

wrote Jan 28, 2012 at 5:06 PM

bwight4157 wrote Jan 28, 2012 at 5:07 PM

In fact you may even need to run this then the installer. I think the powershell instance has to closed and re-opened before this will take affect.

wrote Jan 28, 2012 at 5:25 PM

bwight4157 wrote Jan 28, 2012 at 6:25 PM

Fixed this issue and its now been packaged up with the 1.2 release.

Simple fix. Two scripts, the first script writes the config file allowing for .net 4.0 and then executes the main script in a new powershell instance.

wrote Jan 28, 2012 at 6:25 PM

wrote Jan 31, 2012 at 1:38 PM

wrote Feb 13, 2013 at 9:37 PM

wrote May 16, 2013 at 1:29 AM

wrote May 16, 2013 at 1:29 AM

wrote Jun 14, 2013 at 7:11 AM