Answer the question
In order to leave comments, you need to log in
How does dependency hooking work with NetCore and NetStandard?
Stage 1.
There is a NetStandardLibrary project on NetStandard 2.0. It includes the "System.IO.FileSystem.AccessControl" package as a dependency and declares the only class with the Test method:
using System;
namespace NetStandardLibrary
{
public class Class1
{
public static bool Test(string folder)
{
try
{
var ds = new System.Security.AccessControl.DirectorySecurity(folder, System.Security.AccessControl.AccessControlSections.All);
return true;
}
catch
{
return false;
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestNetFullApp
{
class Program
{
static void Main(string[] args)
{
try
{
var d = NetStandardLibrary.Class1.Test(Environment.CurrentDirectory);
Console.WriteLine("Hello World!");
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
Console.ReadLine();
}
}
}
Answer the question
In order to leave comments, you need to log in
You have come across a library that has different versions for different operating systems (in nuget this is called runtimes). This can be stated by the presence of the runtimes folder in the root of the nuget package. The assembly that you see in lib\netstandard2.0 (weights 29 kb) redirects the types to the assembly for a specific runtime (EMNIP).
Start here: https://natemcmaster.com/blog/2016/05/19/nuget3-ri...
Yes.
What does NuGet independent mean? Where do you see addiction?
https://docs.microsoft.com/en-us/dotnet/core/tools... :
Starting with .NET Core 2.0, you don't have to run dotnet restore because it's run implicitly by all commands, such as dotnet build and dotnet run, that require a restore to occur.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question