Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3485310
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:53:32+00:00 2026-05-18T10:53:32+00:00

I have an App I have updated with some .Net4 assemblies, including the custom

  • 0

I have an App I have updated with some .Net4 assemblies, including the custom actions .dll that runs when the app is going to be uninstalled.
The App was initially installed with .Net 3.5 and it requires some custom actions when installing and uninstalling.

The problem is that now when uninstalling the .dll of the custom actions have changed to its .Net 4 version and I’m getting a
System.BadImageFormatException: Could not load file or assembly
‘X’ or one of its dependencies. This assembly is built by a
runtime newer than the currently loaded runtime and cannot be loaded. File
name: ‘X’

Does anyone knows a way to tell the uninstaller to start the process with .Net 4 instead of calling .Net 3.5 to load the custom actions Dll? Where does this uninstall information is stored for each product? and how?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T10:53:32+00:00Added an answer on May 18, 2026 at 10:53 am

    After a long research I found a way to solve the issue. I made a version of the application on .Net 4 and generated the installer. Installed it and then compared the .msi file the application saves on the C:\Windows\Installer folder with the previous version of the same file but with .Net 3.5 ( original installation). Then open both files with Orcas and changed some property values and a couple of binary files on the .Net 3.5 msi file from the new .Net 4 msi file.
    Now when I make an update of single files in the App to a .Net 4 version of them( so the app runs under .Net 4) I also need to change that uninstall .msi file located under c:\Windows\Installer and then when uninstalling the Windows Installer will invoke .Net 4 to do the custom actions instead of .Net 3.5 which was the original build when the app was installed.

    Here is a script that automates the process and no need to use orcas, just pass the msi file to change and the two necessary Dll ( which I extracted from the msi of the .Net 4 version).

    var installer=new ActiveXObject("WindowsInstaller.Installer");
    var db;
    var msiOpenDatabaseModeTransact = 1;
    var msiFile = WScript.Arguments.Item(0);
    var installbuildfile = WScript.Arguments.Item(1);
    var auxDllFile = WScript.Arguments.Item(2);
    database = installer.OpenDatabase(msiFile, msiOpenDatabaseModeTransact);
    
        var view = database.OpenView("SELECT Name,Data FROM Binary");
        view.Execute();
        var rec;
        for (rec = view.Fetch(); rec != null; rec = view.Fetch()) {
            WScript.echo("Current SmartUpdater.exe version is: "+rec.StringData(1)); 
            if (rec.StringData(1) == "InstallUtil") {
                rec.SetStream(2, installbuildfile);
                view.Modify(2, rec)
                WScript.echo("Changed: " + rec.StringData(1)); 
            }
            if (rec.StringData(1) == "MSVBDPCADLL") {
                rec.SetStream(2, auxDllFile);
                view.Modify(2, rec)
                WScript.echo("Changed: " + rec.StringData(1)); 
            }
        }
        view.Close();
        view = database.OpenView("UPDATE Property SET Value='v4.0' WHERE Property='VSDFrameworkVersion'");
        view.Execute();
        view.Close();
    
    database.Commit();
    

    The InstallUtil dll file can be found on the .Net directory under c:\Windows for the 4.0 version, the second one named MSVBDPCADLL is still a mistery for me, but I could extract it from the MSI of the generated .Net 4 ( there can be differences for 32 and 64 versions, probably you will need to extract the different versions of the Dlls)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app that updates itself over the internet, and the updated copy
I have a small app that a client uses to manually update some data.
I have WPF App, that needs to be update some data , after computer
I have one console app that is doing some lengthy syncing to an ftp
I have a multithreaded app that has to read some data often, and occasionally
I have Rails app with some Resque workers. It seems that I have a
I currently have an app published on the App Store but I've just updated
I just updated an app from .NET 2.0 to .NET 4.0 and I have
I recently updated a rails app from 3.0.4 to 3.2.4 and I have a
We have a web app that we update and release almost daily. We use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.