Skip to content

System.Security.Principal.Windows missing runtime assembly on Linux #16215

Closed

Description

@benaadams

Or incorrectly referenced? Not sure, not directly referenced

It restores fine
Installing System.Security.Principal.Windows.4.0.0-rc2-23722
Then errors in use

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.Security.Principal.Windows, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
 ---> System.IO.FileNotFoundException: Could not load the specified file.
   at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyName(AssemblyName assemblyName)
   at System.Runtime.Loader.AssemblyLoadContext.Resolve(IntPtr gchManagedAssemblyLoadContext, AssemblyName assemblyName)
   --- End of inner exception stack trace ---
   at System.Net.ContextAwareResult.Cleanup()
   at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Net.ContextAwareResult.Complete(IntPtr userToken)
   at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
   at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionCallback(Int32 numBytes, SocketError errorCode)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
bash: line 1: 13883 Aborted                 (core dumped) dnx test
fail: Exit code 134 from /usr/bin/env
fail: Stack trace: 

No issues on Windows

Activity

  1. benaadams commented on Jan 26, 2016

    @benaadams
    MemberAuthor

    Related? dotnet/corefx#5576

    Might need to be picking up rc3 files?

  2. benaadams commented on Jan 26, 2016

    @benaadams
    MemberAuthor

    @stephentoub looks like issue you saw in dotnet/corefx#5596 (comment) ?

  3. stephentoub commented on Jan 26, 2016

    @stephentoub
    Member

    Yes, this should be fixed in newer packages.

  4. ericstj commented on Jan 26, 2016

    @ericstj
    Member

    That's by design. The contract isn't supported on Linux. Also, if you use either NuGet or the latest dotnet CLI you should see a restore error.

    The dependency from System.Net on System.Security.Principal.Windows was fixed with dotnet/corefx#5576. You should see that fix in either rc3-23722, or rc2-23726.

  5. davidfowl commented on Jan 26, 2016

    @davidfowl
    Member

    This is going to wreak havoc on upstream packages. Now everyone has to pivot on runtime when they use this dependency.

  6. ericstj commented on Jan 26, 2016

    @ericstj
    Member

    This is not different than Microsoft.Win32.Registry, System.Security.Cryptography.Cng, System.Net.Http.WinHttpHandler, System.Runtime.WindowsRuntime.UI.Xaml. All of these are Windows-specific technologies. We have similar Unix only packages today just not as many of them (OpenSSL comes to mind).

    Perhaps you are suggesting the scenario for using WindowsIdentity is a common one and there should be a good cross-platform API that hides platform specific types. That could be true, though I'd like to hear that from the folks that own the libraries that are using this contract today.

    @brentschmaltz does System.Security.Claims have anything like that?

  7. andyleejordan commented on Jan 26, 2016

    @andyleejordan
    Member
    error: System.Security.Principal.Windows 4.0.0-rc3-23726 provides a compile-time reference assembly for System.Security.Principal.Windows on DNXCore,Version=v5.0, but there is no run-time assembly compatible with ubuntu.14.04-x64.
    

    @stephentoub This dependency appears to have regressed in 4.0.0-rc3-23726.

  8. ericstj commented on Jan 26, 2016

    @ericstj
    Member

    @andschwa shared his project file with me and he's using System.IO.FileSystem.AccessControl, Microsoft.Win32.Registry.AccessControl, and System.Security.AccessControl. All of these are Windows-specific.

  9. andyleejordan commented on Jan 26, 2016

    @andyleejordan
    Member

    @ericstj With dotnet-cli's switch to NuGet, I'm going to have to find another way to provide these types for my project.

  10. ericstj commented on Jan 26, 2016

    @ericstj
    Member

    @andschwa it's not just the types. You need to bring down the implementation as well. One proposal on the table is https://github.com/dotnet/cli/issues/465 which would enable applications to cross-compile by OS. Another thing that's been discussed in the past is "optional" dependencies, though I don't think there is a solid proposal for that one.

  11. andyleejordan commented on Jan 26, 2016

    @andyleejordan
    Member

    We guard against the use of actual code itself at runtime (shared codebase), so the implementation should never be hit.

  12. glennc commented on Jan 26, 2016

    @glennc

    @davidfowl Doesn't HttpPlatformHandler middleware depend on this? Doesn't this break our ability to move the template apps in VS to Linux or OS X without changes?

  13. lodejard commented on Jan 26, 2016

    @lodejard

    @glennc yes, using "implementation missing" at restore time instead of "platform not supported" at run-time means the templates are OS-specific.

  14. ericstj commented on Feb 4, 2016

    @ericstj
    Member

    That's only if HttpPlatformHandler doesn't build as a fat package. If you were to build this component as a fat package with separate windows and unix implementations, you wouldn't have OS-specific templates.

    This is what we do already for all CoreFx packages that need to use platform specific technology.

  15. ericstj commented on Mar 24, 2016

    @ericstj
    Member

    This was fixed by adding PlatformNotSupported assemblies.

  16. transferred this issue fromdotnet/corefxon Jan 31, 2020
  17. added this to the 1.0.0-rc2 milestone on Jan 31, 2020
  18. ghost locked as resolved and limited conversation to collaborators on Jan 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions