Ben Walker
  • Blog
  • Blog

Integrating LINQPad scripts into Source Control

21/4/2017

1 Comment

 
Whilst there is no built-in source control integration in LINQPad, it is still easy to keep your LINQPad scripts under source control. This means that scripts can easily be shared amongst your team and you can take full advantage of the benefits of source control, such as versioning and safe file storage in an external repository.
As an example I will show you how we have integrated LINQPad scripts into our Visual Studio Team Services code repository - the same pattern should work equally well for other source control systems.
First of all, create a folder within your VCS which will hold your LINQPad scripts. We have a folder called LINQPad queries with sub-folders for different projects and another folder for useful samples. Once you have created that folder, you can link that folder location on your computer to the 'My Queries' folder in LINQPad by clicking on the 'Set Folder...' link...
Picture
… and then selecting this as your custom location for queries:
Picture
Now that your LINQPad queries folder is under source control, any changes you make will be flagged as Pending Changes in Visual Studio, and you can add new files to the repository using the Source Control Explorer in Visual Studio.
Picture
If your team all map their ‘My Queries’ folder to the same location, then all files in the repository become shared with the team.
You can avoid uploading passwords and other sensitive information in your scripts by using the Util.GetPassword method, as explained in this blog post.
PS If you just want to share LINQPad scripts with other users without putting them into source control, LINQPad has a feature called Instant Share which allows you to upload a file to a repository on the LINQPad server – you will then be given a URL of the uploaded file which you can share with colleagues or post on your blog, like this script which shows you how to generate a PDF in LINQPad.

1 Comment
Bite Sized Bree link
15/9/2021 11:24:47 pm

I enjoyed reading your blog, thanks.

Reply



Leave a Reply.

    Archives

    July 2021
    June 2021
    May 2020
    March 2020
    December 2019
    October 2019
    June 2018
    February 2018
    October 2017
    September 2017
    August 2017
    May 2017
    April 2017

    Categories

    All
    Dynamics 365
    Dynamics CRM
    FakeXrmEasy
    LINQPad
    Testing

    RSS Feed

    Author

    Some stuff about me!

Proudly powered by Weebly