简体   繁体   English

如何从.Net Core项目/解决方案中删除.ncrunchproject文件(或任何其他类似的文件)

[英]How to remove .ncrunchproject files (or any other files that are similar) from .Net Core project/solution

I have added NCrunch to my .Net Core solution and now this file was added to all projects: 我已将NCrunch添加到我的.Net Core解决方案中,现在此文件已添加到所有项目中:

ProjectName.v3.ncrunchproject

I have added this to gitignore so it's not going to source control, but how can I remove it from Project? 我已将其添加到gitignore中,因此它不会源代码控制,但是如何将其从Project中删除呢?

There is an option of excluding this file explicitly in each and every project by either clicking Exclude in menu or adding it manually in .csproj file. 通过单击菜单中的“排除”或将其手动添加到.csproj文件中,可以选择在每个项目中明确排除此文件。 I hope though that a better solution exists. 我希望有更好的解决方案。

One way of solving this is to modify DefaultItemExcludes in sdk project props. 解决此问题的一种方法是在sdk项目道具中修改DefaultItemExcludes For example go to: 例如,转到:

C:\\Program Files\\dotnet\\sdk\\<version>\\Sdks\\Microsoft.NET.Sdk.Web.ProjectSystem\\build\\netstandard1.0

and modify Microsoft.NET.Sdk.Web.ProjectSystem.props . 并修改Microsoft.NET.Sdk.Web.ProjectSystem.props

Find something like: 找到类似的东西:

<DefaultItemExcludes>$(DefaultItemExcludes);**\node_modules\**;node_modules\**</DefaultItemExcludes>

and change it to: 并将其更改为:

<DefaultItemExcludes>$(DefaultItemExcludes);**\node_modules\**;node_modules\**;**\*.ncrunchproject</DefaultItemExcludes>

After Visual Studio restart it should be automatically excluded from your project. Visual Studio重新启动后,应自动将其从项目中排除。 This is not a perfect solution, because you will have to do it for every project type and sdk you have. 这不是一个完美的解决方案,因为您将必须针对每种项目类型和SDK执行此操作。

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

相关问题 如何从 .net 核心 web Z8A5DA52ED12644721AAZ 项目中删除虚拟添加的 angular 文件 - How to remove the virtually added angular files from the .net core web api project 将内容和编译文件从 nuget 复制到 .net 核心项目中 - Copy Content and Compile files into .net core project from nuget 如何从Visual Studio中的项目解决方案中删除其他构建文件 - How to Delete Additional build files from the Project Solution in visual studio 如何使用 C# 从包含大量其他文件或文件夹的文件夹中正确删除 .Net Core 中的文件 - How to properly delete a file in .Net Core with C# from a folder with large amount of other files or folders 从解决方案中的所有文件中删除注释 - Remove Comments from All Files in a solution Visual Studio 中 .net 核心项目的锁定文件 - locked files of .net core project in Visual Studio 读取解决方案数据文件 ASP.Net Core - Read solution data files ASP.Net Core Docker / C# / ASP.NET 核心-解决方案中如何替换需要读取特定输入文件 - Docker / C# / ASP.NET Core - how to replace the need to read specific input files in the solution 从另一个项目访问文件与ASP.NET MVC相同的解决方案 - Access files from another project same solution asp.net mvc .net核心解决方案 - 项目结构 - .net Core Solution - Project stucture
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM