Error handling when publishing a package on a Business Central server.
Hello Team,
let's talk about publishing of a packages on BC server and weird and ridiculous errors which you are getting at this moment.
1. My favorite one. "Could not publish the package to the server. See Visual Studio Code debug console for more details" :
And yes, there are no details in the debug console :)
To resolve it:
- add ShowMyCode parameter with TRUE value into app.json file
- Press F6 button to publish package an open it in the designer.
After that - magic! You'll see your error in normal view.
2. Errors which looks strange. Such as "One or more errors occurred" or you have error with length about several screens.
The reason is incorrect Al language extension version.
- If you write app for "cloud" Business Central - delete your Al language extension from VS code and install latest one from the extensions market. Also it'll be good to replace app.json file to new one (create new project and copy it from there). App.json file parameters differs in its versions.
- For on-premise version (and for NAV2018) - open folder with distributive, find Modern development Environment folder (for example: Dynamics.110.NA.2468045.DVD\ModernDev\program files\Microsoft Dynamics NAV\110\Modern Development Environment). Delete your Al language extension from VS code and install *.vsix file from folder. Do not forget to restart VS Code!
3. Enable Code analysis. Open Settings tab in VS Code. User Settings -> Extensions -> AL Language Extension -> Enable Code Analysis. Sometimes after that you'll see some "hidden" errors. Such as You need to use Translation Tool feature or Permission Sets files.
For me this 3 methods covers about 99% of errors which occurred on package publishing. I hope they also help you to resolve them. Good luck!
Comments
-
Hi @zhongyong, in this case you could leave just "${CodeCop}" analyzer. TranslationFile is a requirement of "${AppSourceCop}".
You can read how to disable part of code analyzers here:
-
3. Enable Code analysis. Open Settings tab in VS Code. User Settings -> Extensions -> AL Language Extension -> Enable Code Analysis.
-------->If you use this method, there will be another error.[error AS0015: Please enable the TranslationFile feature in the app.json file for your project.]
*This post is locked for comments