MSBuild ClickOnce 错误 : "Deployment and application do not have matching security zones"

标签 msbuild clickonce

我们正在尝试通过 MSBuild 发布 ClickOnce 应用程序.对于已安装的 Windows 应用程序版本,我们已经让它运行良好。

但是,当我们将 install 设置为 false,以便它仅从 Web 运行应用程序时,当我们尝试从 URL 运行应用程序时,我们会收到以下错误:“部署和应用程序没有匹配的安全区域”这很好​​用在 Internet Explorer 中。我们只在 Chrome 和 FireFox 中收到错误消息。

这是项目文件设置的示例。

<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
  <PropertyGroup>
    <SrcTreeRoot>$(MSBuildProjectDirectory)\..\..\..</SrcTreeRoot>
    <!--ClickOnceDeployFolder>$(WebOutputDir)\AnalyzerPC</ClickOnceDeployFolder-->
    <ProjectGuid>{8205E593-F400-41AE-8D6F-DEA290B2DCF9}</ProjectGuid>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ApplicationIcon>Graphics\EDA Icon.ico</ApplicationIcon>
    <AssemblyName>DASHQueryBuilder</AssemblyName>
    <OutputType>WinExe</OutputType>
    <RootNamespace>TetraData.Analyzer</RootNamespace>
    <FileUpgradeFlags>
    </FileUpgradeFlags>
    <OldToolsVersion>2.0</OldToolsVersion>
    <IsWebBootstrapper>false</IsWebBootstrapper>
    <ManifestCertificateThumbprint>...</ManifestCertificateThumbprint>
    <GenerateManifests>true</GenerateManifests>
    <SignManifests>true</SignManifests>
    <SignAssembly>true</SignAssembly>
    <ManifestKeyFile>$(BuildDir)\Certificates\TetraDataCode.pfx</ManifestKeyFile>
    <ProductVersion>9.0.21022</ProductVersion>
    <PublishUrl>http://localhost/DASHQueryBuilder/</PublishUrl>
    <Install>false</Install>
    <!--InstallFrom>Web</InstallFrom-->
    <UpdateEnabled>false</UpdateEnabled>
    <MapFileExtensions>true</MapFileExtensions>
    <PublisherName>Follett Software Company</PublisherName>
    <TrustUrlParameters>true</TrustUrlParameters>
    <ApplicationRevision>0</ApplicationRevision>
    <UseApplicationTrust>false</UseApplicationTrust>
    <PublishWizardCompleted>true</PublishWizardCompleted>
    <BootstrapperEnabled>false</BootstrapperEnabled>
  </PropertyGroup>
  <Import Project="$(SrcTreeRoot)\Build\TaskInit.Tasks" />
  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  <Import Project="$(SrcTreeRoot)\Build\TaskOverrides.Tasks" />
  <Import Project="$(MSBuildProjectDirectory)\Analyzer.csproj" />
  <PropertyGroup>
    <PublishDir>$(WebOutputDir)\DASH Query Builder\</PublishDir>
    <ApplicationVersion>$(MajorMinorVersion).0.0</ApplicationVersion>
  </PropertyGroup>
  <Target Name="BeforeResolveReferences">
    <Copy SourceFiles="$(MSBuildProjectDirectory)\DASHQueryBuilder.config" DestinationFiles="$(MSBuildProjectDirectory)\app.config" />
  </Target>
</Project>

最佳答案

下面是微软对我在他们论坛上发布的帖子的回答。基本上他们当时确实支持 chrome,但现在有一个 Chrome 插件 here效果很好。

Hi fbanderson,

I found an article talking about ClickOnce in Firefox.

http://windowsclient.net/wpf/wpf35/wpf-deploying-clickonce-ie-firefox.aspx

.NET Framework 3.5 SP1 offers a component called .NET Framework Assistant 1.0 which handles ClickOnce .applications. If you have installed that component, the dialog appear to you in FireFox should contain a “Run ClickOnce application” button. Do you see that button when you trying to launch the app?

For Google Chrome, we don’t have experience for it. It is a new browser and we lack test on it.

Sincerely,

Kira Qian

MSDN Subscriber Support in Forum

If you have any feedback on our support, please contact msdnmg@microsoft.com Please remember to mark the replies as answers if they help and unmark them if they provide no help. Welcome to the

关于MSBuild ClickOnce 错误 : "Deployment and application do not have matching security zones",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2806313/

相关文章:

MSBuild 验证属性

MSBuild错误MSB4018 : The "GenerateResource" task failed unexpectedly

msbuild - 为什么我们每次都会增加构建号,即使是夜间构建?

msbuild - 覆盖 MSBuild 中的继承任务

compact-framework - Click-Once 是否可用/与 .NETCF 兼容?

C# Visual Studio 2010 旗舰版在 ClickOnce 部署中包含 html 文件

c# - 使用 ClickOnce 运行程序,而不是安装它

c# - 如何在 Msbuild 中调用第二个目标

.net - 寻找在 ClickOnce 应用程序中显示发行说明的建议

c# - 如何将 QBFC13_0.msm 添加到 Clickonce