I am trying to develop an application that runs in Windows and on the Mac desktop. I realize these are rather old-fashioned requirements, but bear with me. I want to separate concerns so that the Windows and Mac "Views" can be built on top of an independent "Model", with an intervening "Controller" or "View Model". My background is in Windows, so I'm trying to develop as much as possible in C# (although I realize it will be necessary to familiarize myself with Mac development). I'm using Visual Studio Community Edition in Windows and on the Mac. The Visual Studio solution is checked into GitHub.
Having explored various possibilities, my current knowledge suggests the following sample architecture (let me know what you think):
I first created the WPF application and the .NET Standard library. Then I added the Mac application. On the Mac, the WPF application was automatically ignored, and Xamarin.Mac was able to successfully call a method in the shared library. However, when I went back to development in Windows, I got the following error in the Mac project:
Error CS0012 The type 'Uri' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=184.108.40.206, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
This is an error in the code for the Mac project, yet there were no problems on the Mac. My inclination was not to fix this error on the Windows side, but rather to figure out if I could ignore the Mac project, mirroring the behavior on the Mac.
I did this by going to the solution's Properties, and deactivating the build for the Mac project. The solution now built successfully in Windows. But as you can imagine, my fear was that this would cause problems when I went back to the Mac.
Surprisingly, on the Mac, the Xamarin.Mac application continued to work. The only anomaly was that the Mac project showed a warning: "Project not built in active configuration".
So I now have a sample that fulfills my needs, except that I get a warning in Visual Studio for Mac. Is this just something I have to put up with, or is it a sign that I should be using a different architecture? If so, what should that architecture be?