0

Spoiler: I have tried it an it actually did work. But why? And is it save to assume that my application will continue running without any runtime errors related to .NET framework?

It would save a lot of trouble because it concerns only a small add-on application. We neither want to introduce another .NET framework version to the customer's computer, nor retarget the app to an older framework, if possible.

There are tons of information like the one at Microsoft Docs for the situation where an older app runs with a newer framework but I have not found any official information about the opposite situation.

FarwoodHill
  • 552
  • 1
  • 9
  • 18
  • https://stackoverflow.com/questions/44325509/will-an-application-run-when-only-a-newer-framework-is-installed#:~:text=An%20application%20built%20for%204.6,platform%20with%20at%20least%204.6. – MD. RAKIB HASAN Jan 19 '21 at 10:17
  • @MD.RAKIBHASAN That's the other way round. OP is asking about running a .Net Framework 4.7.2 app on .Net Framework 4.5. Not running a .Net Framework 4.5 app on .Net Framework 4.7.2 – phuzi Jan 19 '21 at 10:21
  • I've already [answered](https://stackoverflow.com/a/55791835/4728685) the similar question, you might look at [`supportedruntime`](https://learn.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/startup/supportedruntime-element) setting – Pavel Anikhouski Jan 19 '21 at 10:22
  • "nor retarget the app to an older framework" - but switching to targetting the specific framework you want it to run on would *quickly* let you identify areas where there *would* be an issue, because it would fail to compile – Damien_The_Unbeliever Jan 19 '21 at 10:24
  • @Damien_The_Unbeliever Since all .NET FW 4.x share the same CLR 4, it might fail in runtime only, when app tries to use some feature, which isn't supported by runtime, but works on dev machine – Pavel Anikhouski Jan 19 '21 at 10:30
  • @PavelAnikhouski I don't think supportedRuntime setting is an option in this case. If I add the setting with 4.7.2 the app won't run. If I add the setting with 4.5 I don't think there will be a difference, will it? It can run on 4.5 anyway since it's the only one installed. – FarwoodHill Jan 19 '21 at 10:44

1 Answers1

0

Caveat: I'm going to make the assumption that it truly is running on .Net Framework 4.5.

I think you got very lucky and your app doesn't use any features added after 4.5. As such this could not be guaranteed to work in the future if any later changes use features released after .Net Framework 4.5.

phuzi
  • 12,078
  • 3
  • 26
  • 50