I have added NCrunch to my .Net Core solution and now this file was added to all projects:
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?
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. I hope though that a better solution exists.
Maybe it's possible to tell ncrunch to store files some other place perhaps?
The .NET Core CPS project system used by VS will implicitly include any file in the project directory. It isn't safe for NCrunch to mess with this logic.
You can, however, configure NCrunch to place its config files in a different place using the project config file storage path configuration setting.
Thanks for the answer, I agree it's not smart to mess with .net core logic, but if it's possible to move files it's good enough.
The solution worked just fine, though there is still solution level ncrunch files, but they are not a problem since they can just be gitignored and are not included in projects.
Since that seems like something that everyone will want to have for every .net core solution, maybe it makes sense to have it by default with e.g. "_NCrunch_ProjectFiles" or something like that alongside "_NCrunch_SolutionName"? It's not too complicated to do it for every solution, but is there any drawback by having NCrunch do it by default?
This might work, I can try this later, Remco solution works for me now :) So ideally if it were by default then we would not need to do anything at all.
The problem with doing this by default is that we've had people using the product for 8 years (most of them prior to .NET Core), and storing config files adjacent to project files is the way it's always been. So to suddenly change this by default for .NET Core projects would jarringly impact many people that are used to working this way.
Other tools (VS, Resharper, etc) follow the convention of placing config files adjacent to project files.
There are advantages to storing the files adjacent. If you have a project that is shared across multiple solutions, it's reasonable to expect its configuration would be shared too.
on the project level before. Because that did not work within the Directory.Build.props file. But the DefaultItemExcludes is the better place, also for *.DotSettings.
Maybe then there can be a configuration option on top level for that? Now it's possible to do per solution, what if we can do that for all solutions maybe to not make it default option? I think more and more people switching to .net core will not find it seamless and would need to do that again and again, so that can be a nice workaround option?
IlyaC wrote:Maybe then there can be a configuration option on top level for that? Now it's possible to do per solution, what if we can do that for all solutions maybe to not make it default option? I think more and more people switching to .net core will not find it seamless and would need to do that again and again, so that can be a nice workaround option?
Sorry we have no plans to implement global config setting for this. Currently the solution setting is implemented using a relative path (for VCS support), so a global setting would require a whole parallel implementation and likely a new setting. We have too many configuration settings already. If you're unhappy about seeing a .ncrunchproject implicitly included in your solution file listing, there are a range of options available to allow you to remove it.
IlyaC wrote:Maybe then there can be a configuration option on top level for that? Now it's possible to do per solution, what if we can do that for all solutions maybe to not make it default option? I think more and more people switching to .net core will not find it seamless and would need to do that again and again, so that can be a nice workaround option?
The Solution of @GreenMoose is a per Solution solution. Works for all Projects in the hierarchy under the Directory.build.props file.