什么是"服务包括"在一个文件的csproj? [英] What is "Service Include" in a csproj file for?

查看:163
本文介绍了什么是"服务包括"在一个文件的csproj?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一个C#解决方案,我添加了一个现有的项目结果
之后,Visual Studio中添加了其他的.csproj文件中的以下条目:

In a C# solution, I added a existing project.
After that, Visual Studio has added the following entry in other .csproj files:

<ItemGroup>
    <Service Include="{B4F97281-0DBD-4835-9ED8-7DFB966E87FF}" />
</ItemGroup>



这是什么呢?结果
我可以删除吗?

What's this for?
Can I delete it?

推荐答案

我也有类似的情况下,这是在那里说:

I had a similar case, where this was added:

<ItemGroup>
  <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>

这包含原来把它作为标记测试项目,如本的从微软的回答

This inclusion turns out to be generated on purpose by VS2013 if you create an NUnit test project, but forget to tag it as test project, as described in this answer from Microsoft:

这行为是故意的。

要支持第三方测试框架,如NUnit的和的xUnit时,Visual Studio 2012测试加载资源管理器中的解决方案开放,无论它是否包含测试项目。这增加了延迟秒钟来启动和解决方案的开放方案为所有用户,其中大部分不使用测试。

To support third-party test frameworks, like NUnit and XUnit, Visual Studio 2012 loaded Test Explorer on solution open, regardless of whether it contained test projects. This added seconds of delay to startup and solution open scenarios for all users, majority of whom don't use tests.

在Visual Studio 2013中,我们改变了它,以便测试只有当溶液含有一种或多种测试项目的资源管理器包被加载。试验项目以两种不同的方式被识别。从内置的单元测试项目模板之一创建的项目使用项目类型的GUID标识。其他类型的项目,如用的xUnit或NUnit的测试类库项目,通过测试资源管理器的第一个测试发现过程中识别和标记与<服务/> 项目。

In Visual Studio 2013, we changed it so that Test Explorer package is loaded only when the solution contains one or more test projects. Test projects are identified in two different ways. Projects created from one of the built-in unit test project templates are identified using project type GUIDs. Other types of projects, such as Class Library project with XUnit or NUnit tests, are identified by Test Explorer during first test discovery and "tagged" with the <Service/> item.

这篇关于什么是&QUOT;服务包括&QUOT;在一个文件的csproj?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆