用新窗口重新安装我的计算机后,在我的计算机/IIS 中运行的现有网站例程出现问题。
使用库 DynamicImage ( https://github.com/tgjones/dynamic-image ) 我的例程始终有效,但现在将图像保存为黑色图像。
从带有 IIS Express 的 Visual Studio 运行时,仍然可以正常工作,没问题。部署到我的 IIS 后,它会生成黑色图像而不会引发异常。
我试图在 IIS 中模仿 IIS Express,因此我将 apppool 配置为使用我的用户,但仍保存黑色图像。
查看事件查看器,没有错误消息。
我简化了代码并制作了一个简单的表格来测试,在 IIS 上仍然是黑色图像,在 IIS Express 上还可以
任何帮助、想法或要验证的内容都将不胜感激。
代码测试:
using SoundInTheory.DynamicImage;
using SoundInTheory.DynamicImage.Filters;
using SoundInTheory.DynamicImage.Layers;
protected void Button1_Click(object sender, EventArgs e)
{
ImageLayer layer = new ImageLayer { SourceFileName = "f:\\backdb\\a1.jpg" };
Composition composition = new Composition();
composition.ImageFormat = DynamicImageFormat.Bmp;
layer.Filters.Add(new BorderFilter { Width =20, Fill = new Fill { BackgroundColor = SoundInTheory.DynamicImage.Colors.Green }});
composition.Layers.Add(layer);
GeneratedImage img = composition.GenerateImage();
img.Save("f:\\backdb\\img.jpg"); // BLACK IMAGE ON IIS - Image OK on IIS EXPRESS
}