Skip to content

Commit b182beb

Browse files
committed
Commit for release v02.5.3: issues #2-4 resolved.
1 parent 920c57a commit b182beb

14 files changed

+735
-15
lines changed

CafeBabeGame/CafeBabeGame/CafeBabeGame.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</PropertyGroup>
1414

1515
<ItemGroup>
16-
<PackageReference Include="DotNetVault" Version="0.2.5.1" />
16+
<PackageReference Include="DotNetVault" Version="0.2.5.3" />
1717
<PackageReference Include="HighPrecisionTimeStamps" Version="0.0.1-alpha" />
1818
</ItemGroup>
1919

Clorton Game/ClortonGameDemo/ClortonGameDemo.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</PropertyGroup>
1414

1515
<ItemGroup>
16-
<PackageReference Include="DotNetVault" Version="0.2.5.1" />
16+
<PackageReference Include="DotNetVault" Version="0.2.5.3" />
1717
<PackageReference Include="HighPrecisionTimeStamps" Version="0.0.1-alpha" />
1818
</ItemGroup>
1919

ConsoleStressTest/ConsoleStressTest.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</PropertyGroup>
1818

1919
<ItemGroup>
20-
<PackageReference Include="DotNetVault" Version="0.2.5.1" />
20+
<PackageReference Include="DotNetVault" Version="0.2.5.3" />
2121
</ItemGroup>
2222

2323
</Project>

DotNetVaultQuickStart/DotNetVaultQuickStart.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
</ItemGroup>
2929

3030
<ItemGroup>
31-
<PackageReference Include="DotNetVault" Version="0.2.5.1" />
31+
<PackageReference Include="DotNetVault" Version="0.2.5.3" />
3232
<PackageReference Include="HighPrecisionTimeStamps" Version="0.0.1-alpha" />
3333
</ItemGroup>
3434

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# DotNetVault Quick Start Installation Guide Visual Studio 2019 (Windows 10)
2+
3+
1. Open Visual Studio and Create a new .NET Core 3.1+ or .NET Framework 4.8 Console Application.
4+
2. **If you chose .NET Framework 4.8**, open the .csproj file and add the following Line `<LangVersion>8.0</LangVersion>` under each “Platform/Config” PropertyGroup as shown in highlight below. This is unnecessary if you chose a .NET Core 3.1+ based Console Application.
5+
6+
![](https://github.com/cpsusie/DotNetVault/blob/v0.2.5.x/DotNetVaultQuickStart/dotnet_vault_install_vs2019_win/pic_1.png?raw=true)
7+
8+
3. Right click on your project and chose “Manage NuGet packages”. Click on the Browse option, enter “dotnetvault” into the search block, select DotNetVault, then click “Install”.
9+
10+
![](https://github.com/cpsusie/DotNetVault/blob/v0.2.5.x/DotNetVaultQuickStart/dotnet_vault_install_vs2019_win/pic_2.png?raw=true)
11+
12+
4. You are now set up to use DotNetVault in your project.
13+
14+
5. Test Program Entry
15+
* To ensure that the static analyzer installed correctly, delete the “Hello World” program entered in by default and replace it with the following code:
16+
17+
```csharp
18+
using System;
19+
using System.Threading;
20+
using DotNetVault.Vaults;
21+
22+
namespace DotNetVaultQuickStart
23+
{
24+
class Program
25+
{
26+
static void Main(string[] args)
27+
{
28+
var strVault = new BasicVault<string>(string.Empty);
29+
30+
Thread t1 = new Thread(() =>
31+
{
32+
Thread.SpinWait(50000);
33+
var lck = strVault.SpinLock();
34+
lck.Value += "Hello from thread 1, DotNetVault! ";
35+
});
36+
Thread t2 = new Thread(() =>
37+
{
38+
using var lck = strVault.SpinLock();
39+
lck.Value += "Hello from thread 2, DotNetVault! ";
40+
});
41+
42+
t1.Start();
43+
t2.Start();
44+
t2.Join();
45+
t1.Join();
46+
47+
string finalResult = strVault.CopyCurrentValue(TimeSpan.FromMilliseconds(100));
48+
Console.WriteLine(finalResult);
49+
}
50+
}
51+
}
52+
```
53+
54+
* Change the Configuration to **Release** and Build the project:
55+
56+
![](https://github.com/cpsusie/DotNetVault/blob/v0.2.5.x/DotNetVaultQuickStart/dotnet_vault_install_vs2019_win/pic_3.png?raw=true)
57+
58+
* *If you have installed everything correctly, the build should* **fail**. If it builds, consult Visual Studio documentation for how to enable Roslyn Analyzers. Do not attempt to use this library without static analysis enabled. Assuming it does not build, you should see the following as a result of your build attempt:
59+
60+
![](https://github.com/cpsusie/DotNetVault/blob/v0.2.5.x/DotNetVaultQuickStart/dotnet_vault_install_vs2019_win/pic_4.png?raw=true)
61+
62+
* The error is that you must **guard** the return value from a *Lock()* or *SpinLock()* method (or any other method whose return value you choose to annotate with the *UsingMandatory* attribute) with a using statement or declaration. Failure to ensure that the lock is promptly released would cause a serious error in your programit would timeout whenever in the future you attempted to obtain the lock.
63+
* To fix the error, on line 16, changevar lck =…” tousing var lck =…” as shown then Build again. This time, the build should succeed as shown:
64+
65+
![](https://github.com/cpsusie/DotNetVault/blob/v0.2.5.x/DotNetVaultQuickStart/dotnet_vault_install_vs2019_win/pic_5.png?raw=true)
66+
67+
* Now you should be able to run the application as shown:
68+
69+
![](https://github.com/cpsusie/DotNetVault/blob/v0.2.5.x/DotNetVaultQuickStart/dotnet_vault_install_vs2019_win/pic_6.png?raw=true)
70+
71+
6. Congratulations, you have successfully built an application using DotNetVault. Next, we will look at a QuickStart application that shows the very basics of what can be done with this library and its integrated static analyzer. Move on to the [functionality tour](https://github.com/cpsusie/DotNetVault/blob/v0.2.5.x/DotNetVaultQuickStart/DotNetVault%20Quick%20Start%20Functionality%20Tour%20%E2%80%93%20JetBrains%20Rider%20(Amazon%20Linux).md) next.
72+

0 commit comments

Comments
 (0)