Thursday 19 April 2012

I've just got in the situation where simple code like:

using (new SecurityDisabler()){
//publish item
}

didn't work.

I was so sure in fact that it should work because of my previous experience with Sitecore, that it took me some time to find the problem. And here it is: there is a setting Publishing.CheckSecurity in web.config. When it is set to true, Sitecore uses SecurityEnabler when publishes, so turning on SecurityDisabler before it makes no sense.

If you run into same question, just use UserSwitcher or disable Publishing.CheckSecurity.

Wednesday 18 April 2012


To filter comments like <!-- smth with linebreaks --> in WinMerge:

1. Go to C:\Program Files (x86)\WinMerge, open IgnoreSectionMarkers.ini file
2. Delete everything that is there.
3. Put next lines in the file:


[set0]
StartMarker=<!--
EndMarker=-->
InlineMarker=<!--
FileType0=xml
FileType1=config

4. Save file and restart WinMerge.

To make these changes take effect, you need also next changes to WinMerge options:
"Compare" section: 
  • disable "Match similar lines" checkbox
  • enable "Filter comments" checkbox

Thursday 12 April 2012


Simple WinMerge filter:


---
def: include ##will select all files without [filter below] in name

f: (2) ## Match all files with (2) in name
f: \.disable$
f: \.example$
f: \.bak$

Thursday 5 April 2012

Very useful for Reflector:


If you use auto-properties instead of traditional ones they are named <Name>k__BackingField instead something like _Name.