question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Methods exposed to Windows Runtime must return only Windows Runtime types.

See original GitHub issue

I’m getting a

'AlarmClock.ParameterController.GetWithSimpleParameters(System.Int32, System.String)' returns 'Devkoes.Restup.WebServer.Models.Schemas.GetResponse', which is not a valid Windows Runtime type.  Methods exposed to Windows Runtime must return only Windows Runtime types.

when following the REST tutorial in the wiki. I’m also using a headless app and getting the same results when trying the example provided in the repo.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:15 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Jarkcommented, Mar 31, 2016

Closed due to #46

1reaction
Jarkcommented, Mar 12, 2016

Hello Jan,

Thanks, that did help me with pinpointing what’s going on.

I think (don’t know for sure since I haven’t read up on the uwp compiler model) that all types exported in windows uwp “apps” have to be sealed.

Why the sample app works is because it has got the controllers in a separate library, and this library is referenced by the sample app. Once the sample app is compiled all the library’s types are made sealed (if you’re not overriding them).

What this means:

  • If you want to use restup now you will have to use a separate library project and reference the controllers from that library in the headless app, or override the GetResponse class and make that class sealed
  • the response classes in restup will need to be made sealed to prevent this from happening. I probably will have some time to do this this weekend, but pull requests are also always welcome 😃

I want to apologise for suggesting that your setup was wrong, and thank you for following this through!

Cheers,

Jark

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I overcome Windows Component limitation to ...
Method 'X' returns 'Y', which is not a valid Windows Runtime type. Methods exposed to Windows Runtime must return only Windows Runtime types...
Read more >
The Windows Runtime (WinRT) type system
Describes the Windows Runtime (WinRT) type system, and defines parameterized types, versioning, and other factors.
Read more >
Diagnose C#/WinRT component errors - Windows apps
Exporting types that aren't valid Windows Runtime types. The public interface of your component must expose only Windows Runtime types. However ...
Read more >
Windows Runtime components with C# and Visual Basic
Externally, the members of your types can expose only Windows Runtime types for their parameters and return values.
Read more >
Diagnosing Windows Runtime Component error conditions
Exporting types that aren't valid Universal Windows Platform types. The public interface of your component must expose only UWP types. However, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found