-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot use Assert.Equals due to unmanaged constraint in Visual Basic #75063
Labels
Milestone
Comments
jaredpar
added a commit
to jaredpar/roslyn
that referenced
this issue
Sep 12, 2024
One of our NuGet audit alerts was rooted in our xUnit packages as they only had `netstandard1.3` libraries. To resolve this alert I moved us to newer versions of the package which had `netstandard2.0` libraries. Upgrading the package revealed two problems in our code base: 1. The xUnit `Assert` APIs took advantage of the `unmanaged` constraint in a fwe places. That is not supported by Visual Basic and leads to errors on import. To work around this I inserted `AssertEx` thunks that our Visual Basic layer can call through. Longer term we will need to consider adding support for the constraint ([issue](dotnet#75063)) 2. The xUnit APIs significantly increased their nullable reference type annotations. This caught a number of places where the tests were passing potentially null values to APIs that don't accept null. There were enough hits that I added `AssertEx` methods that handle the nullable case. In a few places though I just suppressed the warning. The vulnerability: GHSA-cmhx-cq75-c4mj
Merged
jaredpar
added a commit
to jaredpar/roslyn
that referenced
this issue
Sep 25, 2024
One of our NuGet audit alerts was rooted in our xUnit packages as they only had `netstandard1.3` libraries. To resolve this alert I moved us to newer versions of the package which had `netstandard2.0` libraries. Upgrading the package revealed two problems in our code base: 1. The xUnit `Assert` APIs took advantage of the `unmanaged` constraint in a fwe places. That is not supported by Visual Basic and leads to errors on import. To work around this I inserted `AssertEx` thunks that our Visual Basic layer can call through. Longer term we will need to consider adding support for the constraint ([issue](dotnet#75063)) 2. The xUnit APIs significantly increased their nullable reference type annotations. This caught a number of places where the tests were passing potentially null values to APIs that don't accept null. There were enough hits that I added `AssertEx` methods that handle the nullable case. In a few places though I just suppressed the warning. The vulnerability: GHSA-cmhx-cq75-c4mj
jaredpar
added a commit
that referenced
this issue
Sep 26, 2024
* Upgrade xUnit One of our NuGet audit alerts was rooted in our xUnit packages as they only had `netstandard1.3` libraries. To resolve this alert I moved us to newer versions of the package which had `netstandard2.0` libraries. Upgrading the package revealed two problems in our code base: 1. The xUnit `Assert` APIs took advantage of the `unmanaged` constraint in a fwe places. That is not supported by Visual Basic and leads to errors on import. To work around this I inserted `AssertEx` thunks that our Visual Basic layer can call through. Longer term we will need to consider adding support for the constraint ([issue](#75063)) 2. The xUnit APIs significantly increased their nullable reference type annotations. This caught a number of places where the tests were passing potentially null values to APIs that don't accept null. There were enough hits that I added `AssertEx` methods that handle the nullable case. In a few places though I just suppressed the warning. The vulnerability: GHSA-cmhx-cq75-c4mj
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Consider the following code:
This is failing when upgrading to the latest xUnit. This is due to the addition of the unmanaged constraint in the core
Assert.Equals
API. That is not supported by VB and leads to the overload triggeringShort term going to work around this with some helper methods but need to consider how to address this longer term.
The text was updated successfully, but these errors were encountered: