Bug 31961 - Application SelfHosting Microsoft.Owin.Security.OAuth.OAuthBearerAuthenticationMiddleware
Summary: Application SelfHosting Microsoft.Owin.Security.OAuth.OAuthBearerAuthenticati...
Status: RESOLVED ANSWERED
Alias: None
Product: Runtime
Classification: Mono
Component: Reflection ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2015-07-14 23:43 UTC by aoim
Modified: 2015-08-05 05:55 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
CodeOfBug (1.70 KB, text/plain)
2015-07-14 23:43 UTC, aoim
Details
projecto (1.35 MB, application/zip)
2015-08-02 05:37 UTC, aoim
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description aoim 2015-07-14 23:43:16 UTC
Created attachment 12028 [details]
CodeOfBug

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeLoadException: Could not load type 'Microsoft.Owin.Security.DataProtection.DpapiDataProtector' from assembly 'Microsoft.Owin.Security, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
at Microsoft.Owin.Security.DataProtection.AppBuilderExtensions.CreateDataProtector (Owin.IAppBuilder,string[]) <0x00051>
at Microsoft.Owin.Security.OAuth.OAuthBearerAuthenticationMiddleware..ctor (Microsoft.Owin.OwinMiddleware,Owin.IAppBuilder,Microsoft.Owin.Security.OAuth.OAuthBearerAuthenticationOptions) <0x002f7>
at (wrapper dynamic-method) object.lambda_method (System.Runtime.CompilerServices.Closure,Microsoft.Owin.OwinMiddleware,Owin.IAppBuilder,Microsoft.Owin.Security.OAuth.OAuthBearerAuthenticationOptions) <0x0004a>
at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) <0x0006a>
at System.Reflection.MonoMethod.Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) <0x000a1>

  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) <0x7ff85e530610 + 0x000ef> in <filename unknown>:0 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) <0x7ff85e368ca0 + 0x0002a> in <filename unknown>:0 
  at System.Delegate.DynamicInvokeImpl (System.Object[] args) <0x7ff85e5e8a50 + 0x0024c> in <filename unknown>:0 
  at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) <0x7ff85e5f0c70 + 0x00035> in <filename unknown>:0 
  at System.Delegate.DynamicInvoke (System.Object[] args) <0x7ff85e5e8970 + 0x00019> in <filename unknown>:0 
  at Microsoft.Owin.Builder.AppBuilder.BuildInternal (System.Type signature) <0x41942b20 + 0x00146> in <filename unknown>:0 
  at Microsoft.Owin.Builder.AppBuilder.Build (System.Type returnType) <0x41942af0 + 0x00017> in <filename unknown>:0 
  at Microsoft.Owin.Hosting.ServerFactory.ServerFactoryAdapter.Create (IAppBuilder builder) <0x41942670 + 0x000f4> in <filename unknown>:0 
  at Microsoft.Owin.Hosting.Engine.HostingEngine.StartServer (Microsoft.Owin.Hosting.Engine.StartContext context) <0x41942630 + 0x0002d> in <filename unknown>:0 
  at Microsoft.Owin.Hosting.Engine.HostingEngine.Start (Microsoft.Owin.Hosting.Engine.StartContext context) <0x418f96c0 + 0x0014b> in <filename unknown>:0 
  at Microsoft.Owin.Hosting.Starter.DirectHostingStarter.Start (Microsoft.Owin.Hosting.StartOptions options) <0x418d1b50 + 0x0005a> in <filename unknown>:0 
  at Microsoft.Owin.Hosting.Starter.HostingStarter.Start (Microsoft.Owin.Hosting.StartOptions options) <0x418cf8c0 + 0x0007c> in <filename unknown>:0 
  at Microsoft.Owin.Hosting.WebApp.StartImplementation (IServiceProvider services, Microsoft.Owin.Hosting.StartOptions options) <0x418cecc0 + 0x0005e> in <filename unknown>:0 
  at Microsoft.Owin.Hosting.WebApp.Start (Microsoft.Owin.Hosting.StartOptions options) <0x418cc5c0 + 0x0002b> in <filename unknown>:0 
  at Microsoft.Owin.Hosting.WebApp.Start (System.String url) <0x418cc2e0 + 0x00027> in <filename unknown>:0 
  at WebApiHostingWebSignalR.Program.Main (System.String[] args) <0x418c9d50 + 0x00043> in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeLoadException: Could not load type 'Microsoft.Owin.Security.DataProtection.DpapiDataProtector' from assembly 'Microsoft.Owin.Security, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
at Microsoft.Owin.Security.DataProtection.AppBuilderExtensions.CreateDataProtector (Owin.IAppBuilder,string[]) <0x00051>
at Microsoft.Owin.Security.OAuth.OAuthBearerAuthenticationMiddleware..ctor (Microsoft.Owin.OwinMiddleware,Owin.IAppBuilder,Microsoft.Owin.Security.OAuth.OAuthBearerAuthenticationOptions) <0x002f7>
at (wrapper dynamic-method) object.lambda_method (System.Runtime.CompilerServices.Closure,Microsoft.Owin.OwinMiddleware,Owin.IAppBuilder,Microsoft.Owin.Security.OAuth.OAuthBearerAuthenticationOptions) <0x0004a>
at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) <0x0006a>
at System.Reflection.MonoMethod.Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) <0x000a1>

  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) <0x7ff85e530610 + 0x000ef> in <filename unknown>:0 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) <0x7ff85e368ca0 + 0x0002a> in <filename unknown>:0 
  at System.Delegate.DynamicInvokeImpl (System.Object[] args) <0x7ff85e5e8a50 + 0x0024c> in <filename unknown>:0 
  at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) <0x7ff85e5f0c70 + 0x00035> in <filename unknown>:0 
  at System.Delegate.DynamicInvoke (System.Object[] args) <0x7ff85e5e8970 + 0x00019> in <filename unknown>:0 
  at Microsoft.Owin.Builder.AppBuilder.BuildInternal (System.Type signature) <0x41942b20 + 0x00146> in <filename unknown>:0 
  at Microsoft.Owin.Builder.AppBuilder.Build (System.Type returnType) <0x41942af0 + 0x00017> in <filename unknown>:0 
  at Microsoft.Owin.Hosting.ServerFactory.ServerFactoryAdapter.Create (IAppBuilder builder) <0x41942670 + 0x000f4> in <filename unknown>:0 
  at Microsoft.Owin.Hosting.Engine.HostingEngine.StartServer (Microsoft.Owin.Hosting.Engine.StartContext context) <0x41942630 + 0x0002d> in <filename unknown>:0 
  at Microsoft.Owin.Hosting.Engine.HostingEngine.Start (Microsoft.Owin.Hosting.Engine.StartContext context) <0x418f96c0 + 0x0014b> in <filename unknown>:0 
  at Microsoft.Owin.Hosting.Starter.DirectHostingStarter.Start (Microsoft.Owin.Hosting.StartOptions options) <0x418d1b50 + 0x0005a> in <filename unknown>:0 
  at Microsoft.Owin.Hosting.Starter.HostingStarter.Start (Microsoft.Owin.Hosting.StartOptions options) <0x418cf8c0 + 0x0007c> in <filename unknown>:0 
  at Microsoft.Owin.Hosting.WebApp.StartImplementation (IServiceProvider services, Microsoft.Owin.Hosting.StartOptions options) <0x418cecc0 + 0x0005e> in <filename unknown>:0 
  at Microsoft.Owin.Hosting.WebApp.Start (Microsoft.Owin.Hosting.StartOptions options) <0x418cc5c0 + 0x0002b> in <filename unknown>:0 
  at Microsoft.Owin.Hosting.WebApp.Start (System.String url) <0x418cc2e0 + 0x00027> in <filename unknown>:0 
  at WebApiHostingWebSignalR.Program.Main (System.String[] args) <0x418c9d50 + 0x00043> in <filename unknown>:0
Comment 1 Marek Safar 2015-07-31 10:22:55 UTC
Could you attach full .csproj file? I cannot reproduce the issue with manually recreated dependencies.
Comment 2 aoim 2015-08-02 05:37:24 UTC
Created attachment 12329 [details]
projecto

este es un aplicativo.

saludos.
Comment 3 Marek Safar 2015-08-03 03:39:51 UTC
I still cannot build it, it's failing due to missing dependency e.g.

signalwebapi/Controllers/CompaniesController.cs(16,16): Error CS0246: The type or namespace name `IHttpActionResult' could not be found. Are you missing an assembly reference? (CS0246) (WebApiHostingWebSignalR)
Comment 4 aoim 2015-08-03 06:52:19 UTC
hi! 

lo subire a dropbox y enviare una carpeta(folder) compartido espero que apruebes mi invitación para que lo puedas descargar.

el archivo pesa 46 mb aproximademente.

saludos

oscar.
Comment 6 Marek Safar 2015-08-05 05:55:16 UTC
This is due to missing System.Net.Http.Formatting dependencies. The one in your project requires 2.0 version of System.Net.Http which is not in your project and it's quite old.

I resolved this by updating Microsoft.AspNet.WebAPI.Client to version 5.2.3 which no longer requires Microsoft.Net.Http 2.0.20710.0