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

If cloned from repo, module can be loaded without DLLs installed. #51

Closed
bjompen opened this issue Feb 11, 2021 · 3 comments
Closed

If cloned from repo, module can be loaded without DLLs installed. #51

bjompen opened this issue Feb 11, 2021 · 3 comments
Labels
enhancement New feature or request needs feedback
Projects

Comments

@bjompen
Copy link
Collaborator

bjompen commented Feb 11, 2021

Is your feature request related to a problem? Please describe.
Since moving Build-Bicep to use DLL instead of bicep.exe we need to have the compiled DLL files in the assets folder.

We have the DLLs in question set as required in the module manifest (psd1), but this is not a check that they actually exist.

This makes it so that you may actually import the module even if the DLL files are missing, which leads to all kinds of interesting errors.

This may not be a problem for installations from the gallery

We will, eventually, set up a proper build step to 'compile' the module for release, and in that step make sure that the required DLLs are part of the nuget package in the PowerShell Gallery,

but the problem will still be a part of running the module from the repo as we don't want compiled DLLs here.

Describe the solution you'd like
If the module is loaded without the DLLs in their assigned location either:

  • throw an error or warning when importing the module such as 'failed to load DLL files'
    or
  • throw a better error in all functions that requires the DLLs to function

Additional context
I am actually more leaning to solution number 2 as of now. We have the lifecycle CmdLets (Install, Uninstall, Update) that doesn't rely on DLL files. If a user uses the module for bicep.exe lifecycle management it should be easy to do so in any scenario.

@bjompen bjompen added the enhancement New feature or request label Feb 11, 2021
@StefanIvemo
Copy link
Member

We can also add a section in docs about how to install the module using the latest code by downloading the code and execute the downloadAssemblies.ps1 script to download all assemblies needed.

@bjompen
Copy link
Collaborator Author

bjompen commented Feb 15, 2021

When downloading the 1.3 version of the repo it seems to be throwing an error on import module (as expected).

Needs verification, but this issue might have been resolved by itself.

PalmEmanuel added a commit that referenced this issue Feb 16, 2021
#51 fixed Update-BicepCLI to run uninstaller before update
@StefanIvemo StefanIvemo added this to To do in Tasks Feb 16, 2021
@StefanIvemo
Copy link
Member

Closing this. Have added instructions to CONTRIBUTING.md regarding how to clone and download the dependencies. And when the module can't be loaded without BicepNet starting with version 2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs feedback
Projects
Tasks
To do
Development

No branches or pull requests

2 participants