Skip to content
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

public enum with [IsVisibleInDynamoLibrary(false)] still visible in library #8789

Closed
ksobon opened this issue Apr 25, 2018 · 14 comments
Closed
Labels
2.x Issues related to 2.x versions of Dynamo. engine Issues related to the engine driving Dynamo. priority Related to a release. tracked

Comments

@ksobon
Copy link

ksobon commented Apr 25, 2018

I thought that adding this attribute to a public class would hide it from the library:

    /// <summary>
    /// Parameter Filter Numeric Rules.
    /// </summary>
    [IsVisibleInDynamoLibrary(false)]
    public enum FilterNumericValueRule
    {
        /// <summary>
        /// 
        /// </summary>
        DoubleRule,
        /// <summary>
        /// 
        /// </summary>
        ElementIdRule,
        /// <summary>
        /// 
        /// </summary>
        GlobalParameterRule,
        /// <summary>
        /// 
        /// </summary>
        IntegerRule
    }

Yet, it's still showing up. That was not an issue in previous version.

image

@ksobon ksobon changed the title public enum with [IsVisibleInDynamoLibrary(false)] still visible in library public enum with [IsVisibleInDynamoLibrary(false)] still visible in library Apr 25, 2018
@mjkkirschner
Copy link
Member

well, this is not a class, but an enum, but I believe @ramramps and I touched enums here:
https://github.com/DynamoDS/Dynamo/pull/8311/files

I don't see anything obvious that would cause a regression though.

@ksobon does this attribute work for you on classes? - can you hide this enum by making it internal?

@alfarok do we know if this attribute is working?

@ksobon
Copy link
Author

ksobon commented Apr 25, 2018

I mean yeah, that's an Enum but it used to work just fine like that before. Besides even in that link you posted you guys do exactly the same thing to an Enum. Just scroll down a few lines. It's a DateTime enum and you hide it with that same attribute. Was there a regression?

@mjkkirschner
Copy link
Member

I'm not sure the enum is hidden by the [IsVisibleInDynamoLibrary(false)] or the [obsolete] attribute. I just want to be specific because enums and classes are imported differently into the VM.

Looks to me like a regression.

@ksobon
Copy link
Author

ksobon commented Apr 25, 2018

I can't make it internal because it's shared across projects. It's a utility Enum used in a couple of places. I was able to use a different attribute: [SupressImportIntoVM] to hide it and that seems to be working:

image

    /// <summary>
    /// Parameter Filter Numeric Rules.
    /// </summary>
    [SupressImportIntoVM]
    public enum FilterNumericValueRule
    {
        /// <summary>
        /// 
        /// </summary>
        DoubleRule,
        /// <summary>
        /// 
        /// </summary>
        ElementIdRule,
        /// <summary>
        /// 
        /// </summary>
        GlobalParameterRule,
        /// <summary>
        /// 
        /// </summary>
        IntegerRule
    }

It would still make sense to look at re-enabling the original implementation.

@mjkkirschner
Copy link
Member

yes, lets keep this open.

@alvpickmans
Copy link
Contributor

alvpickmans commented May 17, 2018

Same issue here. I tried [SuppressImportIntoVM] without any luck.
image

alvpickmans added a commit to alvpickmans/JsonData that referenced this issue May 17, 2018
@mjkkirschner
Copy link
Member

Hi @alvpickmans you can't suppress jObject as you're returning it directly, return an object or some other base class instead.

@mjkkirschner
Copy link
Member

oh I see, you want to hide JsonOption - can you share your code where this in defined or where you reference it.

@mjkkirschner
Copy link
Member

@alvpickmans - I see it now in your source, can you try making that class internal? You can cheat and give your other assemblies access to internal classes with:
https://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.internalsvisibletoattribute(v=vs.110).aspx

inside the assembly info cs

@alvpickmans
Copy link
Contributor

Thanks @mjkkirschner for the tip, I will try it out and get back to you.

@alvpickmans
Copy link
Contributor

I've tried this and it compiles ok without errors, but once a node needs the internal class Dynamo simply fails to find the method.
It is not a big deal to be honest, I will just note this properly for the time being. Cheers!

@alfarok
Copy link
Contributor

alfarok commented Jun 20, 2018

This regression is being tracked with QNTM-4094. The issue came up in the Dynamo Samples and was also circumvented by suppressing the import into the VM but more investigation is required for a permanent solution.

@johnpierson johnpierson added 2.x Issues related to 2.x versions of Dynamo. priority Related to a release. and removed 2.1 Release labels Oct 3, 2018
@johnpierson johnpierson added engine Issues related to the engine driving Dynamo. tracked and removed Library labels Nov 7, 2018
@johnpierson
Copy link
Member

Tracked internally as QNTM-4094

@aparajit-pratap
Copy link
Contributor

This is fixed in: #9242. Closing. Let us know if you still experience issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Issues related to 2.x versions of Dynamo. engine Issues related to the engine driving Dynamo. priority Related to a release. tracked
Projects
None yet
Development

No branches or pull requests

6 participants