I would like to create a VS Solution with a project which uses .NET Framework 4.5.2 and another project with 4.6.2 in the same VS Solution.
Having projects using different versions of .Net in the same solution is fine. When you add references between projects you may have issues. Projects can reference other projects that are at-or-below the version of the referencing project. I.e., a .Net 4.5 project can reference .Net 4.5 projects and lower.
Now if you add a reference to a .Net 4.6.2 project to the .Net 4.5 project, it will not resolve or in other words, the reference simply won't work. Unfortunately, Visual Studio won't stop you (at least at the time of writing) so you need to look for a couple visual cues to let you know something is amiss. One is in the references list under the project in Visual Studio; an exclamation point will show next to your reference like this:
The other cue will be compile time warnings like this:
You'll want to keep an eye out for this since it will most likely cause run time issues if you use that assembly in the referencing project which can be a headache to troubleshoot.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With