Skip to content

Commit d7126c2

Browse files
Move workaround to properties file
Move CA2252 workaround to the props file instead of the code.
1 parent 80897d7 commit d7126c2

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

Directory.Build.props

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@
2222
<ItemGroup>
2323
<Compile Include="$(MSBuildThisFileDirectory)GlobalUsings.cs" />
2424
</ItemGroup>
25-
<!-- HACK Various work arounds until Visual Studio works with latest language features -->
25+
<!-- HACK Various workarounds that affect the CLI and the IDE -->
26+
<PropertyGroup>
27+
<!-- HACK Workaround warning in xunit collections -->
28+
<NoWarn>$(NoWarn);CA2252</NoWarn>
29+
</PropertyGroup>
30+
<!-- HACK Various workarounds until Visual Studio works with latest language features -->
2631
<PropertyGroup Condition="'$(BuildingInsideVisualStudio)' == 'true'">
2732
<LangVersion>preview</LangVersion>
2833
<!-- HACK Workaround for https://github.com/dotnet/roslyn/issues/54255 -->

tests/TodoApp.Tests/HttpServerCollection.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33

44
namespace TodoApp
55
{
6-
#pragma warning disable CA2252 // HACK Appears to be a bug - investigate in a later preview build
76
[CollectionDefinition(Name)]
87
public sealed class HttpServerCollection : ICollectionFixture<HttpServerFixture>
98
{
109
public const string Name = "TodoApp HTTP server collection";
1110
}
12-
#pragma warning restore CA2252
1311
}

tests/TodoApp.Tests/TodoAppCollection.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33

44
namespace TodoApp
55
{
6-
#pragma warning disable CA2252 // HACK Appears to be a bug - investigate in a later preview build
76
[CollectionDefinition(Name)]
87
public sealed class TodoAppCollection : ICollectionFixture<TodoAppFixture>
98
{
109
public const string Name = "TodoApp server collection";
1110
}
12-
#pragma warning restore CA2252
1311
}

0 commit comments

Comments
 (0)