IMAGEVAULT 3 – UNABLE TO LOAD ONE OR MORE OF THE REQUESTED TYPES

Recognize this when fetching a EPiServer project from your version control system that uses ImageVault and your development environment doesn’t have ImageVault installed?

It could be related to the fact that ImageVault (version 3) requires six assemblies being preinstalled to the GAC and a lot of “leadtools”-assemblies in a “leadtools“-folder in your “bin”-folder.

If you don’t want your EPiServer application to depend on stuff in the GAC you can place them in the bin folder instead. But you probably don’t want to check-in your bin folder and add all of those “leadtools”-assemblies as references to your project, it would be a lot of references.

You could solve this by copying the required ImageVault assemblies to the bin folder (if they don’t already exist from last build) after a successful build.

I placed the “ImageVault GAC”-assemblies and the leadtools”-assemblies in a “libraries”-folder outside of the project and added them to our version control system.

Added a post build script that will execute on every successful build:

powershell -command "& {Set-ExecutionPolicy Remotesigned}"  
powershell $(ProjectDir)\Buildscripts\SetupImageVaultDependecies.ps1 $(SolutionDir) $(ProjectDir)$(OutDir)  

and a PowerShell script (SetupImageVaultDependecies.ps1) that copies the assemblies and sets ACL-permissions for everyone to have full control (you probably want to set this more precise for production and test environments)

Param( [string] $SolutionFolder , [string] $BinFolder)  
$targetLeadtoolsFolder = "$BinFolder\leadtools"
if ((Test-Path -path $targetLeadtoolsFolder) -eq $false) {  
    New-Item -Path $targetLeadtoolsFolder -ItemType "directory"
    Copy-Item "$SolutionFolder\Library\Leadtools\*.*" $targetLeadtoolsFolder
    &icacls $targetLeadtoolsFolder /grant 'Everyone:(OI)(CI)F'
    Copy-Item "$SolutionFolder\Library\ImageVaultGac\*.*" $BinFolder
}

I hope that ImageVault 4 doesn’t depend on stuff being preinstalled to the GAC and that the dependency to all of those “leadtools”-assemblies is removed.

Exception message in text

Unable to load one or more of the requested types. The following information may be a subset of the Type/LoaderException information present - inspect with debugger for complete view.  
Check assemblies [ImageVault.EPiServer6, Version=3.5.2.0, Culture=neutral, PublicKeyToken=null] and/or types [ImageVault.EPiServer6.Scheduler.ArchiverNotificationJob,  
ImageVault.EPiServer6.ScheduledJobImpl,  
ImageStoreNET.Developer.WebControls.PropertyComplexMediaControl,  
ImageStoreNET.Developer.WebControls.IVFileFilterEventHandler,  
ImageStoreNET.Developer.WebControls.IVAlbumTreeData,  
ImageStoreNET.Developer.Core.IVFileSystem,  
ImageVault.EPiServer6.Mirroring.IMirroringProperty,  
ImageVault.EPiServer6.Mirroring.MirroringPropertyFreeText,  
ImageVault.EPiServer6.LinkToolPlugin.LinkToolTinyMcePlugin,  
ImageStoreNET.Developer.Core.NamespaceDoc,  
ImageStoreNET.Developer.Core.IVAlbumDataCollection,  
ImageVault.EPiServer6.Mirroring.MirroringPropertyURL,  
ImageStoreNET.Developer.WebControls.PropertyImageVaultFile,  
ImageStoreNET.Developer.WebControls.IVAlbumTemplateContainer,  
ImageStoreNET.Developer.Security.IVAccessLevel,  
ImageStoreNET.Developer.Filters.IVFileSortBy,  
ImageStoreNET.Admin.TestRemoteSites,  
ImageStoreNET.Admin.TestClient,  
ImageVault.EPiServer6.ConfigImpl,  
ImageStoreNET.Developer.WebControls.PropertyFileControl]. Information from LoaderExceptions property [Method 'GetEPiLicenseData' in type 'ImageVault.EPiServer6.SecurityImpl' from assembly 'ImageVault.EPiServer6, Version=3.5.2.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.].  
comments powered by Disqus