Announcement

Collapse
No announcement yet.

"marked as not usable from script" error and strategy

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • JulienG
    started a topic "marked as not usable from script" error and strategy

    "marked as not usable from script" error and strategy

    Hello, I try to use your products on order to convert lot of c# class in javascript (or typescript) equivalent.
    I met some problems during compilation,Your system seem unable to transform the ValidationResult class. (i have some class with references to this class)
    Indeed, in the implementation, i see
    [External]
    [NonScriptable]
    public class ValidationResult
    so i have this (blocking) error
    System.ComponentModel.DataAnnotations.ValidationRe sult is marked as not usable from script

    I don't really understand what to do with this error. I cant' create my own class beacause it will be in conflict with YOUR class.
    I find another message in this forum relating to my problem (not the same class, but same consequences) : https://forums.bridge.net/forum/comm...le-from-script

    So if i understand, i have to provide implementation of this class to your team and wait you update the version ?

    This class is not really complicated, i don't understand why she is flag as nonScriptable : https://referencesource.microsoft.co...ationResult.cs

    Thank you !

    Julien Gourdon

    PS : the classes i want to migrate contain a lot of code, i'm afraid, even if i solve errors for this class, i will have errors for others classes :-(


  • fabricio.murta
    replied
    Hello JulienG

    We mark some Bridge code with NonScriptable when we need it for some part of functionality (like allowing code to actually build), but still couldn't make an implementation of that class in Bridge to be output to JavaScript. See this comment for more info.

    Here's where the class is defined (with NonScriptable) in Bridge: Bridge/System/ComponentModel/DataAnnotations/ValidationResult.cs#L13.

    Unfortunately, in order to be able to reference this on code that Bridge outputs as JavaScript, further implementation is necessary (the actual C# to JavaScript implementation).

    Hope this helps!

    Leave a comment:


  • JulienG
    replied
    Hi geoffrey,

    thanks for your response, you will find an exemple wich reproduce the problem here : https://deck.net/fb9a724b4107e17fd8f6440214aba6e2

    you can see the problem disappear if you remove the line where i construct a validationResult (the new ValidationResult)

    thanks !

    Julien

    Leave a comment:


  • geoffrey.mcgill
    replied
    Hi. Can you share a Deck.NET sample demonstrating how to reproduce the issue?

    Leave a comment:

Working...
X