Wednesday, October 17, 2018

How to make SlowCheetah work with class libraries and services, apart from executables

Add a App.Base.Config which is the base for all configs and the below lines would ensure on build the specific environment gets copied to the App.config.

Just add the below lines to end of .csProj file where you need SlowCheetah support:

<Import Project="$(SlowCheetahTargets)" Condition="Exists('$(SlowCheetahTargets)')" Label="SlowCheetah" />
  <Import Project="..\packages\Microsoft.VisualStudio.SlowCheetah.3.0.61\build\Microsoft.VisualStudio.SlowCheetah.targets" Condition="Exists('..\packages\Microsoft.VisualStudio.SlowCheetah.3.0.61\build\Microsoft.VisualStudio.SlowCheetah.targets')" />
  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\WebApplications\Microsoft.WebApplication.targets" />
  <Target Name="BeforeBuild">
    <TransformXml Source="App.Base.config" Transform="App.$(Configuration).config" Destination="App.config" />
  </Target>

Wednesday, October 10, 2018

Git: Add new files and directories using GitBash

Reference link: 
https://linuxprograms.wordpress.com/2012/01/30/git-add-new-files-directories/
Git: How to add new files and directories?

If you are working with Git and want to add a new file or directory, follow the following steps
Go to the directory where your file is located.
$ cd directory
$ git add filename
Now you must commit these changes (You can give necessary comments)
$ git commit -m "Adding a new file"
If you want to add a directory, Go to the directory where the directory you want to add is located.
$ cd directory
$ git add directoryname
Now you must commit these changes (You can give necessary comments)
$ git commit -m "Adding a new directory"
Note that the above step will also commit the subdirectories and files present in the directory.