[英]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.