Skip to main content

Use Post-build Script in Visual Studio for Deployment Dynamics GP.

In my project, I had a scenario to build the assembly program and after that,  I had to perform few operation related to deployment since my project is kind of a connector to connect Microsoft Dynamics GP  to an e-Commerce solution.

So, I was looking for a solution. I found out that my whole process can be executed with visual studio.Since my connector has one part of.Net assembly which is built with c#, I was using Visual Studio 2015 as my development environment.

Solution

In my case, I had to write a PowerShell script within my solution to automate copping file to necessary places. Refer this link if you need more information about  How to write PowerShell script

once I have the script in place, we need to set the property  Copy to Output Directory to Copy always to make this script copy always to the bin folder. 


Then, In visual studio project in build event, I have given following command to run  PowerShell script with the required parameter as the file path.

powershell.exe -file "$(ProjectDir)bin\Debug\ReleaseBuild\RegisterForMaualProcess.ps1

  1. Once you use powershell.exe it will execute powershell.exe.
  2. But you need to provide a file as a parameter. therefore  -file has been used.
  3. In order to get the project execution path automatically, you have to use  $(ProjectDir)bin.
  4. then rest of is the path to your PowerShell script.



Comments

Popular posts from this blog

How to connect blob storage via Shared access signature URL (SAS)

  Follow the steps to connect the blob container using the  Shared access signature. You may need  Azure Storage Explorer    in order to access the blob storage locally. STEP 1   Under  Local & Attached   go to   Storage Accounts ( Right-click ) ->   Connect to Azure Storage . STEP 2 Select the  Blob container   option. STEP 3 Select the  Shared access signature URL (SAS)   option. STEP 4 Copy and paste the given  Blob container SAS URL   and click   Next . STEP 5 Click  Connect . You are all set to access to content of the blobs storage. 👍

How to create a PowerShell script

PowerShell    is an amazing tool which we can use to perform various operations in windows environments. Today we are going to write a  PowerShell   script using Windows  PowerShell   ISE. How to open Windows PowerShell ISE  For this session we need to have Windows  PowerShell   ISE. You can find it under,  Control Panel\All Control Panel Items\Administrative Tools. You better open Windows  PowerShell   ISE as administrator mode. if you have any issues please follow this link.  Windows PowerShell Integrated Scripting Environment (ISE) In My project I had to use  PowerShell   script to regiter few Dlls in Global Assembly Cache (GAC) and keep file paths in XML file and extract data by reading XML file. My XML file looks like this and file name is FilePath.XML . FilePath.XML <?xml version="1.0" encoding="utf-8"?> <Resource>   <MacroFilePath>\ReleaseBuild...

Azure Content Delivery Network ( Azure CDN )

Covering Topics Introduction What is CDN? Azure CDN Create a storage account Create a blob container Upload your image files You can copy URL and view it in your browser Create CDN for your Blob storage Test your CDN and Blob storage