1

Background: I have a winforms app written in C# that converts xlsx files to csv by calling a 2nd entirely seperate application ConvertExcelTo.Exe from the command line.

Error Summary:

   Application validation did not succeed. Unable to continue.
   - Reference in the manifest does not match the identity of the downloaded assembly
     ConvertExcelTo.exe.    
   - Source: System.Deployment
  • How/Where do I edit the Manifest and References section?
  • What do I have to change to make this install correctly without any errors??

Under References, ConvertExcelTo I have: Assembly ConvertExcelTo - C:\Users\bmccarthy\Documents\Visual Studio 2008\Projects\CCP Utility 3-31-11\CCP Utility\bin\Debug\ConvertExcelTo.exe

Under References, ConvertExcelTo.vshost I have: {} Microsoft.VisualStudio.HostingProcess, EntryPoint, Base Types, Objects: ~Object(), Equals(object, object), Equals(object), GetHashCode(), GetType(), MemberwiseClone(), Object(), ReferenceEquals(object, object), ToString().

Full Error Details:

      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.

      ERROR DETAILS
Following errors were detected during this operation.
* [4/6/2011] System.Deployment.Application.InvalidDeploymentException(RefDefValidation)
    - Reference in the manifest does not match the identity of the downloaded assembly 
      ConvertExcelTo.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)

Here's the code in MainForm.cs where I call the ConvertExcelTo.exe application:

            //Process that creates all the xlsx files in temp folder to csv files.
            Process convertFilesProcess = new Process();

            // command prompt execution for Converting Files from XLSX to CSV 
            //convertFilesProcess.StartInfo.WorkingDirectory = ConfigurationSettings.AppSettings["WorkingDirectory"].ToString();
            convertFilesProcess.StartInfo.FileName = "ConvertExcelTo.exe";
            convertFilesProcess.StartInfo.Arguments = " " + tempfolder + "\\ " + "csv";
            convertFilesProcess.StartInfo.UseShellExecute = false;
            convertFilesProcess.StartInfo.CreateNoWindow = true;
            convertFilesProcess.StartInfo.RedirectStandardInput = true;
            convertFilesProcess.StartInfo.RedirectStandardOutput = true;
            convertFilesProcess.StartInfo.RedirectStandardError = true;
            convertFilesProcess.Start();
            convertFilesProcess.WaitForExit();

            StreamReader sOut = convertFilesProcess.StandardOutput;
            StreamReader sErr = convertFilesProcess.StandardError;
            sOut.Close();
            sErr.Close();

Thanks for looking!

Brian McCarthy
  • 4,658
  • 16
  • 49
  • 66
  • 1
    Take a look at your manifest that gets genereated for your deployment. Their could be a difference in application names??? In the ErrorSummary, there is this line 'Reference in the manifest does not match the identity of the downloaded assembly ConvertExcelTo.exe.' – jonnyb Apr 06 '11 at 14:03
  • @jonnyItunes, thanks for your response. I edited my question to give you a better idea of the problem. this application calls a 2nd entirely seperate application ConvertExcelTo.Exe from the command line. Where do I go to edit the manifest or references? I dont think ConvertExcelTo as an external application needs a reference, right? – Brian McCarthy Apr 06 '11 at 14:22
  • see answer below. Hope it helps. – jonnyb Apr 06 '11 at 15:14
  • Possibly related: http://stackoverflow.com/a/5339135/194717 – Tony Apr 15 '17 at 01:44

2 Answers2

1

Thanks for the clarification. Take a look at this page here. This steps you through how to edit the deployment manifest. You should install the ConvertExcelTo.exe as another application. You can add it as a prereq for your install process through the manifest and bootstrap it to the install. Some info on bootstrapping here. It's for VS 2005, but I don't think the process has changed. Bootstrap Manifest Generator app is here. Just click on the Downloads tab. Hope this helps you out.

jonnyb
  • 352
  • 1
  • 2
  • 17
  • @JohnnyItunes, I deleted the reference to ConvertExcelTo.exe and the application doesn't work now even though I'm going through the process approach... What do you suggest I do to make it install correctly and still work? – Brian McCarthy Apr 06 '11 at 17:56
  • @JohnnyItunes, can i keep the reference if I add the file through the Bootstrap Manifest Generator app ? – Brian McCarthy Apr 06 '11 at 17:57
1

by calling a 2nd entirely seperate application ConvertExcelTo.Exe from the command line

That's not what you are doing, you are actually trying to load that EXE assembly. Twice, once through the visual studio hosting process version of the executable, relevant only when you debug an EXE. Again through the regular EXE. It's a bit of a quirk in .NET that this is even possible, comes in handy in very select cases. Not here, the CLR is throwing a hissy fit at this.

Remove the assembly references you added. Use the Process class to start this program.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
  • I deleted the reference to ConvertExcelTo.exe and the application doesn't work now even though I'm going through the process approach... What do you suggest I do? – Brian McCarthy Apr 06 '11 at 17:55
  • Sigh, what am I supposed to do with 'it doesn't work'? Use the debugger. Set the command line options you normally pass with Project + Properties, Debug tab. – Hans Passant Apr 06 '11 at 18:01
  • Sorry, I meant that the command line execution of the ConvertExcelTo Fails. – Brian McCarthy Apr 06 '11 at 18:27
  • 1
    "It fails". How is that a better diagnostic than "it doesn't work"? For crissake, document the exception. – Hans Passant Apr 06 '11 at 18:36
  • Haha sorry. I added the existing items ConvertExcelTo.exe, ConvertExcelTo.vshost.exe, ExcelConversion.dll to the Project Solution and deleted the References and now it works. :) Thanks – Brian McCarthy Apr 06 '11 at 18:41