How to Get Rid of the TargetFrameworkMoniker Error Message in Visual Studio

A few days ago, I tried to update my side-projects to .Net 4.8. With most projects this worked without any problems. But in the middle of the upgrade I got this strange error message:

TargetFrameworkMoniker: Value does not fall within the expected range.

This error message is useless and gives no clue about the problem. But fortunately for us, the problem can be solved quite easily: All you need to do is to close all open app.config and web.config files. As soon as you close them you can switch to .Net 4.8 in the properties dialog without any problems.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.