我已经创建了一个简单的 WinForms 应用程序,并且我正在尝试实现托管在 Microsoft IIS 上的自动更新程序我遇到了总是返回的问题
找不到 Update.exe,不是 Squirrel 安装的应用程序
我已经检查了官方文档并实现了 web.config 文件,如链接中所述
在 ISS 中,我创建了一个带有 web.config 和 Releases 文件夹的虚拟目录,我的 Winform 应用程序以“http://localhost/Downloads/Releases/”为目标,如下所示
当我调试应用程序时,它总是在 IIS 上托管时返回前面提到的错误,当它以我的驱动器上的路径为目标时工作正常。
我认为我在 IIS 方面搞砸了,有没有人有线索或指针,将不胜感激。
我的应用
Public Form1()
{
InitializeComponent();
AddVErsionNUmber();
CheckForUpdates().Wait();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void AddVErsionNUmber()
{
System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
FileVersionInfo fileVersionInfo = FileVersionInfo.GetVersionInfo(assembly.Location);
lblVersion.Text = fileVersionInfo.FileVersion;
}
private async Task CheckForUpdates()
{
using (var manager = new UpdateManager(@"http://localhost/Downloads/Releases/"))
{
await manager.UpdateApp();
}
}
我的 web.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".nupkg" mimeType="application/zip" />
<mimeMap fileExtension="." mimeType="text/plain" />
</staticContent>
<security>
<access sslFlags="None" />
</security>
</system.webServer>
</configuration>
我的 ISS 文件夹结构和适当的资源
文件夹结构
从Iss浏览