简体   繁体   中英

How to correctly remove NUnit3TestAdapter from csproj project file

I changed the unit testing of a C# test project from NUnit to xUnit. I already removed the NUnit nuget package. But when I look into the csproj file there still the NUnit3TestAdapter is there:

<Import Project="..\..\..\..\packages\NUnit3TestAdapter.3.10.0\build\net35\NUnit3TestAdapter.props" Condition="Exists('..\..\..\..\packages\NUnit3TestAdapter.3.10.0\build\net35\NUnit3TestAdapter.props')" />
...
<Error Condition="!Exists('..\..\..\..\packages\NUnit3TestAdapter.3.10.0\build\net35\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\NUnit3TestAdapter.3.10.0\build\net35\NUnit3TestAdapter.props'))" />

I dont see this in the nuget package manager.

So my question: How to remove this correctly? Should I edit the file manually or is there a way to remove it with VS2017?

Edit: I removed these two lines manually from csproj file. It seems fine.

You can manually edit your .csproj file and remove unused references. Just be sure to save an old copy in case you accidentally corrupt the XML.

You might also want to check your packages folder and make sure the package folder is removed, in addition to checking packages.config file and making sure the reference is removed there too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM