Skip to content

Commit e85b290

Browse files
committed
Silence CAS warning in .NET core SMC code
1 parent aa2772f commit e85b290

File tree

15 files changed

+54
-12
lines changed

15 files changed

+54
-12
lines changed

aspnettest.sln

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ Project("{00D1A9C2-B5F0-4AF3-8072-F6C62B433612}") = "asp.db", "src\asp.db\asp.db
152152
EndProject
153153
Project("{00D1A9C2-B5F0-4AF3-8072-F6C62B433612}") = "apiservice.db", "src\apiservice.db\apiservice.db.sqlproj", "{A697994D-0365-466A-B9BA-4A8A5F0596D8}"
154154
EndProject
155+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "calculator.blazor", "src\asp.blazor\CalculatorSmc\calculator.blazor.vcxproj", "{BAC05072-44C6-4C3E-A938-F987E16324CF}"
156+
EndProject
155157
Global
156158
GlobalSection(SolutionConfigurationPlatforms) = preSolution
157159
Debug|Any CPU = Debug|Any CPU
@@ -1632,6 +1634,30 @@ Global
16321634
{A697994D-0365-466A-B9BA-4A8A5F0596D8}.ReleaseNoTrace|x86.ActiveCfg = Release|Any CPU
16331635
{A697994D-0365-466A-B9BA-4A8A5F0596D8}.ReleaseNoTrace|x86.Build.0 = Release|Any CPU
16341636
{A697994D-0365-466A-B9BA-4A8A5F0596D8}.ReleaseNoTrace|x86.Deploy.0 = Release|Any CPU
1637+
{BAC05072-44C6-4C3E-A938-F987E16324CF}.Debug|Any CPU.ActiveCfg = Debug|x64
1638+
{BAC05072-44C6-4C3E-A938-F987E16324CF}.Debug|Any CPU.Build.0 = Debug|x64
1639+
{BAC05072-44C6-4C3E-A938-F987E16324CF}.Debug|x64.ActiveCfg = Debug|x64
1640+
{BAC05072-44C6-4C3E-A938-F987E16324CF}.Debug|x64.Build.0 = Debug|x64
1641+
{BAC05072-44C6-4C3E-A938-F987E16324CF}.Debug|x86.ActiveCfg = Debug|Win32
1642+
{BAC05072-44C6-4C3E-A938-F987E16324CF}.Debug|x86.Build.0 = Debug|Win32
1643+
{BAC05072-44C6-4C3E-A938-F987E16324CF}.DebugNoTrace|Any CPU.ActiveCfg = Debug|x64
1644+
{BAC05072-44C6-4C3E-A938-F987E16324CF}.DebugNoTrace|Any CPU.Build.0 = Debug|x64
1645+
{BAC05072-44C6-4C3E-A938-F987E16324CF}.DebugNoTrace|x64.ActiveCfg = Debug|x64
1646+
{BAC05072-44C6-4C3E-A938-F987E16324CF}.DebugNoTrace|x64.Build.0 = Debug|x64
1647+
{BAC05072-44C6-4C3E-A938-F987E16324CF}.DebugNoTrace|x86.ActiveCfg = Debug|Win32
1648+
{BAC05072-44C6-4C3E-A938-F987E16324CF}.DebugNoTrace|x86.Build.0 = Debug|Win32
1649+
{BAC05072-44C6-4C3E-A938-F987E16324CF}.Release|Any CPU.ActiveCfg = Release|x64
1650+
{BAC05072-44C6-4C3E-A938-F987E16324CF}.Release|Any CPU.Build.0 = Release|x64
1651+
{BAC05072-44C6-4C3E-A938-F987E16324CF}.Release|x64.ActiveCfg = Release|x64
1652+
{BAC05072-44C6-4C3E-A938-F987E16324CF}.Release|x64.Build.0 = Release|x64
1653+
{BAC05072-44C6-4C3E-A938-F987E16324CF}.Release|x86.ActiveCfg = Release|Win32
1654+
{BAC05072-44C6-4C3E-A938-F987E16324CF}.Release|x86.Build.0 = Release|Win32
1655+
{BAC05072-44C6-4C3E-A938-F987E16324CF}.ReleaseNoTrace|Any CPU.ActiveCfg = Release|x64
1656+
{BAC05072-44C6-4C3E-A938-F987E16324CF}.ReleaseNoTrace|Any CPU.Build.0 = Release|x64
1657+
{BAC05072-44C6-4C3E-A938-F987E16324CF}.ReleaseNoTrace|x64.ActiveCfg = Release|x64
1658+
{BAC05072-44C6-4C3E-A938-F987E16324CF}.ReleaseNoTrace|x64.Build.0 = Release|x64
1659+
{BAC05072-44C6-4C3E-A938-F987E16324CF}.ReleaseNoTrace|x86.ActiveCfg = Release|Win32
1660+
{BAC05072-44C6-4C3E-A938-F987E16324CF}.ReleaseNoTrace|x86.Build.0 = Release|Win32
16351661
EndGlobalSection
16361662
GlobalSection(SolutionProperties) = preSolution
16371663
HideSolutionNode = FALSE

src/apiservice.core/Controllers/Accesscode_sm.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#pragma warning disable SYSLIB0003
12
/* <auto-generated>
23
* ex: set ro:
34
* DO NOT EDIT.

src/apiservice.core/Controllers/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ Accesscode_sm.cs: Accesscode.sm
77

88
Accesscode_sm.dot: Accesscode.sm
99
java -jar ..\..\smc\Smc.jar -graph -glevel 1 Accesscode.sm
10-
rem Replace the first comment line to silence nullable warnings:
11-
powershell -Command "@('/* <auto-generated>') + ((Get-Content Accesscode_sm.cs) | Select-Object -Skip 1) | Set-Content -Path Accesscode_sm.cs"
10+
REM Replace the first comment line to silence Code Access Security and nullable warnings:
11+
SET CS=Accesscode_sm.cs
12+
powershell -Command "@('#pragma warning disable SYSLIB0003', '/* <auto-generated>') + ((Get-Content '%CS%') | Select-Object -Skip 1) | Set-Content -Path '%CS%'"
1213

1314
Accesscode_sm.png: Accesscode_sm.dot
1415
dot -T png -o Accesscode_sm.png Accesscode_sm.dot

src/asp.blazor/CalculatorSmc/Calculator_sm.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/*
1+
#pragma warning disable SYSLIB0003
2+
/* <auto-generated>
23
* ex: set ro:
34
* DO NOT EDIT.
45
* generated by smc (http://smc.sourceforge.net/)

src/asp.blazor/CalculatorSmc/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ Calculator_sm.cs: Calculator.sm
77

88
Calculator_sm.dot: Calculator.sm
99
java -jar ..\..\smc\Smc.jar -graph -glevel 1 Calculator.sm
10+
REM Replace the first comment line to silence Code Access Security and nullable warnings:
11+
SET CS=Calculator_sm.cs
12+
powershell -Command "@('#pragma warning disable SYSLIB0003', '/* <auto-generated>') + ((Get-Content '%CS%') | Select-Object -Skip 1) | Set-Content -Path '%CS%'"
1013

1114
Calculator_sm.png: Calculator_sm.dot
1215
dot -T png -o Calculator_sm.png Calculator_sm.dot

src/asp.blazor/CalculatorSmc/calculator.blazor.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</ItemGroup>
2121
<PropertyGroup Label="Globals">
2222
<VCProjectVersion>15.0</VCProjectVersion>
23-
<ProjectGuid>{69EB69AB-0D24-4974-8D7D-2D2CDB62DCFA}</ProjectGuid>
23+
<ProjectGuid>{BAC05072-44C6-4C3E-A938-F987E16324CF}</ProjectGuid>
2424
<Keyword>Win32Proj</Keyword>
2525
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
2626
</PropertyGroup>

src/asp.core/Controllers/Calculator_sm.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/*
1+
#pragma warning disable SYSLIB0003
2+
/* <auto-generated>
23
* ex: set ro:
34
* DO NOT EDIT.
45
* generated by smc (http://smc.sourceforge.net/)

src/asp.core/Controllers/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ Calculator_sm.cs: Calculator.sm
77

88
Calculator_sm.dot: Calculator.sm
99
java -jar ..\..\smc\Smc.jar -graph -glevel 1 Calculator.sm
10+
REM Replace the first comment line to silence Code Access Security and nullable warnings:
11+
SET CS=Calculator_sm.cs
12+
powershell -Command "@('#pragma warning disable SYSLIB0003', '/* <auto-generated>') + ((Get-Content '%CS%') | Select-Object -Skip 1) | Set-Content -Path '%CS%'"
1013

1114
Calculator_sm.png: Calculator_sm.dot
1215
dot -T png -o Calculator_sm.png Calculator_sm.dot

src/asp.websharper.spa.Model/smc/Calculator_sm.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/*
1+
#pragma warning disable SYSLIB0003
2+
/* <auto-generated>
23
* ex: set ro:
34
* DO NOT EDIT.
45
* generated by smc (http://smc.sourceforge.net/)

src/asp.websharper.spa.Model/smc/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ Calculator_sm.cs: Calculator.sm
77

88
Calculator_sm.dot: Calculator.sm
99
java -jar ..\..\smc\Smc.jar -graph -glevel 1 Calculator.sm
10+
REM Replace the first comment line to silence Code Access Security and nullable warnings:
11+
SET CS=Calculator_sm.cs
12+
powershell -Command "@('#pragma warning disable SYSLIB0003', '/* <auto-generated>') + ((Get-Content '%CS%') | Select-Object -Skip 1) | Set-Content -Path '%CS%'"
1013

1114
Calculator_sm.png: Calculator_sm.dot
1215
dot -T png -o Calculator_sm.png Calculator_sm.dot

src/asptest.webforms/ExceptionDumpTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public void ThrowDumpTest()
4343
#pragma warning disable CS0618 // IIE obsolete
4444
var linkToDump = this.GetHTMLElement(IEExtension.EXCEPTION_LINK_ID);
4545
#pragma warning restore CS0618 // IIE obsolete
46-
Assert.That(linkToDump.getAttribute("href"), Does.Contain("/default.aspx?session="));
46+
Assert.That(linkToDump.GetAttribute("href"), Does.Contain("/default.aspx?session="));
4747
#pragma warning disable CS0618 // IIE obsolete
4848
this.ClickID(IEExtension.EXCEPTION_LINK_ID);
4949
#pragma warning restore CS0618 // IIE obsolete

src/iselenium.blazor/TestRunnerSmc/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ TestRunnerFsm_sm.cs: TestRunnerFsm.sm
77

88
TestRunnerFsm_sm.dot: TestRunnerFsm.sm
99
java -jar ..\..\smc\Smc.jar -graph -glevel 1 TestRunnerFsm.sm
10-
rem Replace the first comment line to silence nullable warnings:
11-
powershell -Command "@('/* <auto-generated>') + ((Get-Content TestRunnerFsm_sm.cs) | Select-Object -Skip 1) | Set-Content -Path TestRunnerFsm_sm.cs"
10+
REM Replace the first comment line to silence Code Access Security and nullable warnings:
11+
SET CS=TestRunnerFsm_sm.cs
12+
powershell -Command "@('#pragma warning disable SYSLIB0003', '/* <auto-generated>') + ((Get-Content '%CS%') | Select-Object -Skip 1) | Set-Content -Path '%CS%'"
1213

1314
TestRunnerFsm_sm.png: TestRunnerFsm_sm.dot
1415
dot -T png -o TestRunnerFsm_sm.png TestRunnerFsm_sm.dot

src/iselenium.blazor/TestRunnerSmc/TestRunnerFsm_sm.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#pragma warning disable SYSLIB0003
12
/* <auto-generated>
23
* ex: set ro:
34
* DO NOT EDIT.

src/minimal.blazor/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using asplib.Model.Db;
22
using asplib.Services;
33
using iselenium;
4-
using minimal.blazor.Models;
4+
using ModelMain = minimal.blazor.Models.Main;
55

66
var builder = WebApplication.CreateBuilder(args);
77

@@ -11,7 +11,7 @@
1111
builder.Services.AddSingleton<IConfiguration>(builder.Configuration);
1212
ASP_DBEntities.ConnectionString = builder.Configuration["ASP_DBEntities"]; // legacy .NET Framework pattern static reference
1313
builder.Services.AddPersistent<TestRunnerFsm>(); // TestButton SMC FSM
14-
builder.Services.AddPersistent<Main>(); // asplib
14+
builder.Services.AddPersistent<ModelMain>(); // asplib
1515

1616
var app = builder.Build();
1717

src/minimaltest.webforms/ExceptionDumpTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public void ThrowRetrieveDumpTest()
3030
#pragma warning disable CS0618 // IIE obsolete
3131
var linkToDump = this.GetHTMLElement(IEExtension.EXCEPTION_LINK_ID);
3232
#pragma warning restore CS0618 // IIE obsolete
33-
var coredumpUrl = (string)linkToDump.getAttribute("href");
33+
var coredumpUrl = (string)linkToDump.GetAttribute("href");
3434
Assert.That(coredumpUrl, Does.Contain("/withstorage.aspx?session="));
3535
#pragma warning disable CS0618 // IIE obsolete
3636
this.ClickID(IEExtension.EXCEPTION_LINK_ID);

0 commit comments

Comments
 (0)