I tried to install this on Umbraco 7.0.3 (using NuGet) but when running the site I was confronted with the following error:
System.TypeInitializationException: The type initializer for 'ImageProcessor.Web.HttpModules.ImageProcessingModule' threw an exception. ---> System.Exception: Could not load file or assembly 'Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Fusion Log:
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
Multiple times in the backend. Probably not specifically an ImageProcessor issue - could be a framework specific issue, but just wondering whether you've tested this on Umbraco 7 yet?
I have used it with Umbraco 7 without issue. I think what might of happened is that your visual studio solution is targeting .net framework v4 when it needs to be targeting .net framework v4.5 as this makes the Nuget package install different dependencies. If this is the case, you should remove the Nuget package, change the solution to v4.5 then reinstall the package.
Ok, check if you have the Microsoft.Bcl and Microsoft.Bcl.Async Nuget packages. I think Microsoft.Threading.Tasks comes in those. But as you can see here, there are only ImageProcessor dependencies if you are using framework v4.0.
Noticed that the url above mentions that both of these libraries are required, but for some reason didn't get installed when I installed ImageProcessor through Nuget. Never mind, problem solved [for now]
As Jeavon said they're only required for the NET4 build as it states that on the Nuget site.
I've just checked the deployed package and I'm definitely only targeting those binaries as a dependency for the NET4 version.
The problem could be one of three things:
Nuget is incorrectly determining the correct framework because it's been whack recently.
I've messed up somewhere with this release.
Something else has messed up the configuration making Nuget think you have NET4 installed.
Things to do
Check the binary in your bin folder. The NET4.5 version of v3.0.1.0 is 43.5kb in size. If you can open it in reflector or equivalent it will give you a target runtime description as [assembly: TargetFramework(".NETFramework,Version=v4.5", FrameworkDisplayName=".NET Framework 4.5")].
The NET4 version is slightly larger at 44kb.
Once you have the correct binary referenced the problem will go away.
Things to note
Async await behaviour defaults to undefined in ASP.NET unless you specifically ensure that the runtime is not running in quirks mode. I have missed the setting in the web.config transform to force that in NET4.5. You will want to make it asynchronous.
Setting the following value will ensure behaviour is asynchronous.
Support for Umbraco 7.0.3?
HI,
I tried to install this on Umbraco 7.0.3 (using NuGet) but when running the site I was confronted with the following error:
System.TypeInitializationException: The type initializer for 'ImageProcessor.Web.HttpModules.ImageProcessingModule' threw an exception. ---> System.Exception: Could not load file or assembly 'Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Fusion Log:
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
Multiple times in the backend. Probably not specifically an ImageProcessor issue - could be a framework specific issue, but just wondering whether you've tested this on Umbraco 7 yet?
Hi Robert,
I have used it with Umbraco 7 without issue. I think what might of happened is that your visual studio solution is targeting .net framework v4 when it needs to be targeting .net framework v4.5 as this makes the Nuget package install different dependencies. If this is the case, you should remove the Nuget package, change the solution to v4.5 then reinstall the package.
Jeavon
Yup, thought about that - it's definitely targeting v4.5...
Will have to play around it some more...
Ok, check if you have the Microsoft.Bcl and Microsoft.Bcl.Async Nuget packages. I think Microsoft.Threading.Tasks comes in those. But as you can see here, there are only ImageProcessor dependencies if you are using framework v4.0.
Yeah, not using the v4.0 framework; never did.
Noticed that the url above mentions that both of these libraries are required, but for some reason didn't get installed when I installed ImageProcessor through Nuget. Never mind, problem solved [for now]
As Jeavon said they're only required for the NET4 build as it states that on the Nuget site.
I've just checked the deployed package and I'm definitely only targeting those binaries as a dependency for the NET4 version.
The problem could be one of three things:
Things to do
Check the binary in your bin folder. The NET4.5 version of v3.0.1.0 is 43.5kb in size. If you can open it in reflector or equivalent it will give you a target runtime description as
[assembly: TargetFramework(".NETFramework,Version=v4.5", FrameworkDisplayName=".NET Framework 4.5")]
.The NET4 version is slightly larger at 44kb.
Once you have the correct binary referenced the problem will go away.
Things to note
Async await behaviour defaults to undefined in ASP.NET unless you specifically ensure that the runtime is not running in quirks mode. I have missed the setting in the web.config transform to force that in NET4.5. You will want to make it asynchronous.
Setting the following value will ensure behaviour is asynchronous.
Further info on that http://blogs.msdn.com/b/webdev/archive/2012/11/19/all-about-httpruntime-targetframework.aspx
Hopefully this will help you get to the bottom of the problem. Thanks for choosing to use ImageProcessor as a solution.
is working on a reply...