Hello Microsoft Team,
I starting some PoC C# projects (Windows 10 & VS2019) I would like to create Windows Service application with underlying multiple target .NET frameworks (.Net Core3.1.Net Standard2.0 and .Net framework4.8)
as shows in diagram below:
It was able to successfully compiled and built but once Windows Service Started and calling .Net stanadard assembly
Then I'm facing two issues
Issue#1, When Windows Service process start and calling .Net Standard assembly It throws exception error
System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=18.104.22.168' or one of its dependencies
Then I tried overcome it by changing Assembly Binding configuration in .net48 project and it seems workig well.
And then I re-started the whole process again and facing another issue
System.BadImageFormatException: Could not load file or assembly 'System.Runtime, Version=22.214.171.124, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
At this point I'm not quite sure that the component structure above is a valid idea anymore, Could you please help confirm.
And even if it valid, How can we manage to referrence System.Runtime assembly across multiple targeting framework project?
Issue #2, After I reviewed the code I found something strange there were multiple errors in (2) .NET stadard project
even I got an error above but somehow the project still be able to succesfully compiled I think
this may link with the runtime issue above If your team could help clarify it would be helpful for me.
If you need any further detail please let me know.
I can't add the right question tag, any tag I try to put in after submit the edit it always turn to "windows-uwp-rutime" :(