comtypes icon indicating copy to clipboard operation
comtypes copied to clipboard

Can not run WPF application using comtypes

Open niveshvashist opened this issue 9 years ago • 0 comments

I have a WPF application, that internally uses an "app.config" file to run.

About the app.config file:

  1. It is placed in the same directory as the .cs file is.
  2. This "app.config" file mentions the dot net framework version to run with.
  3. If we remove this app.config file, the following error is shown by the c# program : "Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information."

Now, I am try to port this WPF program into its python comtypes equivalent.

Problem: As soon as the command that opens the WPF GUI is executed, the "Mixed mode assembly....." error is thrown.

I have been looking for solution on Google, but all of them talk about how to create the config manager equivalent of the config file and then read the file into python program. Actually, in my c# program I do not read anything from app.config file, instead, dot net itself manages everything in the background.

How can I handle this problem using comtypes?

I am currently using Python 2.7. If moving to Python 3.5 is necessary and solves my problem, I can do that.

Thanks and Regards.

niveshvashist avatar Apr 08 '16 06:04 niveshvashist