Inheritance security rules violated while overriding member

Aug 2, 2014 at 8:19 PM
I'm trying to obfuscate my js file with YuiCompressor nuget package.

After installing the package ("Yui Compressor .NET" + "Yui Compressor .NET - Web.Optimization"), I updated my BundleConfig file with this code:
JavaScriptCompressorConfig jsConfig = new JavaScriptCompressorConfig();
YuiCompressorTransform jsTransfrom = new YuiCompressorTransform(jsConfig);
var script = new Bundle("~/bundles/name", jsTransfrom);
When running the code, I'm getting this error:
System.TypeLoadException: Inheritance security rules violated while overriding member: 'Yahoo.Yui.Compressor.Web.Optimization.YuiCompressorTransform.Process(System.Web.Optimization.BundleContext, System.Web.Optimization.BundleResponse)'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.
   at MySln.UI.Website.BundleConfig.RegisterBundles(BundleCollection bundles)
   at MySln.UI.Website.MvcApplication.Application_Start() in c:\TFS\MySln\UserInterface\Website\Global.asax.cs:line 23
I'm running VS 2013 + .net framework 4.5.

How I'm can fix this?

Thank you!