Skip to content

Fix test failing on Windows#1782

Closed
mattjohnsonpint wants to merge 1 commit into
mainfrom
fix-projectpath
Closed

Fix test failing on Windows#1782
mattjohnsonpint wants to merge 1 commit into
mainfrom
fix-projectpath

Conversation

@mattjohnsonpint

Copy link
Copy Markdown
Contributor

For some unknown reason, my local Windows machine was giving project paths with c:\ instead of C:\, which was causing FileNameShouldBeRelative to fail. I'm still hunting down why, but this will prevent it.

Related to #1739

#skip-changelog

@mattjohnsonpint

Copy link
Copy Markdown
Contributor Author

The test only failed on net6.0, so I thought it might be because I had 6.0.302 locally, while CI is still on 6.0.301.

So I uninstalled 6.0.302 and installed 6.0.301 (since they no longer let you install them both side-by-side). The test passed.

But then I re-installed 6.0.302, and I expected the test to fail, but it still passed - even with a full git clean and rebuild.

So either I had a bad install, or it reset something else? Not sure. Anyway, I still think we should merge this.

@SimonCropp

Copy link
Copy Markdown
Contributor

IMO it would be easier to do a case insensitive startswith later in the processing

@mattjohnsonpint

Copy link
Copy Markdown
Contributor Author

It's used here (on line 190)

AttributeReader.TryGetProjectDirectory(method.Module.Assembly, out projectPath);
}
frame.ConfigureAppFrame(_options);
var frameFileName = stackFrame.GetFileName();
if (projectPath != null && frameFileName != null)
{
frameFileName = frameFileName.Replace(projectPath, "");
}
frame.FileName = frameFileName;

Unfortunately, string.Replace doesn't have an overload with comparer parameter in netstandard2.0 or net461. We would need a shim.

@mattjohnsonpint

Copy link
Copy Markdown
Contributor Author

Either way is fine with me, if you want to take another go at it, @SimonCropp ?

@mattjohnsonpint

Copy link
Copy Markdown
Contributor Author

Close in favor of #1791

@mattjohnsonpint mattjohnsonpint deleted the fix-projectpath branch November 14, 2022 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants