Skip to content

Commit f4a12b4

Browse files
authored
Fix sample from ApartmentState to GetApartmentState() (#7341)
* Fix sample from `ApartmentState` to `GetApartmentState()` * Fix `ApartmentTest` sample, a csproj is required now
1 parent 580d2e1 commit f4a12b4

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net48</TargetFramework>
6+
<StartupObject>ApartmentTest</StartupObject>
7+
</PropertyGroup>
8+
9+
</Project>

samples/snippets/csharp/VS_Snippets_CLR_System/system.Threading.Thread.ApartmentState/CS/source.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ static void Main()
1111
newThread.SetApartmentState(ApartmentState.MTA);
1212

1313
Console.WriteLine("ThreadState: {0}, ApartmentState: {1}",
14-
newThread.ThreadState, newThread.ApartmentState);
14+
newThread.ThreadState, newThread.GetApartmentState());
1515

1616
newThread.Start();
1717

0 commit comments

Comments
 (0)