Sara S.
Sara S.

Reputation: 1375

Converting from framework 3.5 to 4 app.config location

I had a project whose framework is 3.5 and i converted it to 4 and when i faced a problem of mixed mode. i changed the useLegacyV2RuntimeActivationPolicy from this answer

Now when i install my application to program files and try to run it, it crashes but when i place the config file beside my exe it runs. Can anyone tell my the reason of that crash?

Upvotes: 0

Views: 64

Answers (1)

Hans Passant
Hans Passant

Reputation: 942119

but when it was 3.5 i didn't need to place the app.config file beside the exe

That was required in 3.5 as well. It is the only way that the CLR can find the .config file. I'd have to guess that you somehow got away with it before and it just didn't matter. But now it is critical to let the CLR find the .config file since you really need that attribute to allow the mixed-mode assembly to load.

An obvious way ahead is to rebuild the C++/CLI assembly and have it target v4 as well. So you won't need the .config file anymore. If it is not yours then ask the vendor or author of the assembly for an update.

Upvotes: 1

Related Questions