Skip to content

Commit 3140f15

Browse files
authored
Remove CAS attributes from snippets (#1370)
* remove CAS attributes * fix failing projects * add C# and VB project files * add snippets 5000 files * try fix projects * feedback from andy * respond to feedback * add solution file
1 parent 9de7cc6 commit 3140f15

File tree

126 files changed

+838
-321
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+838
-321
lines changed

dotnet-desktop-guide/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.KeyboardInputForm/cpp/form1.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ namespace KeyboardInputForm
4444
// <Snippet5>
4545
// Detect all numeric characters at the
4646
// application level and consume 0.
47-
[SecurityPermission(SecurityAction::LinkDemand,
48-
Flags=SecurityPermissionFlag::UnmanagedCode)]
4947
virtual bool PreFilterMessage(Message% m)
5048
{
5149
// Detect key down messages.

dotnet-desktop-guide/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ public ref class Form1: public System::Windows::Forms::Form
5151
/// Required method for Designer support - do not modify
5252
/// the contents of this method with the code editor.
5353
/// </summary>
54-
[SecurityPermission(SecurityAction::Demand, Flags=SecurityPermissionFlag::UnmanagedCode)]
5554
void InitializeComponent()
5655
{
5756
this->MainMenu1 = gcnew System::Windows::Forms::MainMenu;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>

dotnet-desktop-guide/samples/snippets/cpp/VS_Snippets_Wpf/System.Windows.Interop.D3DImage/cpp/d3dhost.csproj

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1+
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
22
<PropertyGroup>
33
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
44
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -9,11 +9,12 @@
99
<AppDesignerFolder>Properties</AppDesignerFolder>
1010
<RootNamespace>D3DHost</RootNamespace>
1111
<AssemblyName>D3DHost</AssemblyName>
12-
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
12+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
1414
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
1515
<WarningLevel>4</WarningLevel>
16-
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
16+
<TargetFrameworkProfile>
17+
</TargetFrameworkProfile>
1718
</PropertyGroup>
1819
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1920
<DebugSymbols>true</DebugSymbols>
@@ -23,6 +24,7 @@
2324
<DefineConstants>DEBUG;TRACE</DefineConstants>
2425
<ErrorReport>prompt</ErrorReport>
2526
<WarningLevel>4</WarningLevel>
27+
<Prefer32Bit>false</Prefer32Bit>
2628
</PropertyGroup>
2729
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
2830
<DebugType>pdbonly</DebugType>
@@ -31,6 +33,7 @@
3133
<DefineConstants>TRACE</DefineConstants>
3234
<ErrorReport>prompt</ErrorReport>
3335
<WarningLevel>4</WarningLevel>
36+
<Prefer32Bit>false</Prefer32Bit>
3437
</PropertyGroup>
3538
<ItemGroup>
3639
<Reference Include="System" />
@@ -70,6 +73,7 @@
7073
<AppDesigner Include="Properties\" />
7174
</ItemGroup>
7275
<ItemGroup>
76+
<None Include="app.config" />
7377
<None Include="dllmain.cpp" />
7478
<None Include="Renderer.cpp" />
7579
<None Include="Renderer.h" />
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"host": "visualstudio"
3+
}

dotnet-desktop-guide/samples/snippets/cpp/VS_Snippets_Wpf/System.Windows.Interop.D3DImage/cpp/window1.xaml.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ public POINT(Point p)
210210

211211
public static class HRESULT
212212
{
213-
[SecurityPermissionAttribute(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)]
214213
public static void Check(int hr)
215214
{
216215
Marshal.ThrowExceptionForHR(hr);

dotnet-desktop-guide/samples/snippets/csharp/VS_Snippets_Winforms/ManagedDOMStyles/CS/Form1.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@
99

1010
namespace ManagedDOMStyles
1111
{
12-
[PermissionSet(SecurityAction.Demand, Name="FullTrust")]
1312
public partial class Form1 : Form
1413
{
15-
1614
public Form1()
1715
{
1816
InitializeComponent();
@@ -57,4 +55,4 @@ void Document_MouseLeave(object sender, HtmlElementEventArgs e)
5755
}
5856
//</SNIPPET2>
5957
}
60-
}
58+
}

dotnet-desktop-guide/samples/snippets/csharp/VS_Snippets_Winforms/ManagedDOMStyles/CS/ManagedDOMStyles.csproj

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
22
<PropertyGroup>
33
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
44
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -9,6 +9,13 @@
99
<AppDesignerFolder>Properties</AppDesignerFolder>
1010
<RootNamespace>ManagedDOMStyles</RootNamespace>
1111
<AssemblyName>ManagedDOMStyles</AssemblyName>
12+
<FileUpgradeFlags>
13+
</FileUpgradeFlags>
14+
<UpgradeBackupLocation>
15+
</UpgradeBackupLocation>
16+
<OldToolsVersion>2.0</OldToolsVersion>
17+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
18+
<TargetFrameworkProfile />
1219
</PropertyGroup>
1320
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1421
<DebugSymbols>true</DebugSymbols>
@@ -18,6 +25,7 @@
1825
<DefineConstants>DEBUG;TRACE</DefineConstants>
1926
<ErrorReport>prompt</ErrorReport>
2027
<WarningLevel>4</WarningLevel>
28+
<Prefer32Bit>false</Prefer32Bit>
2129
</PropertyGroup>
2230
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
2331
<DebugType>pdbonly</DebugType>
@@ -26,6 +34,7 @@
2634
<DefineConstants>TRACE</DefineConstants>
2735
<ErrorReport>prompt</ErrorReport>
2836
<WarningLevel>4</WarningLevel>
37+
<Prefer32Bit>false</Prefer32Bit>
2938
</PropertyGroup>
3039
<ItemGroup>
3140
<Reference Include="System" />
@@ -55,7 +64,9 @@
5564
<Compile Include="Properties\Resources.Designer.cs">
5665
<AutoGen>True</AutoGen>
5766
<DependentUpon>Resources.resx</DependentUpon>
67+
<DesignTime>True</DesignTime>
5868
</Compile>
69+
<None Include="app.config" />
5970
<None Include="Properties\Settings.settings">
6071
<Generator>SettingsSingleFileGenerator</Generator>
6172
<LastGenOutput>Settings.Designer.cs</LastGenOutput>

dotnet-desktop-guide/samples/snippets/csharp/VS_Snippets_Winforms/ManagedDOMStyles/CS/Properties/Resources.Designer.cs

Lines changed: 23 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dotnet-desktop-guide/samples/snippets/csharp/VS_Snippets_Winforms/ManagedDOMStyles/CS/Properties/Settings.Designer.cs

Lines changed: 13 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)