Skip to content

Add .props with ProjectCapability to suppress test project service GUID item #2592

Closed

Description

@jnm2

The decision was made that it's the responsibility of the test framework package to tell VS to stop autoinserting this boilerplate in test csprojs:

  <ItemGroup>
    <Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
  </ItemGroup>

See:
microsoft/vstest#394 (comment)
https://github.com/Microsoft/vstest/pull/440/files#r111104404

Any project that references NUnit and does not reference Microsoft.NET.Test.Sdk will benefit from this.

This is a super easy fix. We add the following \build\NUnit.props to the nupkg and we're done:

<Project>

  <ItemGroup>
    <ProjectCapability Include="TestContainer" />
  </ItemGroup>

</Project>

From my perspective it's much nicer to do this in the framework package than the adapter package. The only projects where I use the adapter package are where I need to use dotnet test, and one day, I'll be using our future .NET Core console runner. (dotnet nunit anyone? =D)

Let me know if you agree and I'll add the file for 3.10.

Activity

  1. added this to the 3.10 milestone on Dec 2, 2017
  2. rprouse commented on Dec 2, 2017

    @rprouse
    Member

    @jnm2 good catch. I walked out and saw the comments recommending that NUnit and xUnit add this to our packages. It would have been nice if they called us out by name 😄

  3. jnm2 commented on Dec 2, 2017

    @jnm2
    ContributorAuthor

    @rprouse I know...

  4. self-assigned this
    on Dec 2, 2017
  5. scott-parillo commented on Mar 13, 2018

    @scott-parillo

    As of an hour ago or so, our build just picked up the latest 3.10 package and we're now seeing this error...

    The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format.

    I just tested pulling in the package into an empty class library (VS2015 + Update 3) and see the same error. How is this working for you guys?

  6. jnm2 commented on Mar 13, 2018

    @jnm2
    ContributorAuthor

    @scott-parillo Sorry about that! We are in the process of releasing a hotfix. See #2753.

  7. mogikanin commented on Mar 22, 2018

    @mogikanin

    VS 15.6.3 still inserting this <Service Include=.. on nuget update, even with nunit 3.10.1.0.

  8. jnm2 commented on Mar 22, 2018

    @jnm2
    ContributorAuthor

    @mogikanin This is a new VS bug. See microsoft/vstest#472 (comment) to the end. It's fixed in 15.7 preview and they are asking for confirmation on that thread, so you could be the one.

  9. mogikanin commented on Mar 22, 2018

    @mogikanin

    Ah, ok. Again they broke everything 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions