I've got an existing WPF application built in Visual Studio 2019 (16.4.5), with much of its backend common code in a .NET Standard class library. I'm attempting to start a new frontend, built on Avalonia MVVM, which will be cross-platform. I've successfully created & run the "Hello World" Avalonia app. However, whenever I add any references to a class library (even if I create a new NET standard class library that's nothing more than the stub template created by VS), I get a runtime error:
System.IO.FileNotFoundException: 'Could not load file or assembly 'xxx, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.'
Eventually, I realized that Visual Studio is not adding the appropriate entries to deps.json. Any project references I add to my application, those references do not appear in deps.json. If I build, I can then manually add them - i.e.
},
"ClassLibrary1/1.0.0": {
"runtime": {
"ClassLibrary1.dll": {}
}
...And then it launches just fine. But if I rebuild, VS will of course regenerate deps.json, and those project references will again be missing.
Why would VS not be properly adding referenced projects to the deps.json it generates?