.NET 4.0 - Windows窗体应用程序不支持customHostSpecified属性。 [英] .NET 4.0 - The customHostSpecified attribute is not supported for Windows Forms applications.

查看:69
本文介绍了.NET 4.0 - Windows窗体应用程序不支持customHostSpecified属性。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在部署一次点击时遇到问题 - 如果我从subversion获得我的.NET 3.5解决方案的副本,并使用我的构建脚本生成一次点击,使用mage.exe,它工作正常和部署。如果我然后右键单击 - >在
我的Windows窗体项目上的属性,并将其更改为目标.NET 4 Framework(我还必须添加对Microsoft.CSharp的引用以使其构建)并运行相同的构建脚本,构建脚本完成任何错误,但部署在客户端上失败,并且
错误:"Windows窗体应用程序不支持customHostSpecified属性。"

I am having a problem with a click once deployment - if I get a copy of my .NET 3.5 solution from subversion and generate a click once deployment using my build script which makes use of mage.exe it works fine and deploys. If I then right click -> properties on my Windows Forms project and change it to target the .NET 4 Framework (I also have to add a reference to Microsoft.CSharp to get it to build) and run the same build script the build script completes without any errors but the deployment fails on the client with the error: "The customHostSpecified attribute is not supported for Windows Forms applications."

mage.exe部分构建脚本是:

The mage.exe part of the build script is:

  < Target Name =" PrepareClickOnceDeployment">

    < Exec Command ="& quot; C:\Program Files(x86)\ Mysoftoft SDKs \ Windows \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ -New Application -ToFile& quot; $(TestDeployVersionDir)\ AlphaForms.exe.manifest& quot; -Name& quot; Alpha BackOffice Test& quot;
-Version $(ReleaseVersion)-FromDirectory& quot; $(TestDeployVersionDir)& quot; -TrustLevel FullTrust -IconFile Resources\AppIcon.ico" />

    < Exec Command ="& quot; C:\Program Files(x86)\ Mysoftoft SDKs \ Windows \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ -Sign& quot; $(TestDeployVersionDir)\ AlphaForms.exe.manifest& quot; -CertFile& quot; $(TestCert)& quot;" />

  <Target Name="PrepareClickOnceDeployment">
    <Exec Command="&quot;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\mage.exe&quot; -New Application -ToFile &quot;$(TestDeployVersionDir)\AlphaForms.exe.manifest&quot; -Name &quot;Alpha BackOffice Test&quot; -Version $(ReleaseVersion) -FromDirectory &quot;$(TestDeployVersionDir)&quot; -TrustLevel FullTrust -IconFile Resources\AppIcon.ico"/>
    <Exec Command="&quot;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\mage.exe&quot; -Sign &quot;$(TestDeployVersionDir)\AlphaForms.exe.manifest&quot; -CertFile &quot;$(TestCert)&quot;"/>

    < Exec Command ="& quot; C:\Program Files(x86)\ Mysoftoft SDKs \ Windows \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ -Update& quot; $(TestDeployDir)\ AlphaForms.application& quot; -Version $(ReleaseVersion)-AppManifest& quot; $(TestDeployVersionDir)\ AlphaForms.exe.manifest& quot;
$ -MinVersion(ReleaseVersion)-ProviderUrl $(TestClickOnceURL)/AlphaForms.application -Publisher&安培; QUOT;出版商名称&安培; QUOT;" />

&NBSP;&NBSP;&NBSP; < Exec Command ="& quot; C:\Program Files(x86)\ Mysoftoft SDKs \ Windows \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ -Sign& quot; $(TestDeployDir)\ AlphaForms.application& quot; -CertFile& quot; $(TestCert)& quot;" /> 

    <Exec Command="&quot;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\mage.exe&quot; -Update &quot;$(TestDeployDir)\AlphaForms.application&quot; -Version $(ReleaseVersion) -AppManifest &quot;$(TestDeployVersionDir)\AlphaForms.exe.manifest&quot; -MinVersion $(ReleaseVersion) -ProviderUrl $(TestClickOnceURL)/AlphaForms.application -Publisher &quot;Publisher Name&quot;"/>
    <Exec Command="&quot;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\mage.exe&quot; -Sign &quot;$(TestDeployDir)\AlphaForms.application&quot; -CertFile &quot;$(TestCert)&quot;"/> 

    < GenerateBootstrapper ApplicationFile = QUOT; AlphaForms.application"

&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP ;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;应用程序名称=" Alpha回到办公室测试"

&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP ;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; ApplicationUrl = QUOT; $(TestClickOnceURL)/ $(ReleaseVersion)"

&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP ;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; BootstrapperItems = QUOT; @(BootstrapperFile)"

&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;培养= QUOT;恩"

&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; FallbackCulture =" en-US"&bbsp b                  &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; CopyComponents =" true"

                   &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;验证=" false"&
                   &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; OutputPath = QUOT; $(TestDeployDir)" />

  < / Target>

    <GenerateBootstrapper ApplicationFile="AlphaForms.application"
                          ApplicationName="Alpha Back Office Test"
                          ApplicationUrl="$(TestClickOnceURL)/$(ReleaseVersion)"
                          BootstrapperItems="@(BootstrapperFile)"
                          Culture="en"
                          FallbackCulture="en-US"
                          CopyComponents="true"
                          Validate="false"
                          OutputPath="$(TestDeployDir)" />
  </Target>

完整的错误详情为:

平台版本信息

  Windows   ; :6.1.7600.0(Win32NT)

 公共语言运行时 :4.0.30319.1

  System.Deployment.dll  :4.0 .30319.1(RTMRel.030319-0100)

&NBSP; clr.dll&NBSP;&NBSP;&NBSP ;: 4.0.30319.1(RTMRel.030319-0100)

&NBSP; dfdll .dll   :4.0.30319.1(RTMRel.030319-0100)

  dfshim.dll   :4.0.31106.0(Main.031106-0000)

PLATFORM VERSION INFO
 Windows    : 6.1.7600.0 (Win32NT)
 Common Language Runtime  : 4.0.30319.1
 System.Deployment.dll   : 4.0.30319.1 (RTMRel.030319-0100)
 clr.dll    : 4.0.30319.1 (RTMRel.030319-0100)
 dfdll.dll    : 4.0.30319.1 (RTMRel.030319-0100)
 dfshim.dll    : 4.0.31106.0 (Main.031106-0000)

SOURCES

&NBSP;部署URL&NBSP;&NBSP;&NBSP ;:
http://slon02/alphatest/AlphaForms.application


       Server   ;:Microsoft-IIS / 6.0

       X-Powered-By :ASP.NET

 部署提供商网址  :
http:// sl on02 / alphatest // AlphaForms.application


       Server  :Microsoft-IIS / 6.0

       X-Powered-By :ASP.NET

 应用程序网址   :
http://slon02/alphatest//1.2.0.51/AlphaForms.exe.manifest


  ;      Server   ;:Microsoft-IIS / 6.0

       X-Powered-By :ASP。 NET

SOURCES
 Deployment url   : http://slon02/alphatest/AlphaForms.application
      Server  : Microsoft-IIS/6.0
      X-Powered-By : ASP.NET
 Deployment Provider url  : http://slon02/alphatest//AlphaForms.application
      Server  : Microsoft-IIS/6.0
      X-Powered-By : ASP.NET
 Application url   : http://slon02/alphatest//1.2.0.51/AlphaForms.exe.manifest
      Server  : Microsoft-IIS/6.0
      X-Powered-By : ASP.NET

恒等式

&NBSP;部署身份&NBSP;&NBSP ;: Alpha回到办公室Test.app,版本= 1.2.0.51,文化=中性公钥= 77e4696e8601bc24, processorArchitecture = msil

IDENTITIES
 Deployment Identity  : Alpha Back Office Test.app, Version=1.2.0.51, Culture=neutral, PublicKeyToken=77e4696e8601bc24, processorArchitecture=msil

应用程序摘要

  *可安装的应用程序。

APPLICATION SUMMARY
 * Installable application.

错误摘要

 以下是错误摘要,这些错误的详细信息将在日志后面列出。

  *激活 http://slon02/alphatest/AlphaForms.application 导致异常。检测到以下失败消息:

   + Windows窗体应用程序不支持customHostSpecified属性。

ERROR SUMMARY
 Below is a summary of the errors, details of these errors are listed later in the log.
 * Activation of http://slon02/alphatest/AlphaForms.application resulted in exception. Following failure messages were detected:
  + The customHostSpecified attribute is not supported for Windows Forms applications.

组件商店交易失败摘要

 未检测到交易错误。

COMPONENT STORE TRANSACTION FAILURE SUMMARY
 No transaction error was detected.

警告

 此操作期间没有任何警告。

WARNINGS
 There were no warnings during this operation.

操作进度状态

  * [04/06/2010 14:38:18]:激活
http://slon02/alphatest/AlphaForms.application
已经开始。

  * [04/06/2010 14:38:18]:处理部署清单已成功完成。

  * [04/06/2010 14:38:18]:已开始安装应用程序。

OPERATION PROGRESS STATUS
 * [04/06/2010 14:38:18] : Activation of http://slon02/alphatest/AlphaForms.application has started.
 * [04/06/2010 14:38:18] : Processing of deployment manifest has successfully completed.
 * [04/06/2010 14:38:18] : Installation of the application has started.

ERROR DETAILS

&NBSP;在此操作期间检测到下列错误

&NBSP; * [04/06/2010 14时38分18秒] System.Deployment.Application.DeploymentException(ManifestSemanticValidation)

   - 自定义Windows窗体应用程序不支持HostSpecified属性。

   - 来源:System.Deployment

   - 堆栈跟踪:

   在System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState,ActivationDescription actDesc,Int64 transactionId,TempDirectory& downloadTemp)

&NBSP;&NBSP;&NBSP;在System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState&安培;子状态中,ActivationDescription actDesc)

&NBSP;&NBSP;&NBSP;在系统.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri,Boolean isShortcut,String textualSubId,String deploymentProviderUrlFromExtension,BrowserSettings browserSettings,String& errorPageUrl)

    at System.Deployment.Application.ApplicationActivator .ActivateDeploymentWorker(对象状态)

ERROR DETAILS
 Following errors were detected during this operation.
 * [04/06/2010 14:38:18] System.Deployment.Application.DeploymentException (ManifestSemanticValidation)
  - The customHostSpecified attribute is not supported for Windows Forms applications.
  - Source: System.Deployment
  - Stack trace:
   at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
   at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
   at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
   at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)

COMPONENT STORE TRANSACTION DETAILS

 没有可用的交易信息。

COMPONENT STORE TRANSACTION DETAILS
 No transaction information is available.

没有任何变化在构建脚本中,除了目标框架之外,代码中没有任何变化,当我将其定位到3.5框架时它会部署得很好,当我将它变为4.0框架时,它会因为该错误而失败。

Nothing changes in the build script and nothing changes in the code apart from the target framework, it deploys fine when I target the 3.5 framework, when I chage it to 4.0 framework it fails with that error.

推荐答案

坦率地说,这是我要做的第一件事修复:

To be frank, this is the first thing I would fix:

>>(我还必须添加对Microsoft.CSharp的引用以使其构建

>>(I also have to add a reference to Microsoft.CSharp to get it to build

你绝对不应该要做到这一点。如果你有一个基本的问题,那就不知道还有什么问题了。

You should definitely not have to do that. If you have a problem as basic as that, there's no telling what else is mucked up.

你是否在Visual Studio中打开解决方案并在应用程序中将目标框架更改为.NET 4.0解决方案中包含的所有项目的选项卡?如果你这样做了,你是否尝试建立它是否有效?

Did you open the solution in Visual Studio and change the target framework to .NET 4.0 in the Application tab on all of the projects included in the solution? If you did that, did you try building to see if it worked?

RobinDotNet

RobinDotNet

 


这篇关于.NET 4.0 - Windows窗体应用程序不支持customHostSpecified属性。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆