I am trying to get .Net Framework and NetStandard assemblies to communicate with each other (to find out what is possible). I currently have four projects, two Framework 4.5.2 projects and two NetStandard1.2 projects:
Framework452.LibraryNetStandard12.CentralLibraryNetStandard12.BaseLibraryFramework452.Tests
Link Structure:
Framework452.Testslinks NetStandard12.CentralLibrary: we work by adding the NetStandard.Library nuget package to Framework452.Tests.NetStandard12.CentralLibrarylinks NetStandard12.BaseLibrary: work without changes.NetStandard12.CentralLibrarylinks Framework452.Library: does not work even if Framework452.LibraryNetStandard.Library nuget is installed.
Can NetStandard projects refer to Framework projects? If so, what do I need to do to make them communicate? At the moment I can add a link, but the code is not displayed.
Update
, , , Framework452.Tests:
CS0006: '~\TryNETStandard\NetStandard12.CentralLibrary\Bin\Debug\netstandard1.2\NetStandard12.CentralLibrary.dll' .
namespace Framework452.Library
{
public class Returner452 {
public static bool ReturnTrue() { return true; }
}
}
using Xunit;
namespace Framework452.Tests
{
public class Class1 {
[Fact]
public void FrameworkTest() {
Assert.True(NetStandard12.CentralLibrary.Class1.Return452());
}
[Fact]
public void NetStandardTest() {
Assert.True(NetStandard12.CentralLibrary.Class1.Return12());
}
}
}
namespace NetStandard12.BaseLibrary
{
public class Returner12 {
public static bool ReturnTrue() { return true; }
}
}
using Framework452.Library;
using NetStandard12.BaseLibrary;
namespace NetStandard12.CentralLibrary
{
public class Class1
{
public static bool Return452() { return Returner452.ReturnTrue(); }
public static bool Return12() { return Returner12.ReturnTrue(); }
}
}