LightSwitch project: Which files to check in, and which to ignore?
Asked Answered
D

5

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.)

Dorsal answered 18/8, 2011 at 21:38 Comment(0)
M
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
Monah answered 9/9, 2011 at 19:45 Comment(3)
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 social.msdn.microsoft.com/Forums/en-US/…Rambo
Excluding folders should be stated like this: [Bb]in/. Your pattern */[Bb]in/* doesn't work for me (using Git on Windows).Hocuspocus
Ignoring cscfg and csdef files does cause problems with publishKemper
I
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/*  
Irmairme answered 24/8, 2011 at 18:35 Comment(0)
P
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
Prelate answered 2/11, 2011 at 18:15 Comment(0)
L
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.

Lashelllasher answered 15/1, 2012 at 12:41 Comment(0)
R
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.

Rivet answered 18/8, 2011 at 21:40 Comment(4)
Can I also ignore all this stuff in _Pvt_Extensions?Dorsal
@Kyralessa I haven't tested removing that stuff. For reference, here is my .gitignore file: [Bb]in/ [Oo]bj/ GeneratedArtifacts/ *.suoRivet
Removing the ClientGenerated and ServerGenerated folders will cause the project to no longer load.Dympha
@jcmcbeth: i think I had issues as well.Acceptance

© 2022 - 2024 — McMap. All rights reserved.