Using visual studio and the Umbraco NuGet package, I'd like to setup a basic Umbraco installation containing:
some umbraco packages, such as Optimus
some individual document types
This should be wrapped by a git repo.
Where possible, I'd like to exclude generated/compiled files by adding the affected paths/file extensions to the .gitignore file.
I started off using the official umbraco .gitignore which has the following entries:
# Note: VisualStudio gitignore rules may also be relevant
# Umbraco
# Ignore unimportant folders generated by Umbraco
**/App_Data/Logs/
**/App_Data/[Pp]review/
**/App_Data/TEMP/
**/App_Data/NuGetBackup/
# Ignore Umbraco content cache file
**/App_Data/umbraco.config
# Don't ignore Umbraco packages (VisualStudio.gitignore mistakes this for a NuGet packages folder)
# Make sure to include details from VisualStudio.gitignore BEFORE this
!**/App_Data/[Pp]ackages/
!**/[Uu]mbraco/[Dd]eveloper/[Pp]ackages
# ImageProcessor DiskCache
**/App_Data/cache/
However, this would not include the database nor installed packages, so I also added the following entries*:
!**/Aa]pp_[Dd]ata/packages
!**/Aa]pp_[Dd]ata/Umbraco.sdf
!**/[Bb]in/*.pdb
!**/[Uu]mbraco/[Cc]onfig
see discussion here
Using this configuration, ReSharper would list 3 errors which occur in the global web.config file:
my-umbraco-project\Web.config:87 Cannot resolve symbol 'Providers'
my-umbraco-project\Web.config:87 Cannot resolve symbol 'DefaultSessionStateProvider'
my-umbraco-project\Web.config:87 Invalid module qualification: Failed to resolve assembly System.Web.Providers
However, I can compile, log-in to my umbraco instance and even the pre-installed plugin would appear.
This basically leaves 2 questions:
What do I additionally have to include in order to fix the 3 errors?
Are there more compiled/generated files I could exclude?
So here's the .gitignore we use without any issues:
[Oo]bj/
[Bb]in/
.nuget/
.vs/
_ReSharper.*
packages/
artifacts/
*.user
*.suo
*.userprefs
*.dbmdl
*DS_Store
*.sln.ide
# Umbraco
# Ignore unimportant folders generated by Umbraco
**/App_Data/Logs/
**/App_Data/[Pp]review/
**/App_Data/TEMP/
**/App_Data/NuGetBackup/
# Ignore Umbraco content cache file
**/App_Data/umbraco.config
# Don't ignore Umbraco packages (VisualStudio.gitignore mistakes this for a NuGet packages folder)
# Make sure to include details from VisualStudio.gitignore BEFORE this
!**/App_Data/[Pp]ackages/
!**/[Uu]mbraco/[Dd]eveloper/[Pp]ackages
!*UmbracoModelsBuilder.user
# ImageProcessor DiskCache
**/App_Data/cache/
Related
I'm using an ASP.NET MVC application and I have added my source code to git bitbucket repository.
All my source code has been enabled to get tracking and history.
I had added .gitignore in the very first version of my source code but very less changes.
Now i need to skip my bin and other unnecessary files ( like .cache and .host).
I have added all unnecessary files in .gitignore.
Please see my tried .gitignore file
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*[.json, .xml, .info]
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
Application built with
{
"application type": "ASP.NET MVC 5",
".Net framework": "4.5" ,
"language" : C#
}
I have removed the cached files as well by executing the following commands through git bash.
I have pulled all source again.
git rm -r --cached
git add .
git commit -m ".gitignore fix"
I have confirmed that my .gitignore is in the root of the working directory.
What should I do to fix it ?
I tried to follow google articles and looked up example implementations but could not solve/explain the issue well.
I'm running into an issue where I'm trying to publish through Visual Studio, but publishing the site doesn't copy out the App_Data folder, which causes the site to crash when it's run, because it's trying to write to a file that doesn't exist. To remedy this, I figured I could just manually copy out the App_Data folder, which did help, however there are still files not present, for example this is my current error:
C:\inetpub\wwwroot\myapp\App_Data\TEMP\PluginCache\umbraco-plugins.{machine-name}.hash' is denied
Which tells me that Umbraco isn't writing out the new files for the remote machine it's now running on. My question then is, how do I get Umbraco to generate all the files it needs to generate to run properly?
Make sure you have the correct file permissions set that are required by Umbraco:
/Web.config Modify / Full control
Only needed for setting database and version Information during installation. So can be set to read-only afterwards for enhanced security
/App_Code Modify / Full control
Should always have modify rights as the folder and its files are used for dynamically loading in and generating dlls
/App_Data Modify / Full control
Should always have modify rights as the folder and its files are used for cache and storage
/Bin Modify / Full control
Needed for installing packages, if no packages are installed, this can be set to read accees only
/Config Modify / Full control
Only needed for setting database and version Information during installation. So can be set to read-only afterwards for enhanced security
/Css Modify / Full control
Should always have modify rights as the folder and its files are used for css files
/MacroScripts Modify / Full control
Should always have modify rights as the folder and its files are used for Razor files
/Masterpages Modify / Full control
Should always have modify rights as the folder and its files are used for template files
/Media Modify / Full control
Should always have modify rights as the folder and its files are used for media files uploaded via Umbraco cms interface
/Scripts Modify / Full control
Should always have modify rights as the folder and its files are used for script files
/Umbraco Modify / Full control
For upgrades and package installation, it should have modify rights, but can be set to read-only afterwards
/Umbraco_client Modify / Full control
For upgrades and package installation, it should have modify rights, but can be set to read-only afterwards
/UserControls Modify / Full control
Modify rights are needed for installing packages
/Views Modify / Full control
Should always have modify rights as the folder and its files are used for template, partial view and macro files
/Xslt Modify / Full control
Should always have modify rights as the folder and its files are used for macro files
Figured it out, first off in App_Data, remove everything in there except packages, then go into iis and on your site, right click, edit permissions -> Security tab -> edit -> Add -> Add the name of the site (myapp, myapp.com, etc.), give full control, and your problem should be solved, the site will be able to generate any files it needs to generate.
I have installed into a new project in codekit the following components:
jquery
animate.css
normalize
Modernizer
I understand that keeping these components in the bower directory is recommended so these files are easily updated. However, do we link to these in our html files directly? My sass files get compiled and outputted to assets/css but there aren't any sass files in the bower components and creating them in the original folder would, I assume, get overridden if I was to upgrade. Seems very odd to me to upload the entire bower_components file to the production server with all the dependent files. I have been building site for a long time without all this node, git, grunt, bower, et al stuff. I see the value in it, but I'm having a tough time getting up to speed. Any help sure would be appreciated.
In most cases, you would want to include the third-party components (e.g. css, javascript, ... files) within your own master css or javascript file and then minimize that file for production. For example, my folder structure looks like:
bower_components/
...
release/
css/
styles.min.css
img/
...
js/
scripts.min.js
src/
images/
...
scripts/
scripts.js
styles/
styles.less
templates/
...
And then, within styles.less, I might have:
#import (less) "../../bower_components/normalize-css/normalize.css";
Or within scripts.js I could have:
//#codekit-prepend "../../bower_components/jquery/dist/jquery.js"
I have CodeKit set to generate the minified versions in release/ from those files. The only files that go to production are all of the files in the release/ folder.
I created a new app and the Dart Editor (M4) created a slew of files and folders. Now I'm not sure which I can safely put in the gitignore. Here's the tree:
app/.buildlog
app/build.dart
app/packages/analyzer_experimental
app/packages/args
app/packages/browser
app/packages/csslib
app/packages/html5lib
app/packages/js
app/packages/logging
app/packages/meta
app/packages/pathos
app/packages/source_maps
app/packages/unittest
app/packages/web_ui
app/pubspec.lock
app/pubspec.yaml
app/web/app.css
app/web/app.dart
app/web/app.html
app/web/out/app.css
app/web/out/app.dart
app/web/out/app.dart.map
app/web/out/app.html
app/web/out/app.html_bootstrap.dart
app/web/out/packages
app/web/out/xclickcounter.dart
app/web/out/xclickcounter.dart.map
app/web/packages
app/web/xclickcounter.dart
app/web/xclickcounter.html
I assume the following files can be ignored:
app/.buildlog
app/packages/*
app/web/out/*
app/web/packages
Is that correct?
From What Not to Commit on dartlang.org:
# files and directories created by pub
.dart_tool/
.packages
.pub/
build/
pubspec.lock # Except for application packages
# API documentation directory created by dartdoc
doc/api/
# files and directories created by other development environments
*.iml # IntelliJ
*.ipr # IntelliJ
*.iws # IntelliJ
.idea/ # IntelliJ
.DS_Store # Mac
# generated JavaScript files
*.dart.js
*.info.json # Produced by the --dump-info flag.
*.js # When generated by dart2js. Don't specify *.js if your
# project includes source files written in JavaScript.
*.js_
*.js.deps
*.js.map
Don’t commit the following files and directories created by pub, Dart Editor, and dart2js:
packages/
pubspec.lock // Except for application packages
.project
.buildlog
*.js_
*.js.deps
*.js.map
Don’t commit files and directories dropped by other development environments. For example:
.project // Eclipse
*.iml // IntelliJ
*.ipr // IntelliJ
*.iws // IntelliJ
.idea/ // IntelliJ
.DS_Store // Mac
Avoid committing generated JavaScript files:
*.dart.js
For more details, read https://www.dartlang.org/tools/private-files.html.
Dart default
.packages # mapping file from package names to local path
packages # until `--no-package-symlinks` is the default
build/ # contains the output of `pub build`
.pubspec.lock # controversial - Dart guideline is to only commit
# for applications but not for packages
.pub/ # cache files generated by `pub`
# .pub was moved to .dart_tool/.pub
build The new https://github.com/dart-lang/build package introduces a
.dart_tool/
directory which should be excluded.
When it comes to generated files it is generally best to not submit them to source control, but a specific Builder may provide a recommendation otherwise.
IDE
.idea # IntelliJ, WebStorm
bazel
/bazel-*
.bazelify
packages.bzl
BUILD
WORKSPACE
See also
https://github.com/github/gitignore/blob/master/Dart.gitignore
https://www.dartlang.org/guides/libraries/private-files
An up to date sample Dart .gitignore is available in the gitignore repo on Github:
https://github.com/github/gitignore/blob/master/Dart.gitignore
Note that this does not contain IDE or editor files, just Dart files. You can find IDE and editor .gitignores in the same repo.
I include doc/api in my .gitignore. I tend to write substantial documentation comments and I like to use dartdoc to generate the documentation for review.
Anyone know of good articles for setting up a new project with git and ASP.NET MVC?
Just wondering what to include and ignore and what to do about deployment.
Gitignore
You asked about what to ignore -- here is my default .gitignore for ASP.NET MVC projects:
###################
# compiled source #
###################
*.com
*.class
*.dll
*.exe
*.pdb
*.dll.config
*.cache
*.suo
# Include dlls if they’re in the NuGet packages directory
!/packages/*/lib/*.dll
!/packages/*/lib/*/*.dll
# Include dlls if they're in the CommonReferences directory
!*CommonReferences/*.dll
####################
# VS Upgrade stuff #
####################
UpgradeLog.XML
_UpgradeReport_Files/
###############
# Directories #
###############
bin/
obj/
TestResults/
###################
# Web publish log #
###################
*.Publish.xml
#############
# Resharper #
#############
/_ReSharper.*
*.ReSharper.*
############
# Packages #
############
# it’s better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
######################
# Logs and databases #
######################
*.log
*.sqlite
# OS generated files #
######################
.DS_Store?
ehthumbs.db
Icon?
Thumbs.db
Setting up a new project
For help on setting up a new project, I would install msysgit since you're most likely on Windows and check out learn.github to learn about getting started with git.
Of course, the master (Skeet) suggests you do most everything from the console -- and I tend to agree with him. Git is just easier that way IMHO. If you'd like a handy git reference, check out the git reference.
Deployments
As somebody else already mentioned -- check out AppHarbor for deployments. Those guys aim to be the 'Heroku of ASP.NET'.
There is a great post on codebetter.com today. It is about OSS projects but I bet it is applicable to you as well because it is describing GIT.
The right part of the article is the link to Kyle's blog and especially Getting Started with Git and GitHub on Windows.
If you're already using git and ASP MVC you should also check out AppHarbor http://appharbor.com/ for deployment and hosting. It integrates right into your workflow.
Corrected link
http://codebetter.com/blogs/aaron.jensen/archive/2009/03/12/hosting-your-oss-project-on-github.aspx
Mine is super simple:
*/packages/*
/packages/*
obj/
bin/
TestResults/
_ReSharper.*
*.csproj.user
*.resharper.user
*.resharper
*.suo
*.cache
*~
*.swp
*.resharper.user
*.rptproj.user
*.db
*.sdf
*.tmp
For the example of gitignore files check github gitignore examples and one for visual studio VisualStudio.gitignore