1

So we have this class FilePickerDialog derived from CustomDialog class. FilePickerDialog is built with .net framework while CustomDialog is built with .net6

Then we have an application in .net6 that instantiate objFilePickerDialog and later on casted to CustomDialog using objFilePickerDialog as CustomDialog, this resulted as a null.

Once we rebuilt FilePickerDialog into .net6, then the casting works. However, we are not sure what is the explanation to this situation. Can someone help to clear the air for us?

ProgrammingLlama
  • 36,677
  • 7
  • 67
  • 86
Athena_92
  • 29
  • 5
  • 7
    Wait...you're saying that you're referencing a .NET 6 library from .NET Framework? – ProgrammingLlama Jul 13 '22 at 06:10
  • Nope, the other way round. I have an migrated .NET 6 application that still reference some .NET Framework libraries. Just noticed this [thread](https://stackoverflow.com/questions/70005465/can-i-add-a-reference-to-a-net-framework-dll-from-a-net-6-project). I guess it is not recommended to do it this way, it should be .NET 6 throughout the entire application. Some .net framework libraries might still work in .net 6 application but not guaranteed. – Athena_92 Jul 14 '22 at 01:26

0 Answers0