locked
ASPX Inline code can't access Module. RRS feed

  • Question

  • User1843806588 posted

    In my web application, I call a VB.NET Module inline.  It works fine with my compiler.

    When I publish to two other development web servers, I get:

    Compiler Error Message: BC30451: <my_module> is not declared. It may be inaccessible due to its protection level.

    when I reference it in an IF statement on the .aspx page.  I've tried putting it into a Namespace, but that didn't work either.

    Is there some sort of Publishing or IIS setting that I need to change when I publish?

    Sunday, September 8, 2019 3:09 AM

All replies

  • User665608656 posted

    Hi Galaxy_Stranger,

    When I publish to two other development web servers, I get:

    Compiler Error Message: BC30451: <my_module> is not declared. It may be inaccessible due to its protection level.

    when I reference it in an IF statement on the .aspx page. 

    For this error message, you can try to fix it by adding Public to the default Module.

    Or you can also refer to these links :

    https://stackoverflow.com/a/11876035

    https://stackoverflow.com/a/40445262

    Best Regards,

    YongQing.

    Monday, September 9, 2019 2:25 AM
  • User1843806588 posted

    Thanks for the reply!

    Heh, yeah, I've seen both of those posts.  My module is public and it's not a scope issue with variables.

    I've even checked that the servers are supporting my target framework.

    Monday, September 9, 2019 5:12 AM
  • User665608656 posted

    Hi Galaxy_Stranger,

    Heh, yeah, I've seen both of those posts.  My module is public and it's not a scope issue with variables.

    I've even checked that the servers are supporting my target framework.

    According to your description, I suggest that you provide detailed code for ”my_module“ and inline code for your aspx page, which will help us solve your issue more easily.

    Best Regards,

    YongQing.

    Monday, September 9, 2019 8:47 AM