3

VisualStudio2010とVB.NETを使用しています。私のターゲット環境は.NETFramework4.0です。

そのため、提供されたファイルを使用してプロジェクトを公開しているときに、この問題に直面していSetup.exeます。アプリケーション要件の確認がポップアップした後、アラートが次のテキストとともにポップアップしました。

続行できません。アプリケーションの形式が正しくありません。アプリケーションベンダーに連絡して支援を求めてください。

「詳細」ボタンをクリックすると、次のエラーが表示されました。

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

SOURCES
Deployment URL          : file:///I:/ProjectBMTRelease/ProjectBMT.application

IDENTITIES
Deployment Identity     : ProjectBMT.application, Version=1.0.0.6, Culture=neutral, PublicKeyToken=7439f62500c0364d, processorArchitecture=x86

APPLICATION SUMMARY
* Installable application.

ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of I:\ProjectBMTRelease\ProjectBMT.application resulted in exception. Following failure messages were detected:
    + Exception reading manifest from file:///I:/ProjectBMTRelease/Application%20Files/ProjectBMT_1_0_0_6/ProjectBMT.exe.manifest: the manifest may not be valid or the file could not be opened.
    + Parsing and DOM creation of the manifest resulted in error. Following parsing errors were noticed:
        -HRESULT:       0x80070c81
         Start line:    0
         Start column:  0
         Host file:
    + Exception from HRESULT: 0x80070C81

COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.

WARNINGS
There were no warnings during this operation.

OPERATION PROGRESS STATUS
* [6/23/2012 5:21:36 PM] : Activation of I:\ProjectBMTRelease\ProjectBMT.application has started.
* [6/23/2012 5:21:36 PM] : Processing of deployment manifest has successfully completed.
* [6/23/2012 5:21:36 PM] : Installation of the application has started.

ERROR DETAILS
Following errors were detected during this operation.
* [6/23/2012 5:21:36 PM] System.Deployment.Application.InvalidDeploymentException (ManifestParse)
    - Exception reading manifest from file:///I:/ProjectBMTRelease/Application%20Files/ProjectBMT_1_0_0_6/ProjectBMT.exe.manifest: the manifest may not be valid or the file could not be opened.
    - Source: System.Deployment
    - Stack trace:
        at System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)
        at System.Deployment.Application.DownloadManager.DownloadApplicationManifest(AssemblyManifest deploymentManifest, String targetDir, Uri deploymentUri, IDownloadNotification notification, DownloadOptions options, Uri& appSourceUri, String& appManifestPath)
        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)
    --- Inner Exception ---
    System.Deployment.Application.InvalidDeploymentException (ManifestParse)
    - Parsing and DOM creation of the manifest resulted in error. Following parsing errors were noticed:
        -HRESULT:       0x80070c81
         Start line:    0
         Start column:  0
         Host file:
    - Source: System.Deployment
    - Stack trace:
        at System.Deployment.Application.Manifest.AssemblyManifest.LoadCMSFromStream(Stream stream)
        at System.Deployment.Application.Manifest.AssemblyManifest..ctor(FileStream fileStream)
        at System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)
    --- Inner Exception ---
    System.Runtime.InteropServices.COMException
    - Exception from HRESULT: 0x80070C81
    - Source: System.Deployment
    - Stack trace:
        at System.Deployment.Internal.Isolation.IsolationInterop.CreateCMSFromXml(Byte[] buffer, UInt32 bufferSize, IManifestParseErrorCallback Callback, Guid& riid)
        at System.Deployment.Application.Manifest.AssemblyManifest.LoadCMSFromStream(Stream stream)

COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.

プロジェクトのマニフェストファイルを確認しましたが、問題を見つけるのに十分ではありません。その他の情報として、簡単な「HelloWorld!」を作成しました。それがうまく公開されるかどうかを確認するためのアプリケーション、そしてそれはしました。

解決策は何ですか?

4

5 に答える 5

2

以下を確認してください。

  • ユーザーのコンピュータに .NET 4 がインストールされていますか?

  • アプリケーションをどのように公開していますか? Visual Studio を使用していますか?

  • 公開後に展開に変更を加えていますか?

  • ファイルを配置場所に手動で移動する場合、構造は元の構造と同じですか?

詳細ログを有効にして、詳細情報が得られるかどうかを確認してください。記事「ClickOnce 配置でのログの強化」に、その方法が示されています。

于 2012-07-04T23:48:52.237 に答える
1

これとまったく同じエラーが発生しました。アプリケーション プロパティの最初のタブにあるアセンブリ名を変更したところ、問題は解決しました。スペースを含むアセンブリ名を持つと、空白のスペースを含むマニフェスト ファイル名が作成され、問題が発生するようです。私のアプリケーション アセンブリ名は "Capital Manager" という名前でした。「Capital_Manager」に変更した後(スペースをアンダースコア「_」に置き換えました)、問題は解決しました。

于 2013-04-01T00:14:26.390 に答える
1

ClickOnce インストーラーを実行しようとしたときに、エラー レポートとコール スタックを受け取りました。これまでの調査結果は、ここに到着した他の人に役立つ可能性があるため、詳細を投稿しますが、この同じエラーレポートはさまざまな問題によって引き起こされている可能性があると感じています.

最初に気付いたのは、アプリケーション マニフェスト (アプリケーションのすべてのファイルとそれぞれの署名ハッシュをリストしたもの) に、無効な publicKeyToken を持つアセンブリのエントリがあることでした。たとえば、

<asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1">
  <asmv1:assemblyIdentity name="foo.exe" version="1.2.3.4" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" type="win32" />

アセンブリのdependentAssembly要素を表示する代わりにファイルをさらに下に移動すると、一部のアセンブリがプレーン コンテンツ ファイル ( file要素) としてリストされました。

これらの問題は確かに ClickOnce 配置を無効にします。原因は、マニフェストを作成しようとしていたアセンブリよりも古いバージョンの.NETに対してコンパイルされたバージョンのMageを使用していたことです。アプリケーション マニフェストを作成するとき、Mage は次のようにアセンブリを読み取ろうとします。

AssemblyIdentity.FromFile(fileName);

また、.NET 3.5 ( CLR 2.0)に対してコンパイルされた Mageの場合、.NET 4.0 アセンブリをロードしようとすると、処理されるBadImageFormatException例外が発生し、これらのファイルをコンテンツ ファイルとして扱うフォールバック動作が発生します。

于 2013-05-28T14:25:12.983 に答える
1

Does your application folder have subfolders? I got this same HRESULT just yesterday, and the root cause was that a library (EntityFramework.dll) was in both the top level and in a subfolder. (There was a MAGE warning about this, but it was not handled as an error.) I updated my script to remove EntityFramework.dll from the subfolder, and the ClickOnce is fine now.

于 2016-08-26T16:04:57.013 に答える