首页 > 解决方案 > Running .NET 2.0 4.0 machine without app.config?

问题描述

I am building an application targeted mostly towards Windows 10, but I would also like to include some legacy support for XP+.

I know this is possible by configuring an app.config file with the "startup useLegacyV2RuntimeActivationPolicy" tag. However I do not want to include a dependency, as that would require me to either A:have an installer that extracts both files or B:have to release the application as an archive. Both of these options are reasonable, but if at all possible I would like it to be a nice and clean, completely portable, packaged in one executable application.

Speaking of packaged, that leads me to option C. I am aware that I cannot simply add this app.config file as an embedded resource and have the LegacyV2Runtime tag still be active (or maybe I can who knows, I just assumed it would not work). So assuming that's out the window, I previously recall an application that was able to pack all the files Dll's into the executable, and it worked very very well. I do not believe it was ILSpy, as I think it worked with Native code. I am struggling to find this application, but assuming I do find it, would windows possibly recognize the app.config file?

If this does not work, then I guess my next preferred route would be to create an Installer executable. My only languages are .NET and a bit of java, so I'm not sure what language would be ideal to create this in that support XP-Win 10. Any suggestions? Thanks!

标签: c#.netvb.net

解决方案


推荐阅读