Connect Visual Studio Code to Business Central on premise

MortenSteengaard
Member Posts: 144
I cannot download symbols from Business Central (2019 second wave). Business Central is on a server and I have Visual Studio Code on my local PC.
App.json:
{
"id": "a31dcs4b-0ab4-4134-98ae-f3c780b5b0ad",
"name": "Moes",
"publisher": "Default publisher",
"version": "1.0.0.0",
"brief": "",
"description": "",
"privacyStatement": "",
"EULA": "",
"help": "",
"url": "",
"logo": "",
"target": "OnPrem",
"dependencies": [
{
"appId": "63ca2fa4-4f03-4f2b-a480-172faf340d3f",
"publisher": "Microsoft",
"name": "System Application",
"version": "1.0.0.0"
},
{
"appId": "437dbf0e-84ff-417a-965d-ed2fb9650972",
"publisher": "Microsoft",
"name": "Base Application",
"version": "15.0.0.0"
}
],
"screenshots": [],
"platform": "15.0.0.0",
"idRanges": [
{
"from": 50100,
"to": 50149
}
],
"contextSensitiveHelpUrl": "https://Moes.com/help/",
"showMyCode": true,
"runtime": "4.0"
}
launch.json:
{
"version": "0.2.0",
"configurations": [
{
"type": "al",
"request": "launch",
"name": "Moes",
"server": "http://md15nav.adm.moes.dk/Moes-D365BC13-Udv",
"serverInstance": "Moes-D365BC13-Udv",
"authentication": "Windows",
"tenant": "",
"startupObjectId": 22,
"startupObjectType": "Page",
"breakOnError": true,
"launchBrowser": true,
"enableLongRunningSqlStatements": true,
"enableSqlInformationDebugger": true,
"port": 7042
}
]
}
I get this error when trying to download symbols:
"Error: Der opstod en fejl under afsendelse af anmodningen. Fjernserveren returnerede en fejl: (401) Uautoriseret. Hovednavnet er ikke korrekt."
(Something like: An error occurred while sending the request. The remote server returned an error: (401). Unauthorized. The main name is not correct.")
I'll read your replies on Friday.
App.json:
{
"id": "a31dcs4b-0ab4-4134-98ae-f3c780b5b0ad",
"name": "Moes",
"publisher": "Default publisher",
"version": "1.0.0.0",
"brief": "",
"description": "",
"privacyStatement": "",
"EULA": "",
"help": "",
"url": "",
"logo": "",
"target": "OnPrem",
"dependencies": [
{
"appId": "63ca2fa4-4f03-4f2b-a480-172faf340d3f",
"publisher": "Microsoft",
"name": "System Application",
"version": "1.0.0.0"
},
{
"appId": "437dbf0e-84ff-417a-965d-ed2fb9650972",
"publisher": "Microsoft",
"name": "Base Application",
"version": "15.0.0.0"
}
],
"screenshots": [],
"platform": "15.0.0.0",
"idRanges": [
{
"from": 50100,
"to": 50149
}
],
"contextSensitiveHelpUrl": "https://Moes.com/help/",
"showMyCode": true,
"runtime": "4.0"
}
launch.json:
{
"version": "0.2.0",
"configurations": [
{
"type": "al",
"request": "launch",
"name": "Moes",
"server": "http://md15nav.adm.moes.dk/Moes-D365BC13-Udv",
"serverInstance": "Moes-D365BC13-Udv",
"authentication": "Windows",
"tenant": "",
"startupObjectId": 22,
"startupObjectType": "Page",
"breakOnError": true,
"launchBrowser": true,
"enableLongRunningSqlStatements": true,
"enableSqlInformationDebugger": true,
"port": 7042
}
]
}
I get this error when trying to download symbols:
"Error: Der opstod en fejl under afsendelse af anmodningen. Fjernserveren returnerede en fejl: (401) Uautoriseret. Hovednavnet er ikke korrekt."
(Something like: An error occurred while sending the request. The remote server returned an error: (401). Unauthorized. The main name is not correct.")
I'll read your replies on Friday.
0
Answers
-
set server:"http://md15nav.adm.moes.dk" instead
and/or NavUserPassword as authenticationbest regards
Franz Kalchmair, MVP
Alias: Jonathan Archer
please like / agree / verify my answer, if it was helpful for you. thx.
Blog: http://moxie4nav.wordpress.com/0 -
Thank you very much for your reply, archer89!
If I use
- "server": "http://md15nav.adm.moes.dk"
- "authentication": "Windows"
I get the same error.
If I use
- "server": "http://md15nav.adm.moes.dk"
- "authentication": "UserPassword"
and enter the user id and password, I get this:
"Using reference symbols cache path: c:\Users\mortens\Documents\AL\Moes\./.alpackages
Sending request to http://md15nav.adm.moes.dk:7042/Moes-D365BC13-Udv/dev/packages?publisher=Microsoft&appName=System&versionText=15.0.0.0
Sending request to http://md15nav.adm.moes.dk:7042/Moes-D365BC13-Udv/dev/packages?publisher=Microsoft&appName=System Application&versionText=1.0.0.0
Sending request to http://md15nav.adm.moes.dk:7042/Moes-D365BC13-Udv/dev/packages?publisher=Microsoft&appName=Base Application&versionText=15.0.0.0"
and then I can enter user id and password again and again and get the 3 "Sending request"-lines every time.
I enter the user id and password, that I use on my local pc and also when I connect to the NAV-server using remote desktop. I also use the same user id and password when I open Business Central in browser from my pc.
When I open Business Central in browser from my pc, I use this link: "https://md15nav.adm.moes.dk/Moes-D365BC13-Udv/". If I in launch.json use https:
- "server": "https://md15nav.adm.moes.dk"
I get this:
"Error: Der opstod en fejl under afsendelse af anmodningen.
Den underliggende forbindelse blev lukket: Der opstod en uventet fejl ved afsendelse..
Handshake mislykkedes på grund af et uventet pakkeformat."
Something like: "The underlying connection was closed. An unexpected error occured. The hand shake didn't succed because of an unexpected package format".
0 -
Hi,
Few tips, and common errors that led me to the same errors, maybe this helps:
1.) If your Instance is set to Windows auth, use Ctrl+alt+p AL: Clear Credential Cache, as it allows you to reenter windows Creds if you mistyped them the first time.
2.) After changing anything in lauch.json try to Ctrl+alt+p Developer: Reload Window
3.) If you run Multitentant it is absolutely mandatory to fill in the tentant parameter in launch.json
First three things that came to mind. Let me know if any of these helped.
/WisaAustrian NAV/BC Dev0 -
... "server": "http://md15nav.adm.moes.dk", "serverInstance": "Moes-D365BC13-Udv", "authentication": "UserPassword", ...
If this launch file doesnt work, the problem is likely an error with the SSL/TLS authentication.
This error is a common symptom when mixing up HTTP and HTTPS, which could happen if your server requires encryption and redirects to https - can you check the packet with Wireshark or some similar tool?
else I can only suggest checking the following:- Is the correct port specified?
- Are the ports opened in the firewall?
- Is any other application blocking this port?
God jul
0 -
Thanks, Wisa123, but no solution yet...
1. I've cleared credential cache many times.
2. I've reloaded the window and restarted VS Code many times.
3. I can see that "Multitenant" is NOT set and therefore I set "Tenant" to blank. I assume this is correct.
That didn't change anything.0 -
Hi Phogue,
I'll look into the port and firewall asap. I need a colleague to do this.
God jul og godt nytår
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions