1 thought on “Error “cannot be used” for “Extension” development

  1. Thanks for clarifying the ‘scope’ parameters. However, what’s still not clear to me is how this is reflected in the ‘one code-base’ principle that MS advocates. Is there just one BC app or different apps (one for Saas vs another for OnPrem) Downloading the code from the mcr.microsoft.com/businesscentral/sandbox container (which seems to me the ‘Saas’ solution), shows an app.json file with “target”: “OnPrem”. Also lots of .al files still contain the [Scope(‘OnPrem’)] attribute. How can I see the real difference (if there’s any) in the Base Application objects used in Saas vs OnPrem?

    The reason why I’m asking is that we want to prepare our OnPrem solution for Cloud, still using one single code-base. Since there’s a lot of functions containing dotnet / non-Saas supported features, I was thinking of tagging these functions with [Scope(‘OnPrem’)], but setting the target to ‘Cloud’, so the app would build for Saas, without access to the OnPrem functions. However, this seems not to work.

    Am I obliged to create 2 code-bases? One with OnPrem functions + target OnPrem and another without OnPrem functions + target Cloud? (Another option is to move away OnPrem functions to a dependend extension instead.)

Comments are closed.