Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.0.100-preview.6.20308.7] NuGetPackageExplorer PlatformNotSupportedException at launch #37637

Closed
DotNetAppCompatFeiWang opened this issue Jun 9, 2020 · 3 comments
Labels
area-System.Runtime.InteropServices untriaged New issue has not been triaged by the area owner

Comments

@DotNetAppCompatFeiWang
Copy link

DotNetAppCompatFeiWang commented Jun 9, 2020

Application Name: NuGetPackageExplorer
OS: Windows 10 RS5
CPU: X64
.NET Build Number: 5.0.100-preview.6.20308.7

App Source on GitHub link: https://github.com/NuGetPackageExplorer/NuGetPackageExplorer
Library : https://github.com/novotnyllc/OSVersionHelper (.NET Standard 2.0)

Verify Scenarios:
1). Windows 10 RS5 X64 + .NET Core SDK build 5.0.100-preview.6.20308.7: Fail
2). Windows 10 RS5 X64 + .NET Core SDK build 5.0.100-preview.5.20279.10: Pass

Findings :
Exception comes from OSVersionHelper library(.NET Standard 2.0) that NugetPackageExplorer uses.

Repro Code :

static void Main(string[] args)
 {
            if (Windows.Foundation.Metadata.ApiInformation.IsApiContractPresent("Windows.ApplicationModel.Calls.CallsVoipContract", 1))
            {
                System.Console.WriteLine("Windows.ApplicationModel.Calls.CallsVoipContract v1.x found");
            }
            else
            {
                System.Console.WriteLine("Windows.ApplicationModel.Calls.CallsVoipContract v1.x NOT found");
            }
 }

On Prev6, returns :

Unhandled exception. System.PlatformNotSupportedException: Operation is not supported on this platform. (0x80131539)

Exception Log :
Application: NuGetPackageExplorer.exe
CoreCLR Version: 5.0.20.30506
.NET Version: 5.0.0-preview.6.20305.6
Description: The process was terminated due to an unhandled exception.

Exception Info: System.TypeInitializationException: The type initializer for 'PackageExplorer.PluginManager' threw an exception.
 ---> System.TypeInitializationException: The type initializer for 'OSVersionHelper.WindowsVersionHelper' threw an exception.
 ---> System.PlatformNotSupportedException: Operation is not supported on this platform. (0x80131539)
   at OSVersionHelper.WindowsVersionHelper.IsApiContractPresent(UInt16 majorVersion)
   at OSVersionHelper.WindowsVersionHelper..cctor() in D:\a\1\s\OSVersionHelper\WindowsVersionHelper.cs:line 27
   --- End of inner exception stack trace ---
   at OSVersionHelper.WindowsVersionHelper.get_HasPackageIdentity() in D:\a\1\s\OSVersionHelper\WindowsVersionHelper.cs:line 125
   at PackageExplorer.PluginManager.GetPluginDirectory() in C:\Users\Appcompat\Downloads\NuGetPackageExplorer-master\NuGetPackageExplorer-master\PackageExplorer\MefServices\PluginManager.cs:line 50
   at PackageExplorer.PluginManager..cctor() in C:\Users\Appcompat\Downloads\NuGetPackageExplorer-master\NuGetPackageExplorer-master\PackageExplorer\MefServices\PluginManager.cs:line 43
   --- End of inner exception stack trace ---
   at PackageExplorer.PluginManager.EnsurePluginCatalog(AggregateCatalog mainCatalog) in C:\Users\Appcompat\Downloads\NuGetPackageExplorer-master\NuGetPackageExplorer-master\PackageExplorer\MefServices\PluginManager.cs:line 218
   at PackageExplorer.PluginManager..ctor(AggregateCatalog catalog) in C:\Users\Appcompat\Downloads\NuGetPackageExplorer-master\NuGetPackageExplorer-master\PackageExplorer\MefServices\PluginManager.cs:line 100
   at PackageExplorer.App.get_Container() in C:\Users\Appcompat\Downloads\NuGetPackageExplorer-master\NuGetPackageExplorer-master\PackageExplorer\App.xaml.cs:line 53
   at PackageExplorer.App.Application_Startup(Object sender, StartupEventArgs e) in C:\Users\Appcompat\Downloads\NuGetPackageExplorer-master\NuGetPackageExplorer-master\PackageExplorer\App.xaml.cs:line 65
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__139_0(Object state)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.Run()
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run()
   at PackageExplorer.App.Main()

Related DevDiv bug: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1138457

cc @dotnet-actwx-bot

@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't figure out the best area label to add to this issue. Please help me learn by adding exactly one area label.

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Jun 9, 2020
@danmoseley
Copy link
Member

BTW thank you @DotNetAppCompatFeiWang for your thorough and complete issues.

cc @AaronRobinsonMSFT

@AaronRobinsonMSFT
Copy link
Member

This is by design. See #37672

@ghost ghost locked as resolved and limited conversation to collaborators Dec 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Runtime.InteropServices untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

4 participants