Monday, August 6, 2018

D365FO – Adding a custom .dll to a project that can be deployed via source control.


Currently I wrote a custom C# .dll add-in for D365FO that will reach out to google maps api. By doing so it seemed easy to integrate into a D365FO project and it was. How ever until I went to move it I realized that it requires some extra steps in order for it to be deployed to another machine via TFS properly.

You will first need to add the reference node within visual studio to source control






However adding this referenced file into source control will not actually add the .dll to the source control like you would think. This is actually just an xml file that references the dll which can be found at

C:\AOSService\PackagesLocalDirectory\[package name]\[model/project]\AxReference

In order to add the actual .dll we need to go to source control explorer and go to the main package folder and right click and choose “add items to folder…”



browse to the folder: C:\AOSService\PackagesLocalDirectory\[package]\bin 

select the actual .dll that was added to the project.

This will create a bin folder in the main project node within TFS but will only include the file you selected and not every file in the folder.
At this point just check in the two files and then do a pull/get latest on the destination system and the project should now compile.

So to sum it up be sure to include the following two files
C:\AOSService\PackagesLocalDirectory\[package name]\[model/project]\AxReference\
And
C:\AOSService\PackagesLocalDirectory\[package]\bin\dllname.dll

or else the package/project will not compile when loaded onto a different server. 

2 comments:

  1. Adam,
    dont we need to add the .pdb file too? just asking

    ReplyDelete
  2. I have not found the need to in my scenarios as this file pertains to debugging managed code. That is not to say there might be a valid reason to add it as well but it is not required.

    ReplyDelete