12

In a LightSwitch application, what files and folders should I ignore and not keep in source control?

(I'm using Git, and I'm wondering what to put in the .gitignore file.)

Ryan Lundy
  • 204,559
  • 37
  • 180
  • 211

5 Answers5

9

From my article on this very question (includes some extra's for DevExpress and so on):

*.lsproj.user
ServiceConfiguration.cscfg
*/_Pvt_Extensions/*
*/GeneratedArtifacts/*
*.csproj.user
*.vbproj.user
*/[Oo]bj/*
*/[Bb]in/*
*.suo
*DXCore.Solution
[Tt]humbs.db 
*.user
*.bak.* 
*.bak 
*.[Cc]ache
*/[Pp]ublish/*
*.vssscc
*.vs10x
*/[Dd]otfuscated/*
[Dd]otfuscated/*
*.vsp
[Nn][Dd]epend[Oo]ut/*
*.licx
*.docstates
*.cscfg
*.csdef
Robert MacLean
  • 38,975
  • 25
  • 98
  • 152
  • 1
    After much head scratching as to why I could not publish a project I pulled from a git repo, I found that it was because my cscfg and csdef files were missing. You may want to remove them from the gitignore file. See http://social.msdn.microsoft.com/Forums/en-US/ecdff8dc-8190-4d32-9080-ce6430d9e27a/root-element-is-missing-when-trying-to-publish?forum=lightswitch – Phistrom Oct 29 '13 at 21:56
  • Excluding folders should be stated like this: `[Bb]in/`. Your pattern `*/[Bb]in/*` doesn't work for me (using Git on Windows). – Marcel May 16 '15 at 15:55
  • Ignoring cscfg and csdef files does cause problems with publish – bilal.haider Sep 16 '15 at 10:38
2

I believe this is a comprehensive list of what isn't needed in source control.

_Pvt_Extensions\
bin\Debug
bin\Release
Client\bin
Client\obj
ClientGenerated\bin
ClientGenerated\obj
Common\bin
Common\obj
Server\bin
Server\obj
ServerGenerated\bin
ServerGenerated\obj

Not sure about git ignore syntax but in Mercurial my .hgignore contains:

*/[Oo]bj/*  
*/[Bb]in/*  
*.suo  
*.lsproj.user  
*/_Pvt_Extensions/*  
*/GeneratedArtifacts/*  
dteske
  • 77
  • 1
  • 9
1

@Robert Maclean Thanks!

I should also add that .gitignore does not seem to work from windows. So instead I put the exclusions in .git/info/exclude [.git is a hidden folder in your local repository working directory]

Note: The /info/exclude rules are not committed with the repo so they are not shared with others.

Here is the git version of Robert's file:

# ignore for Lightswitch
*.lsproj.user
ServiceConfiguration.cscfg
_Pvt_Extensions/
GeneratedArtifacts/

# ignore for Visual Studio
*.csproj.user
*.vbproj.user
[Oo]bj/
[Bb]in/
*.suo

*DXCore.Solution
[Tt]humbs.db 
*.user
*.bak.* 
*.bak 
*.[Cc]ache
[Pp]ublish/
*.vssscc
*.vs10x
[Dd]otfuscated/
[Dd]otfuscated/
*.vsp
[Nn][Dd]epend[Oo]ut/
*.licx
*.docstates
*.cscfg
*.csdef
1

If you will be publishing to Windows Azure, be sure to add azureconfig.txt to the ignore list (.gitignore file in git). The azureconfig.txt file contains very sensitive Azure account information.

0

As far as source control goes, you can safely "ignore" the ClientGenerated & ServerGenerated folders, as they'll be re-generated each time you build your project.

Ben.Vineyard
  • 1,149
  • 8
  • 14