我正在部署在.NET 4.5上构建的ClickOnce应用程序 这是事实:
I am working on deploying a ClickOnce Application build on .NET 4.5 Here are the facts:
但是,无论我做什么,当我使用立即发布"按钮实际发布ClickOnce应用程序时,所有文件都会被发布,但是当我下载"Setup.exe"时,它总是说未知发布商".
However, no matter what I do, when I use the "Publish Now" button to actually publish the ClickOnce application, all of the file get published, but when I download the "Setup.exe", it ALWAYS says "Unknown Publisher".
关于我在做什么错的任何想法?我已经研究了好几个星期,并且已经阅读了足够多的内容,相信我在正确"地进行操作,但是我只是必须缺少一些小的复选框或设置,或者是某些东西.
Any ideas on what I'm doing wrong? I have been researching this for several weeks and I have read through enough to believe that I'm doing it "correctly", but I just must be missing some small checkbox or setting, or something of course.
任何帮助表示赞赏.
-体重
推荐答案据我所知,"Unknown Publisher"取消了代码签名,而Visual Studio并未为其提供接口.哦,它有签名接口,但仅用于清单签名和强名称程序集签名. 这另一个问题也提到了这三个签名.
Far as I know the "Unknown Publisher" keys off the code-signing, which Visual Studio doesn't provide an interface for. Oh, it does have signing interfaces, but only for manifest signing and strong-name assembly signing. This other question mentions the three signings, too.
要用您的组织名称替换未知发布者",您必须在.csproj或.vbproj文件中添加一些XML.在结束</Project>标记之前,您需要调用 SignTool.exe ,我将其手动复制到解决方案的主Bin文件夹中(如果没有,则该文件夹是Windows SDK的一部分).这是我的样子:
To get the "Unknown Publisher" replaced with your org name, you'll have to add a bit of XML to your .csproj or .vbproj file. Right before the closing </Project> tag, you'll need to call SignTool.exe, which I manually copied to my solution's main Bin folder (If you don't have it, it's part of the Windows SDK). Here's what mine looks like:
<!-- This section is used for code-signing the application. This should not be confused with manifest signing or with strong-name assembly signing, which can both be done from the Visual Studio interface. --> <Target Name="SignOutput" AfterTargets="CoreCompile"> <PropertyGroup> <TimestampServerUrl>timestamp.verisign/scripts/timstamp.dll</TimestampServerUrl> <ApplicationDescription>A.Franklin's Awesome App</ApplicationDescription> <SigningCertificateCriteria>/sha1 0c0ff5e29404b7d78q2517f487da0b1a0912c4da</SigningCertificateCriteria> </PropertyGroup> <ItemGroup> <SignableFiles Include="$(ProjectDir)obj\$(ConfigurationName)\$(TargetName)$(TargetExt)" /> </ItemGroup> <Exec Command=""$(ProjectDir)..\Bin\SignTool" sign $(SigningCertificateCriteria) /d "$(ApplicationDescription)" /t "$(TimestampServerUrl)" "%(SignableFiles.Identity)"" /> </Target>要获取我已经安装在计算机上的证书的哈希码(上面的"0c0ff5 ..."),我
To get the hash code (the "0c0ff5..." above) for my certificate, which I already had installed on my machine, I
您也可以手动使用SignTool.exe,但对我来说,此设置在每次编译时透明地运行.
You could use SignTool.exe manually too, but for me this setup runs it transparently during each compile.
更多推荐
.NET ClickOnce签名会导致“未知发布者"
发布评论