question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AddTestAttachment does not work anymore in VS2022

See original GitHub issue

Description

If the following code is executed:

using NUnit.Framework;

namespace NUnitTest
{
    public class Tests
    {
        [Test]
        public void TestNunitAttachment()
        {
            TestContext.AddTestAttachment(@"C:\Windows\WindowsUpdate.log");
        }
    }
}

The attached file is not clickable (it works with MSTest). I assume the file-scheme is causing the issue.

See the following image: grafik

Versions

NUnit: 3.13.2 NUnit-Test-Adapter: 4.1.0 .net platform: 5 / 6 Visual Studio edition: VS2022 Enterprise Version 17.1.0 Preview 1.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
vpenadescommented, Dec 13, 2021

@OsirisTerje I was able to test the beta1 both within VS2022 test explorer and within TeamCity tests system, and both are able to display the test attachments correctly.

I still believe that Visual Studio should be more forgiving regarding paths, since a “file:///c:xxx” should be valid, but that falls into MS side.

2reactions
bernd5commented, Dec 12, 2021

For me the new beta works perfectly 👍. Thank you very much.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Adapter V4 Release Notes
914 AddTestAttachment does not work anymore in VS2022; 918 New DiscoveryMode doesn't play nicely with TestFixtureSource - Missing GenericFixture; 919 VSTest ...
Read more >
nunit - TestContext.AddTestAttachment(string path) is not ...
I am trying to run nunit tests in azure test plan by triggering Release build pipelines. I have observed file attachments with greater...
Read more >
How to fix Visual Studio 2022 17.5 Intellisense not working
This is a general problem that started with 17.5: intellisense, renaming, underlining all failing; GoToDeclaration etc all much slower.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found