C#-使用ImageResizer调整图像大小和裁剪图像

C#-使用ImageResizer调整图像大小和裁剪图像,c#,imageresizer,C#,Imageresizer,代码 ResizeSettings resizeCropSettings = new ResizeSettings("width=100&height=150&format=jpg&crop=auto"); string fileName = ImageBuilder.Current.Build(file, newFile, resizeCropSettings, false, true); 信息上写着使用: .Build(新的ImageJob(源、

代码

ResizeSettings resizeCropSettings = new ResizeSettings("width=100&height=150&format=jpg&crop=auto");

         string fileName = ImageBuilder.Current.Build(file, newFile, resizeCropSettings, false, true);
信息上写着使用:

.Build(新的ImageJob(源、目标、设置、处置源、添加文件扩展)).FinalPath


任何人都能解释这意味着什么?请给我举个例子。

这个信息已经很清楚了,它意味着你需要更换

...Build(file, newFile, resizeCropSettings, false, true);

请看这里:

检查您正在使用的版本

替换

ImageBuilder.Current.Build(file, filePath, new ResizeSettings(versions[suffix]), false, true); 

如果出现以下情况,您将在评论中看到该错误

原因

解决方案

Make sure that you have the last version of the assembly installed.

Rebuild the solution.
Deploy the correct solution.

你能解释一下吗?我的意思是给我举个例子。@aboodmanna在这里可以找到一个例子:我有一个错误,上面写着:无法从程序集“ImageResizer.Instructions”加载类型“ImageResizer.Instructions”,版本=1.0.0,区域性=neutral,PublicKeyToken=null。我想是的,我安装了第一个nugget文件。我尝试了它,但出现了一个错误:无法从程序集“ImageResizer,Version=1.0.0,Culture=neutral,PublicKeyToken=null”加载类型“ImageResizer.Instructions”。是否使用ImageResizer.Mvc而不是ImageResizer 4.0.4?不推荐使用ImageResizer.Mvc是的,我将它与Mvc一起使用
ImageBuilder.Current.Build(new ImageJob(file,filePath, new Instructions(versions[suffix]),false,true))
You didn’t install the assembly specified in the error.
Your DLL depend on other DLL’s to get its job done and if you didn’t copy or install those too, you’d indeed get this error message.
Or you have installed an older version of the assembly.
This error occurs often when we use C# HelperClass to support the orchestrations, but can occur in other situations.
Make sure that you have the last version of the assembly installed.

Rebuild the solution.
Deploy the correct solution.