MissingMethodException from System.Security.Permissions when running application
This is an issue with running the hello world WinForms application after replacing the System.Windows.Forms binary with my locally built copy (i.e. to debug changes).
Steps followed:
- Install .NET Core 3.0.0 Preview 1 SDK with x64 Installer (can't use latest build due to #249)
dotnet new winforms -o winformstest- Run winformstest with
dotnet run
At this point, the hello world application starts up and everything is fine.
- Build winforms repo locally per Developer Guide (completes with no errors or warnings)
- Copy contents of
winforms\artifacts\bin\System.Windows.Forms\Debug\netcoreapp3.0toProgram Files\dotnet\shared\Microsoft.WindowsDesktop.App\3.0.0-alpha-27128-4 - Run winformstest with
dotnet run
Expected results:
The hello world application still runs successfully.
Actual results:
System.MissingMethodException: Method not found: 'Void System.Security.Permissions.FileIOPermission..ctor(System.Security.Permissions.PermissionState)'.
at System.Windows.Forms.Application.EnableVisualStyles()
at winformstest.Program.Main(String[] args) in C:\redacted\winformstest\Program.cs:line 20
When EnableVisualStyles is commented out, the application instead fails with Could not load type 'System.Security.PermissionSet' from assembly 'System.Runtime.Extensions'. #252 has that same issue, although it's a build rather than runtime failure.
#249 is fixed.
Is this related to https://github.com/dotnet/corefx/pull/33379 ?
This is fixed and verified by the latest core sdk
Yep, this is fixed with 3.0.100-preview-009844.