DWQA QuestionsCategory: Development ToolHow do vs multi framework projects remove some locked reference assemblies?
ahdung asked 2 months ago

As shown in the figure:
图片描述
Some assemblies I don’t reference, such as System.Drawing , but it appears in the reference and is locked. It can’t be deleted. What’s the matter?

1 Answers
ahdung answered 2 months ago

I know the answer. These lock references are in theMicrosoft.NET.Sdk.BeforeCommon.targetsThis file is defined in the file. This file belongs to the dotnet core SDK. If there are multiple versions of DONet core SDK installed on the developer, there are also multiple versions of the file. The location is not important. Use everything to search.
The solution is not to modify the above file, just in the project. Csproj file, in thePropertyGroupAdd belowDisableImplicitFrameworkReferencesAttribute, as follows:

<PropertyGroup>
  <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
<PropertyGroup>