发布Orleans Silo项目时遇Application validation did not succeed错误求助
Based on your error log and the steps you've already tried, the core issue here is that the identity (version, public key token) of OrleansCounterControl.exe referenced in your ClickOnce manifest doesn't match the actual downloaded assembly. This is a common pain point when using NuGet packages with ClickOnce, as automated manifest generation often misreads package assembly metadata.
Here are targeted solutions to resolve this:
1. Unify Orleans NuGet Package Versions
First, ensure all your Orleans-related NuGet packages are on the same stable version. Mismatched versions between Orleans core and auxiliary packages (like OrleansCounterControl) will cause identity conflicts:
- Open the NuGet Package Manager for your solution
- Filter for packages starting with "Orleans"
- Select all of them and update to the latest consistent version
- Run
Clean Solutionfollowed byRebuild Solutionto clear old build artifacts
2. Manually Align Manifest with Assembly Identity
ClickOnce's auto-generated manifest often gets assembly details wrong. Let's fix this:
- Locate your published application manifest (
SHMSSilo.exe.manifestin theApplication Filesfolder) - Find the
<dependency>entry forOrleansCounterControl.exe, which looks like this:<dependency> <dependentAssembly dependencyType="install" allowDelayedBinding="true"> <assemblyIdentity name="OrleansCounterControl" version="X.X.X.X" publicKeyToken="XXXXXX" processorArchitecture="msil" /> </dependentAssembly> </dependency> - Get the actual identity of the
OrleansCounterControl.exefile from your build output:- Right-click the file → Properties → Details tab to check the version
- Use Visual Studio Developer Command Prompt to run
sn -T OrleansCounterControl.exeto get the public key token
- Update the manifest's
<assemblyIdentity>values to match the actual file, then re-publish your application
3. Exclude OrleansCounterControl.exe from ClickOnce Deployment
If your Silo doesn't directly use OrleansCounterControl.exe (it's a utility for performance counters), you can exclude it entirely:
- In your project references, find
OrleansCounterControl(if present) and set Copy Local toFalse - Go to Project Properties → Publish → Application Files
- Find
OrleansCounterControl.exein the list, set its Publish Status to Exclude - Rebuild and re-publish
4. Clear ClickOnce Cache
Old cached assemblies can cause validation issues even after fixing manifests. Clear the cache by:
- Opening Command Prompt and running
rundll32 dfshim.dll,ShOpenVerbApplication file:///C:/SHMSSilo/SHMSSilo.application - Or use the ClickOnce cache cleaner tool: run
mage -ccin Developer Command Prompt
Error Log Reference
PLATFORM VERSION INFO
Windows : 6.2.9200.0 (Win32NT)
Common Language Runtime : 4.0.30319.42000
System.Deployment.dll : 4.6.1087.0 built by: NETFXREL4STAGE
clr.dll : 4.6.1087.0 built by: NETFXREL4STAGE
dfdll.dll : 4.6.1087.0 built by: NETFXREL4STAGE
dfshim.dll : 6.3.9600.16384 (winblue_rtm.130821-1623)SOURCES
Deployment url : file:///C:/SHMSSilo/SHMSSilo.application
Application url : file:///C:/SHMSSilo/Application%20Files/SHMSSilo_1_0_0_12/SHMSSilo.exe.manifestIDENTITIES
Deployment Identity : SHMSSilo.application, Version=1.0.0.12, Culture=neutral, PublicKeyToken=0000000000000000, processorArchitecture=msil
Application Identity : SHMSSilo.exe, Version=1.0.0.12, Culture=neutral, PublicKeyToken=0000000000000000, processorArchitecture=msil, type=win32APPLICATION SUMMARY
- Installable application.
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
- Activation of C:\SHMSSilo\SHMSSilo.application resulted in exception. Following failure messages were detected:
- Reference in the manifest does not match the identity of the downloaded assembly OrleansCounterControl.exe.
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.WARNINGS
- The manifest for this application does not have a signature. Signature validation will be ignored.
- The manifest for this application does not have a signature. Signature validation will be ignored.
OPERATION PROGRESS STATUS
- [23-01-2018 11:29:49] : Activation of C:\SHMSSilo\SHMSSilo.application has started.
- [23-01-2018 11:29:49] : Processing of deployment manifest has successfully completed.
- [23-01-2018 11:29:49] : Installation of the application has started.
- [23-01-2018 11:29:49] : Processing of application manifest has successfully completed.
- [23-01-2018 11:29:52] : Found compatible runtime version 4.0.30319.
- [23-01-2018 11:29:52] : Request of trust and detection of platform is complete.
ERROR DETAILS
Following errors were detected during this operation.
- [23-01-2018 11:29:52] System.Deployment.Application.InvalidDeploymentException (RefDefValidation)
- Reference in the manifest does not match the identity of the downloaded assembly OrleansCounterControl.exe.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.DownloadManager.ProcessDownloadedFile(Object sender, DownloadEventArgs e)
at System.Deployment.Application.FileDownloader.DownloadModifiedEventHandler.Invoke(Object sender, DownloadEventArgs e)
at System.Deployment.Application.FileDownloader.OnModified()
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
at System.Deployment.Application.DownloadManager.DownloadDependencies(SubscriptionState subState, AssemblyManifest deployManifest, AssemblyManifest appManifest, Uri sourceUriBase, String targetDirectory, String group, IDownloadNotification notification, DownloadOptions options)
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
No transaction information is available.
内容的提问来源于stack exchange,提问作者Myrtue

