Tuesday, April 9, 2019

How to resolve error 500 while accessing Dynamics 365 Finance and Operations URL

Hi ,
This blog is about an error which I faced during accessing Dynamics 365 Finance & Operations. For more information
I am accessing my D365 Demo environment on my local machine with URL
I was getting error as in screen :


Before reading further if you are also facing the same issue then check below solutions , I hope this will be resolved.



This error cause is

1. Services are not running properly.

There are 3 services which mainly runs D365.

a. Application Helper Service

b. SQL Server Service

c. Microsoft Batch Management

d. Microsoft Data Import

Please restart these 4 services


2. IIS may be stopped. Please goto start of your server and run IIS if its not running then restart.

But if error still exists. Then check event viewer.

I followed below Link to resolve this issue.



Lets start the solution :

Step 1. Check which of the certificates are expired.

Run Windows powershell as ADMINISTRATOR


Run Command:


cd cert:\LocalMachine\My
ls | Select-Object NotAfter,Thumbprint,Subject | Where-Object -Property Subject -like "CN=DeploymentsOnebox.*" | Sort-Object -Property Subject,NotAfter


This will check the expired certificates required to run.

There are 4 certificates needed to run this URL of D365 F&O.

The NotAfter column shows when each of them expires. The Subject column contains descriptive information about certificates. The Thumbprint column contains the key by which the certificate is recognized by the operating system.

Step 2. Please goto start->manage computer certificate->Personnal->Certificates

Find these 4 certificates , double click on these certificates and copy the thumbprint. Remove spaces and make small letters to Capital letters.

Do the same for all 4 certificates in word file.

Step 3. Run this code in powershell to add 120 months to each certificates. you will get cloned copies.

$Thumbprint = (get-childitem -Path 01F93A5974A14DC3B40F1CF0BE78127974187BE5 )
New-SelfSignedCertificate -CloneCert $Thumbprint -NotAfter (Get-Date).AddMonths(120)


Please remove the green marked 40 digits key with your certificates Key.


You can get the cloned certificates in Manage computer certificates. But you need to refresh the certificate folder.


Step 4. Check the updated certificates

ls | Select-Object NotAfter,Thumbprint,Subject | Where-Object -Property Subject -like "CN=DeploymentsOnebox.*" | Sort-Object -Property Subject,NotAfter



Step 5.

Now you see two certificates for each of the certificate types – one with the old validity and thumbprint and one with the new validity (current date + 120 months) and thumbprint.
Now start VisualStudio as administrator and open the following three files in the C:\AOSService\webroot folder:
  1. web.config
  2. wif.config
  3. wif.services.config
Press Ctrl+Shift+H key combination to open Find and Replace dialog. Make sure that you select All Open Documents in the Look in drop-down selection box, so that find and replace action will be applied on all three open files.
Now you will have to repeat the following actions for each pair of certificate types:
  1. In the Find what box enter the thumbnail of the old (expired) certificate.
  2. In the Replace with box enter the thumbnail of the cloned new certificate.
  3. Replace all the occurrences in open files.

After you have done this for all four certificates, save the three config files and close VisualStudio.
Restart your browser and navigate to D365FO. It should start without any problems.





 You can also check this link

Tuesday, December 18, 2018

ERROR : MSDYN365BC - Publish Extension Error - NetFx40_LegacySecurityPolicy is enabled and must be turned off.

How to publish App in Business Central without PowerShell ?

While publishing the app I was getting 2 issues :-

Issue 1 :


It was not getting updated and nothing was happening in Output Window. I had installed it via 

PowerShell and it was working for me fine. But there was a problem we need to install several 

versions of same APP. And it was a very lengthy process.

Issue 2 :


While publishing it was giving me error 

MSDYN365BC - Publish Extension Error - NetFx40_LegacySecurityPolicy is enabled and must be turned off.

Solution:

Step 1 :

Go to this file in Service Folder as Shown in Screenshot. (Remember you need to run your system as administrator)


Step 2. Open File in Notepad and find Runtime and make the property to false as shown.

Step 3. Now Restart your NAV Service and Come to visual studio code in your project.
Press F5 or goto View -> Command Pallete -> AL:Publish
Your extension must be published.

If still its not publishing you can comment below.



Monday, December 10, 2018

What is the TempBlob table and why should we use it?

TempBlob  Record Table in Detail






To help you as a developer when writing code to manage import and export of files, you can use the table TempBlob (99008535).

The TempBlob table contains the following fields:

  • Primary Key (integer)
  • Blob (BLOB)

The TempBlob table contains the following functions:

  • WriteAsText
  • ReadAsText
  • ReadAsTextWithCRLFLineSeparator
  • StartReadingTextLines
  • StartWritingTextLines
  • MoreTextLines
  • ReadTextLine
  • WriteTextLine
  • ToBase64String
  • FromBase64String
  • GetHTMLImgSrc
  • GetImageType
  • GetXMLAsText

You should use this table as a temporary table, by setting the Temporary property on the record variable. This makes sure that changes made to the temporary table are not stored in the database. Examples of how to use the TempBlob table are available in codeunit 419 File Management.