简体   繁体   English

Visual Studio 2017使用.net标准库时复制太多文件

[英]Visual Studio 2017 Copy too many files when using a .net standard library

I have two projects: 我有两个项目:

  1. TestStandardLib(based on .Net Standard 2.0, to use in .Net Framework, .Net Core, Xamarin...) TestStandardLib(基于.Net Standard 2.0,用于.Net Framework,.Net Core,Xamarin ...)
  2. TestMain(based on .Net Framework 4.6, just to test) TestMain(基于.Net Framework 4.6,仅供测试)

if I reference project TestStandardLib in TestMain, the compile result is 100+ files: 如果我在TestMain中引用项目TestStandardLib,则编译结果为100多个文件:

TestMain.exe TestMain.exe

TestStandardLib.dll TestStandardLib.dll

System.Runtime.*.dll System.Runtime。*。dll的

System.Threading.*.dll 的System.Threading。*。dll的

... ...

... ...

But I think I only need 2 files: 但我认为我只需要2个文件:

TestMain.exe and TestStandardLib.dll TestMain.exe和TestStandardLib.dll

because I think the .Net Framework 4.6 should have included .net standard relative dll. 因为我认为.Net Framework 4.6应该包含.net标准相对dll。 And I do test that if I delete the other 100+ files, remaining only TestMain.exe and TestStandardLib.dll, it works ok! 我会测试是否删除了其他100多个文件,仅剩下TestMain.exe和TestStandardLib.dll,那么一切正常!

How to solve this? 怎么解决这个?

Clear the output folder 清除输出文件夹

Then expand references node, select the assembly, check the properties window. 然后展开引用节点,选择装配,检查属性窗口。

Copy Local property should be False. 复制本地属性应为False。

复制本地假

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从Visual Studio 2017中的.NET Framework 4.5控制台应用程序引用.NET标准库? - How Do You Reference a .NET Standard Library from a .NET Framework 4.5 Console Application in Visual Studio 2017? Visual Studio 2017 不会在 .NET Standard 库中加载 .NET Framework 引用 - Visual Studio 2017 won't load .NET Framework references in .NET Standard library 如何在Visual Studio 2017中将PCL更改为.net平台标准库? - How can I change a PCL into a .net Platform Standard Library in Visual Studio 2017? Visual Studio .net 标准库模板使用指令中断? - Visual Studio .net standard library template breaks using directive? 在Visual Studio 2017中向类库添加引用时出错 - Error when adding reference to class library in visual studio 2017 Class 库(.NET 标准)模板在 Visual Studio 2019 中不起作用 - Class Library (.NET Standard) Template Not working in Visual Studio 2019 Visual Studio 2019 中的 .Net Standard 1.0 class 库 - .Net Standard 1.0 class library in Visual Studio 2019 无法在 Visual Studio 2017 中复制 file.exe - Unable to copy file .exe in Visual Studio 2017 复制到Visual Studio 2017中的输出目录 - Copy to Output Directory in Visual Studio 2017 在Visual Studio 2017中使用构建事件时的msi安装程序 - msi installer when using build events in Visual Studio 2017
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM