AL icon indicating copy to clipboard operation
AL copied to clipboard

Get-NAVAppRuntimePackage Errors with assemblyprobingpaths for extension with .NET interop

Open rvanbekkum opened this issue 8 years ago • 11 comments

Hello AL team, Hope you could help us with the following issue/bug.

We were looking into the options for creating a 'Run-Time Package' as is described on the following page: https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-creating-runtime-packages Currently partners and customers do not have insert rights for our ISV module in their license. One possibility is to change these rights for the module, but we wanted to see whether using run-time packages is a possible alternative (see also #1381).

The on-premise app that we developed has the 'target' property set to 'internal' and is using .NET-interop. I have tried running the following command after publishing our app to the corresponding server instance:

Get-NavAppRuntimePackage -ServerInstance DynamicsNAV130 -Tenant default -AppName 'myAppName' -Version 1.0.0.0 -ExtensionPath 'C:\Users\r.vanbekkum\Documents\AL\myAppName.app'

However, running this command fails with the following message:

Get-NavAppRuntimePackage : Extension compilation failed
(25,14): error AL0451: An assembly named 'mscorlib, PublicKeyToken=null' could not be found in the assembly probing paths ''
(40,14): error AL0451: An assembly named 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' could not be found in the assembly probing paths ''

... (and so on, with more warnings about assemblies not being found or DotNet types missing as a consequence)

It appears this command is trying to compile the extension again, before wrapping it into an app runtime package, however, the probing paths seem to be set to '' in the process. Could you look into this, and/or let us know if there might be a way around this, e.g., is it possible to specify the probing paths for this command?

rvanbekkum avatar Nov 12 '18 09:11 rvanbekkum

Hi @rvanbekkum ! This looks like a bug. I will take a look at it.

atoader avatar Nov 12 '18 10:11 atoader

The fix for this issue has been checked in to the master branch. It will be available in the bcinsider.azurecr.io/bcsandbox-master Docker image starting from platform build number 25927.

If you don’t have access to these images you need to become part of the Ready2Go program: aka.ms/readytogo

For more details on code branches and docker images please read: https://blogs.msdn.microsoft.com/nav/2018/05/03/al-developer-previews-multiple-releases-and-github/ https://blogs.msdn.microsoft.com/freddyk/2018/04/16/which-docker-image-is-the-right-for-you/

ALGitHubBot avatar Nov 22 '18 16:11 ALGitHubBot

@atoader First off thank you for looking into the issue. There is, however, one important question left that I would like to ask.

On the page referenced by the GitHub bot above, one can find the following passage:

Therefore, fixes and features released in monthly Developer Previews will only be shipped in the live service and on-premise product in the next major release. Minor releases will only contain critical fixes and improvements

I've checked and confirmed that the issue is still present in CU01 of BC Fall '18, which makes sense as it was only marked resolved here on GitHub after its release. However, as this is an important fix (N.B., making it impossible to publish an ISV add-in that requires .NET interop), is this already passed on to get resolved with the next (CU02) minor release as well?

(As I understand, for minor fixes, the procedure for NAV2018 is to request a backport fix, as described in the FAQ wiki-page)

rvanbekkum avatar Nov 25 '18 18:11 rvanbekkum

The fix for this issue has been checked in to the master branch. It will be available in the bcinsider.azurecr.io/bcsandbox-master Docker image starting from platform build number 25927.

If you don’t have access to these images you need to become part of the Ready2Go program: aka.ms/readytogo

For more details on code branches and docker images please read: https://blogs.msdn.microsoft.com/nav/2018/05/03/al-developer-previews-multiple-releases-and-github/ https://blogs.msdn.microsoft.com/freddyk/2018/04/16/which-docker-image-is-the-right-for-you/

ALGitHubBot avatar Nov 26 '18 06:11 ALGitHubBot

Hi @rvanbekkum ! The fix for BC Fall is pending integration. It should be available in the next CU. That might be CU3.

atoader avatar Nov 26 '18 06:11 atoader

The fix for this issue has been checked in to the master branch. It will be available in the bcinsider.azurecr.io/bcsandbox-master Docker image starting from platform build number 25927.

If you don’t have access to these images you need to become part of the Ready2Go program: aka.ms/readytogo

For more details on code branches and docker images please read: https://blogs.msdn.microsoft.com/nav/2018/05/03/al-developer-previews-multiple-releases-and-github/ https://blogs.msdn.microsoft.com/freddyk/2018/04/16/which-docker-image-is-the-right-for-you/

ALGitHubBot avatar Dec 12 '18 12:12 ALGitHubBot

Hi,

has this fix been integrated into BC 2019 Spring Release? Because I'm experiencing the same error with an our custom dll.

Nyryus avatar Apr 11 '19 06:04 Nyryus

Same here, are there any updates @atoader ?

f4n0 avatar Apr 11 '19 08:04 f4n0

@Nyryus if you have a custom DLL, have you added it to the server's probing paths?

atoader avatar Apr 25 '19 11:04 atoader

@atoader yep, you are right. That one was missing as a parameter to the compile and the procedure showed us the same error, ty we fixed it.

Nyryus avatar May 03 '19 08:05 Nyryus

The fix for this issue has been checked in to the master branch. It will be available in the bcinsider.azurecr.io/bcsandbox-master Docker image starting from platform build number 25927 and VS Code Extension Version 2.0.63257.

If you don’t have access to these images you need to become part of the Ready2Go program: aka.ms/readytogo

For more details on code branches and docker images please read: https://blogs.msdn.microsoft.com/nav/2018/05/03/al-developer-previews-multiple-releases-and-github/ https://blogs.msdn.microsoft.com/freddyk/2018/04/16/which-docker-image-is-the-right-for-you/

ALGitHubBot avatar Oct 22 '19 06:10 ALGitHubBot