Skip to content

16 test failures related to JObject instances cast to dynamic #72

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

Closed
dougbu opened this issue Oct 17, 2017 · 2 comments
Closed

16 test failures related to JObject instances cast to dynamic #72

dougbu opened this issue Oct 17, 2017 · 2 comments
Assignees

Comments

@dougbu
Copy link
Contributor

dougbu commented Oct 17, 2017

Test failures do not occur on all machines. But, they happen consistently on machines with .NET 4.7 installed. All failures involve unexpected RuntimeBinderExceptions. And, those Exceptions are thrown in consistent locations:

Microsoft.CSharp.RuntimeBinder.RuntimeBinderException : 'Newtonsoft.Json.Linq.JObject' does not contain a definition for 'oauth_token'
    at CallSite.Target(Closure , CallSite , Object )
    ...

The error messages mention oauth_token in two cases (in Microsoft.AspNet.Facebook.Test.FacebookContextModelBinderTest) and ExceptionType in the remaining 14 failures (2 in System.Web.Http.ExceptionHandlingTest and 12 in System.Web.Http.IncludeErrorDetailTest).

Could workaround the ExceptionType failures, using something other than dynamic in the test code. However the FacebookClient's ParseSignedRequest(...) method internally casts a JObject instance to dynamic. (Unclear why e.g. FacebookAuthorizeFilterHookTest tests succeed while FacebookContextModelBinderTest tests fail.)

@dougbu dougbu self-assigned this Oct 17, 2017
@dougbu
Copy link
Contributor Author

dougbu commented Oct 17, 2017

Self-assigning since this gets in my way

@dougbu dougbu added this to the 5.2.4 milestone Oct 17, 2017
@dougbu dougbu added the task label Oct 17, 2017
dougbu added a commit that referenced this issue Oct 19, 2017
- #72 and also related to #65
- v7.0.1 is the next major version after what the product code is built against (v6.0.4)
  - this version corrects test failures I saw on a machine with .NET 4.7 (#72)
- add binding redirects and include the app.config files in test projects
- avoid new `TypeLoadException`s for Newtonsoft.Json that break numerous tests
  - consistently disable Copy Local (aka `%(Private)` metadata) in `src` projects
  - add Newtonsoft.Json references in test projects that bring it in transitively
    - otherwise, product code is last to mention Newtonsoft.Json assembly
dougbu added a commit that referenced this issue Oct 20, 2017
- #72 and also related to #65
- v7.0.1 is the next major version after what the product code is built against (v6.0.4)
  - this version corrects test failures I saw on a machine with .NET 4.7 (#72)
- add binding redirects and include the app.config files in test projects
- avoid new `TypeLoadException`s for Newtonsoft.Json that break numerous tests
  - consistently disable Copy Local (aka `%(Private)` metadata) in `src` projects
  - add Newtonsoft.Json references in test projects that bring it in transitively
    - otherwise, product code is last to mention Newtonsoft.Json assembly
@dougbu
Copy link
Contributor Author

dougbu commented Oct 20, 2017

e4c8e01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant