更新时间:2021-09-17 22:13:48
我已经为此苦苦挣扎了几个月,终于找到了一种方法来禁用 Core 中项目的传递引用.
I've been struggling with this for months and finally found a way to disable the transitive references of projects in Core.
在 .Facade.EF 的 .csproj 文件中,您可以将 PrivateAssets="All"
添加到 .DAL 的 ProjectReference:
In the .csproj file for .Facade.EF, you can add PrivateAssets="All"
to the ProjectReference to .DAL:
<ItemGroup>
<ProjectReference Include="...DAL.DAL.csproj" PrivateAssets="All" />
</ItemGroup>
使用此设置,引用 .Facade.EF 的项目也不再引用 .DAL.
With this setting, projects that reference .Facade.EF no longer reference .DAL too.
用更抽象的术语来说,如果您希望 A 引用 B,B 引用 C,但不想 A 引用 C,请添加:
In more abstract terms, if you want A to reference B and B to reference C, but don't want A to reference C, add this:
在 B.csproj 中
<ItemGroup>
<ProjectReference Include="..CC.csproj" PrivateAssets="All" />
</ItemGroup>
Eclipse:无法解析org.hamcrest.core.CombinableMatcher $ CombinableBothMatcher类型.它是从所需的.class文件中间接引用的
从引用的 .NET Framework 项目序列化值类型期间 .NET Core 项目中的 TypeLoadException
从引用的 .NET Framework 项目序列化值类型期间 .NET Core 项目中的 TypeLoadException
从引用的 .NET Framework 项目序列化值类型期间 .NET Core 项目中的 TypeLoadException
从引用的.NET Framework项目对值类型进行序列化期间.NET Core项目中的TypeLoadException