Preventing .NET Core Nested Project References

前端 未结 2 1600
天涯浪人
天涯浪人 2020-12-20 20:52

Given the situation that I have a .NET Core 2.0 Application I also have a Web assembly, a Business assembly, and a DataAccess assembly.

I don\'t want the Web assembl

2条回答
  •  醉梦人生
    2020-12-20 21:07

    In order to prevent your DataAccess layer to be visible from a web layer, you should put PrivateAssets element inside a .csproj file of your business layer. Like in a code below.

    
     
       all
     
     
    

    Here you can read more information about PrivateAssets element: https://docs.microsoft.com/en-us/dotnet/core/tools/csproj

提交回复
热议问题