Managing the source code

The sources of our application are now stored as text files on our file system, but this is not a very easy way to collaborate. Keeping the versions of our files is a manual process that requires a lot of discipline.

Instead of the manual process, we can use a source code management system that helps us in this process. Since 2014, Microsoft has had a free cloud service for this—Visual Studio Online. This is essentially a cloud version of Team Foundation Server. Let's see how we can use this.

Creating the workspace

If we go to http://www.visualstudio.com, we can set up a new workspace. We will use http://www.learningnavpatterns.visualstudio.com. Each workspace gets five free users for the source code control and unlimited users for creating and maintaining tasks. On top of the five free users, you can add users with an MSDN subscription for free too, which is shown as follows:

Creating the workspace

After the account is created, we can set up a new project; for example; a project for our Bed and Breakfast solution.

Creating the workspace

After generating the project, it is ready to be used.

Creating the workspace

Setting up Visual Studio

We will use Visual Studio 2015 to connect to the cloud service and upload the files. This can be done in almost any version of Visual Studio including the community edition, which is available for free.

Tip

To create the connection, you can watch the videos on this YouTube channel at https://www.youtube.com/playlist?list=PLhZ3P-LY7Cqlh_z1rLOAAAAk9Y2clUhHl.

When the connection is created, we can map the files to our local folders.

Setting up Visual Studio

Uploading the files

Now we have to upload the files. There are many ways to do this, and we will use the simplest way. We will first upload the initial version that we started programming with, NAV2015, and then upload the 1.0 version of the software.

To do this, we need to copy the individual text files from the folder that we had created earlier with PowerShell to the TFS folder.

Uploading the files

The next step is to add these in Visual Studio. This is not something that happens automatically.

Uploading the files

After this is done, the changes are pending to be committed. We can do this in the Team Explorer window. We need to make sure that the description makes sense.

Uploading the files

Now, the changes are committed, and we can see the Changesets online too, as shown here:

Uploading the files

To upload the Bed and Breakfast files, we need to repeat the steps and check in again. Let's fast forward to this.

In the following screenshot, we can see that we've imported changeset 9, Bed and Breakfast 1.0. It shows the changes per object, compared to other versions:

Uploading the files

The simplicity of setting up a versioning system in Visual Studio Online, in combination with the PowerShell command, allows us to make it very powerful for an average Dynamics NAV implementation.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset