tag:blogger.com,1999:blog-71305874095770872822024-03-18T20:48:07.547+11:00David Klein's CornerThe Musings and Findings of Software Consultant David Klein (Sydney, Australia)David Kleinhttp://www.blogger.com/profile/13657389334766989234noreply@blogger.comBlogger336125tag:blogger.com,1999:blog-7130587409577087282.post-89465778315667908252021-06-17T14:30:00.004+10:002021-06-17T14:32:52.025+10:00React - Error with create-react-app in Windows Environments - "Error: EEXIST: file already exists, mkdir 'C:\Users\XXXXX" - Fix/Solution<p>I've been asked this a more than once - so thought it prudent to document the current recommended workaround for this issue. While it is possible to install react apps globally to work around the error, it is not recommended per <a href="https://create-react-app.dev/docs/getting-started/">https://create-react-app.dev/docs/getting-started/</a> <br /><br /><i><span style="color: red;">"If you've previously installed create-react-app globally via npm install -g create-react-app, we recommend you uninstall the package using npm uninstall -g create-react-app or yarn global remove create-react-app to ensure that npx always uses the latest version."</span></i></p><p><b>Preconditions:</b></p><p></p><ul style="text-align: left;"><li>The windows user name has spaces in it (e.g. c:\User\<b>David Klein</b>)</li></ul><p></p><p><b>Steps to reproduce error/issue:</b><br /></p><ol style="text-align: left;"><li>User attempts to create react app with npx in a Windows environment:<br /><i><b>npx create-react-app my-app</b></i></li><li>Error is generated:<br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheFcWQ3lIgkB8dWK6Cwvk7ztJAXoq5L9qDOiROEJVEl6hGK2So3GLhzq0nf5kB7cXPp9wPj0mtVpiNIsKRgF4waGzHz0Ta9XuUX9z-reTABBO6QjT2yoVqFNxWiHWDNeVHthc0GHKbBJE/" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="58" data-original-width="468" height="40" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheFcWQ3lIgkB8dWK6Cwvk7ztJAXoq5L9qDOiROEJVEl6hGK2So3GLhzq0nf5kB7cXPp9wPj0mtVpiNIsKRgF4waGzHz0Ta9XuUX9z-reTABBO6QjT2yoVqFNxWiHWDNeVHthc0GHKbBJE/" width="320" /></a></div></li></ol><b>Diagnostics:</b><br /><ol style="text-align: left;"><li>Seems that the <b>npm cache path </b>will consequently have a space in the path and npm (or more likely <i><b>create-react-app)</b></i> can't handle this.</li></ol><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFMbAvortOTPQ8Say5IovwQWrUZPurdnBymgfarkEZsPeUs8JKXxwfnIHiO5d8ZVUMhVMfUgxL-4z0WvxsKXKgnhPEsXPFtu6Gi4Y7sC1X6HdWKl_94ogjzRO44y2WKUHAW4WMHIhgIjE/" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="467" data-original-width="534" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFMbAvortOTPQ8Say5IovwQWrUZPurdnBymgfarkEZsPeUs8JKXxwfnIHiO5d8ZVUMhVMfUgxL-4z0WvxsKXKgnhPEsXPFtu6Gi4Y7sC1X6HdWKl_94ogjzRO44y2WKUHAW4WMHIhgIjE/" width="274" /></a></div><br /><b>Solution (until bug is fixed):</b></div><div><ol style="text-align: left;"><li>Get the current cache path with "npm config get cache"</li><li>cd to the c:\Users\ directory and run dir /x to get the short name of that folder (e.g. DAVIDK~1</li><li>Once you have the short path, set the npm cache to use that path with the following:<br /><i><b>npm config set cache c:\users\davidk~1\AppData\Roaming\npm-cache --global</b></i></li></ol></div><div><div>You should now be free to continue with your react app goodness in Windows:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLmSqz-n2liGeGFMjKg8wyjtZSJjBrJ4Dsba8rfRVi6_vjt37VnKjl3-1UyWdi31i9gTWS0wV73y-skek30L6ONA-dKtP-lx7QB06QwoCJ7PEkVfTbfrZ2TMDe8DlNdZW8gyCyBI-eZSM/" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="518" data-original-width="847" height="196" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLmSqz-n2liGeGFMjKg8wyjtZSJjBrJ4Dsba8rfRVi6_vjt37VnKjl3-1UyWdi31i9gTWS0wV73y-skek30L6ONA-dKtP-lx7QB06QwoCJ7PEkVfTbfrZ2TMDe8DlNdZW8gyCyBI-eZSM/" width="320" /></a></div><br /><br /></div><div><br /><br /><br /><p></p><p><br /></p></div></div>David Kleinhttp://www.blogger.com/profile/13657389334766989234noreply@blogger.com11tag:blogger.com,1999:blog-7130587409577087282.post-42853033394004914142021-03-22T15:10:00.007+11:002021-03-22T20:00:45.886+11:00Best Practices for Azure Multifactor Authentication (MFA)<p style="text-align: left;">When configuring Azure MFA and Conditional Access there is the potential to lock out all users from the system including the Azure Portal. As with any security control/mechanism, the costs of implementation and maintenance always need to be commensurate with the risks and costs of not implementing the control (e.g. assets at risk, reputational risk).<br /><br />With this in mind, here are some key best practices you should follow when enabling MFA:</p><p style="text-align: left;"></p><ol style="text-align: left;"><li><b>Ensure that end users are informed adequately that MFA is coming </b>as it can negatively affect the user experience and cause confusion. Microsoft provides communication templates and end user documentation for this purpose - Microsoft provides <a href="https://www.microsoft.com/en-us/download/details.aspx?id=57600 " target="_blank">communication templates</a> and <a href="https://docs.microsoft.com/en-us/azure/active-directory/user-help/security-info-setup-signin" target="_blank">user documentation</a> - per (per https://www.microsoft.com/security/blog/2020/01/15/how-to-implement-multi-factor-authentication/) </li><li><b>Always grant exclusions for every MFA policy </b>- this will ensure there is always an MFA backdoor so you don't completely lock yourself out (especially if conditional access rules apply to all apps or the Azure portal). When enabling <b>conditional access</b>, make sure exclusions are made for </li><ol><li>Administrators </li><li>Support staff.</li><li>Any trusted IPs and known IP addresses/named locations.<br /><div class="separator" style="clear: both; text-align: center;"><div class="separator" style="clear: both; text-align: center;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijCtQdFfNVoehecUl-gOiM01TPX63Livpg2FLlWMgElr3EHxWDyY60qiQZtTuQweU493FexHOPXJuzxTj5GsMClVUA_rAKeILO2KhXTiLBaK1cUu55rEnjTRmknKnO3FpKykjca5jeSRY/" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="870" data-original-width="769" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijCtQdFfNVoehecUl-gOiM01TPX63Livpg2FLlWMgElr3EHxWDyY60qiQZtTuQweU493FexHOPXJuzxTj5GsMClVUA_rAKeILO2KhXTiLBaK1cUu55rEnjTRmknKnO3FpKykjca5jeSRY/w354-h400/image.png" width="354" /></a></div><br /></div></div></li></ol><li><b>Testing </b>- Use <b>what-if </b>policies to test effective permissions when making changes.</li><li><b>Pilot changes </b>using select groups to apply and test MFA policies.</li><li><b>Don't block users who report fraud </b>as users can lock themselves out (though this is less secure there is a danger of false positives). </li><li><b>Don't use MFA portal and Conditional access at same time</b> - It's not a good idea to use MFA through the MFA control panel as well as conditional access. Disable user accounts for MFA management in the MFA portal prior to if you are using conditional access - otherwise you'll have 2 competing rulesets.</li><li><b>Use Azure Identity Protection (IdP) </b>- as good way to ensure users are forced to register MFA (MFA needs to be configured first) and to ensure MFA coverage. Also allows notifications, blocks or requires MFA when administrative accounts are logged into during high sign-in risk activities such as when seeing anomalous travel of sign-ins. </li></ol><p></p>David Kleinhttp://www.blogger.com/profile/13657389334766989234noreply@blogger.com7tag:blogger.com,1999:blog-7130587409577087282.post-27958582025243728052021-03-01T12:07:00.005+11:002021-03-01T12:13:17.491+11:00CalDigit TS3 Plus Thunderbolt 3 Docking Station - Issues with Windows 10 USB Devices<p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXLYN-5vqaW0wnZkJAOV178cvb5VW8XMk8mfkakbVJrIuX2jcPm4yccAGx6IB2RyxF2gXkBLxvwmaAtb2y0_p2fXF6sdi-t7-d40i8YpjuSfFy_EEt8-cFHR_o3Klt08gREXFvQGOe7Gw/s450/TS3-Plus_both_December-12-2018_700px-ofzyuvem22vfh2cbsanjm5zsqactfjkzhg461i0xkw.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em; text-align: center;"><img border="0" data-original-height="450" data-original-width="450" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXLYN-5vqaW0wnZkJAOV178cvb5VW8XMk8mfkakbVJrIuX2jcPm4yccAGx6IB2RyxF2gXkBLxvwmaAtb2y0_p2fXF6sdi-t7-d40i8YpjuSfFy_EEt8-cFHR_o3Klt08gREXFvQGOe7Gw/s320/TS3-Plus_both_December-12-2018_700px-ofzyuvem22vfh2cbsanjm5zsqactfjkzhg461i0xkw.jpg" /></a><b>Background:</b><br />I've been having a few USB connection and power issues with the CalDigit TS3 Plus Docking Station (even after the January 2021 version 44.1 firmware update from CalDigit themselves). This is especially the case when I power up the laptop separately from the dock and then plug it in whilst still on.<br /><br /><b>The Problem:<br /></b>The display adapters would work - but USB connectivity and audio was failing - even after plugging and unplugging USB and associated devices and powering down the hub. All USB devices wouldn't even power up when the issue was in effect.<br /><br /><b>Discovery/Resolution Steps:</b> <br />The only thing that would fix it (most of the time) was a full power down restart.<br /><br />Looking at Device Manager - I was getting a Code 31 saying that the "Object Name Already Exists". In the Device Event history, the following error kept appearing:<br /><br /><span style="color: red;">Device
PCI\VEN_1B73&DEV_1100&SUBSYS_11061AB6&REV_10\8&1b6ac812&0&0000000800E0
was not migrated due to partial or ambiguous match.</span></p><p class="MsoNormal"><o:p></o:p></p><p>Uninstalling and reinstalling these Generic USB Host Controllers "USB xHCI Compliant Host Controller" didn't work.<br /></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjepp6Kv-WxBs6Xbv75-r2MutFGI6atDGagIbpOuvIp4ZAEnsqqGNbXykvKVnStme-dMrd9fszzm8zFctnfJUv4Mgjt2SZJUr-iwuuZc2_wXcOpN3uD6-2UBgyGcSdVPY53DOh-syyn5ao/" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="505" data-original-width="441" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjepp6Kv-WxBs6Xbv75-r2MutFGI6atDGagIbpOuvIp4ZAEnsqqGNbXykvKVnStme-dMrd9fszzm8zFctnfJUv4Mgjt2SZJUr-iwuuZc2_wXcOpN3uD6-2UBgyGcSdVPY53DOh-syyn5ao/w350-h400/image.png" width="350" /></a></div><br />There is a teardown video of this dock with details of all the chips/controllers inside that gave me an idea - <a href="https://www.youtube.com/watch?v=8f6Zs1JyZBQ">https://www.youtube.com/watch?v=8f6Zs1JyZBQ</a>. Looking up the Vendor and Device details in the red error above, it seems that the USB Controller Chip used in the CalDigit docking station is the <b>Fresco Logic xHCI 1100 (USB3) Controller.</b><br /><br />After a short search I found the following device driver page for that company to try (rather than the Generic Microsoft xHCI Host Controller driver) - <a href="https://support.frescologic.com/portal/en/kb/articles/latest-drivers">https://support.frescologic.com/portal/en/kb/articles/latest-drivers</a> <br /><br />Once I installed this, the device was correctly recognised in Windows and no reboot required. It has worked without issue post installation of the Fresco driver (fingers crossed!). I believe that this Fresco Driver installation should go on the CalDigit support page to resolve this issue as the default Generic Drivers seem to have problems.<p></p>David Kleinhttp://www.blogger.com/profile/13657389334766989234noreply@blogger.com1tag:blogger.com,1999:blog-7130587409577087282.post-45868082496744317702020-06-11T12:54:00.002+10:002020-06-11T12:57:30.511+10:00APRA CPS 234 - Summary of Security Compliance Requirements<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLh5h6ES14nBB8eBcKk-59-6VivkeninxQ9U4bYxOoUatsaH1q8xeDLE9G_BM6Jp4sRemeiff523bk2fHHhBVTxGqEw5Gv66lpg09T8rHTWtF5V6Gc96-CncF9M8OPwAYL99kqsceqnJY/s1600/APRACPS234.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="286" data-original-width="891" height="203" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLh5h6ES14nBB8eBcKk-59-6VivkeninxQ9U4bYxOoUatsaH1q8xeDLE9G_BM6Jp4sRemeiff523bk2fHHhBVTxGqEw5Gv66lpg09T8rHTWtF5V6Gc96-CncF9M8OPwAYL99kqsceqnJY/s640/APRACPS234.png" width="640" /></a></div>
<span style="font-family: "calibri"; font-size: 11pt;"><br />In my work with NTT, I've
recently been dealing with several FSI-based (Financial Services Industry)
organisations who have to comply with the </span><a href="https://www.apra.gov.au/sites/default/files/cps_234_july_2019_for_public_release.pdf" style="font-family: Calibri; font-size: 11pt;"><span style="font-size: 11pt;">Australian Prudential Regulation Authority (APRA)
Standard CPS 234 July 2019</span></a><span style="font-family: "calibri"; font-size: 11pt;">. Here's a brief overview of what that compliance with
CPS 234 entails:</span><br />
<ol style="direction: ltr; font-family: Calibri; font-size: 11pt; font-style: normal; margin-bottom: 0in; margin-left: 0.375in; margin-top: 0in; unicode-bidi: embed;" type="1">
<li style="font-weight: normal;"><span style="font-family: "calibri"; font-size: 11pt;">APRA CPS 234 is
Cybersecurity 101 for Banks, Insurers and related institutions.</span></li>
<li style="font-weight: normal; margin-bottom: 0px; margin-top: 0px; vertical-align: middle;"><span style="font-size: 11pt;">As with standards like ISO27001:2013, it is a </span><span style="font-size: 11pt; font-weight: bold;">risk-based</span><span style="font-size: 11pt;"> approach about ensuring that adequate CIA (Confidentiality, Integrity and Availability) is maintained for information assets.</span></li>
<li style="font-weight: normal; margin-bottom: 0px; margin-top: 0px; vertical-align: middle;"><span style="font-size: 11pt;">The </span><span style="font-size: 11pt; font-weight: bold;">Board</span><span style="font-size: 11pt;"> is ultimately responsible for ensuring appropriately robust policies and controls are in place for both the organisation and 3rd party contractors.</span></li>
<li style="font-weight: normal; margin-bottom: 0px; margin-top: 0px; vertical-align: middle;"><span style="font-size: 11pt;">Per basic concepts in CISSP (Certified Information Systems Security Professional), controls should really only be implemented if the cost of control implementation is less than the costs of the data being lost/breached.</span></li>
<li style="font-weight: normal; margin-bottom: 0px; margin-top: 0px; vertical-align: middle;"><span style="font-size: 11pt;">To this effect - the information security capability basically has to pass the "reasonableness" test</span></li>
<ol style="direction: ltr; font-size: 11pt; font-weight: bold; margin-bottom: 0in; margin-left: 0.375in; margin-top: 0in; unicode-bidi: embed;" type="i">
<li style="margin-bottom: 0px; margin-top: 0px; vertical-align: middle;" value="1"><span style="font-size: 11pt;">The security capability should match the size and extent of threats</span></li>
<li style="margin-bottom: 0px; margin-top: 0px; vertical-align: middle;"><span style="font-size: 11pt;">The controls should match criticality and sensitivity of the assets</span></li>
</ol>
<li style="font-weight: normal; margin-bottom: 0px; margin-top: 0px; vertical-align: middle;"><span style="font-size: 11pt;">CPS 234 aims to ensure that an APRA-regulated entity takes measures to be resilient against information security incidents (including cyberattacks) by maintaining an information security capability commensurate with information security vulnerabilities and threats:</span></li>
<ul>
<li style="font-weight: normal; margin-bottom: 0px; margin-top: 0px; vertical-align: middle;" value="1"><span style="font-size: 11pt; font-weight: bold;">Know your responsibilities (</span><span style="font-size: 11pt;">The board is ultimately responsible).</span></li>
<li style="margin-bottom: 0px; margin-top: 0px; vertical-align: middle;" value="1"><b>Know what you have and protect it appropriately.</b><span style="font-size: 11pt; font-weight: normal;"> An APRA-regulated entity must </span><span style="font-size: 11pt; font-weight: bold;">classify its information assets</span><span style="font-size: 11pt; font-weight: normal;">, including those managed by related parties and third parties, by criticality and sensitivity.</span></li>
<ul>
<li style="margin-bottom: 0px; margin-top: 0px; vertical-align: middle;" value="1">Ideally - should be using Azure Info protection or similar to provide security labels (e.g. classification, sensitivity or dissemination limiting markers) to drive preventative and detective controls.<span style="font-size: 11pt;"> </span></li>
</ul>
<ol style="direction: ltr; font-size: 11pt; font-weight: bold; margin-bottom: 0in; margin-left: 0.375in; margin-top: 0in; unicode-bidi: embed;" type="i"></ol>
<li style="font-weight: bold; margin-bottom: 0px; margin-top: 0px; vertical-align: middle;" value="3"><span style="font-size: 11pt;">Detect and React appropriately:</span></li>
<ul>
<li style="margin-bottom: 0px; margin-top: 0px; vertical-align: middle;" value="1"><span style="font-size: 11pt;">Have Incident Plans and RACIs (Responsible, Accountable, Consult, Inform) in terms of response</span></li>
<li style="margin-bottom: 0px; margin-top: 0px; vertical-align: middle;"><span style="font-size: 11pt;">Appropriately skilled people to detect incidents. </span>This requires user awareness and security practices.</li>
<li style="margin-bottom: 0px; margin-top: 0px; vertical-align: middle;"><span style="font-size: 11pt;">Notification of breach within 72 hours.</span></li>
<ul>
<li style="margin-bottom: 0px; margin-top: 0px; vertical-align: middle;" value="1"><span style="font-size: 11pt;">Implies that proper threat detection (pro-active) and monitoring systems should be in place. If you don't know it's happening then you can't comply.</span></li>
</ul>
</ul>
<li><span style="font-size: 11pt; font-weight: bold;">Test and Audit Regularly</span><span style="font-size: 11pt;">. Must test effectiveness of controls with a </span><span style="font-size: 11pt; font-weight: bold;">systematic testing program - that is run at least annually.</span></li>
<ul><ul>
<li style="margin-bottom: 0px; margin-top: 0px; vertical-align: middle;" value="1"><span style="font-size: 11pt;">This lends itself to regular, automated (static/dynamic) testing.</span></li>
</ul>
</ul>
</ul>
</ol>
<br />
<span style="font-family: "calibri"; font-size: 11pt;">It is always critical to keep in mind that threats come from both threat actors inside (insider threat)
and outside the organisation (organised or individual actors) - which lends
itself to zero trust approaches to cybersecurity.</span><br />
<br />
<br />David Kleinhttp://www.blogger.com/profile/13657389334766989234noreply@blogger.com8tag:blogger.com,1999:blog-7130587409577087282.post-76632839655404161662020-03-09T23:08:00.003+11:002020-04-01T15:14:45.871+11:00NIST 800-207 - What is Zero Trust Architecture (ZTA) and Why Has It Become Important? (aka the X-Files - Trust No One)One of the primary concerns, when operating in cloud environments and accessing resources over the internet, is cybersecurity. Traditional firewalls and edge-approaches to security no longer align with how we use technology. <br />
<br />
This has given rise to the recent release of the <b>National Institute of Standards and Technology (NIST) 800-207</b> security draft <a href="https://csrc.nist.gov/publications/detail/sp/800-207/draft">https://csrc.nist.gov/publications/detail/sp/800-207/draft</a>. The release of this document has highlighted the prominence that has come to the Zero Trust approach to network security. Zero trust is a necessary security model that has arisen due to evolving user and mobility expectations and the rise of different software and infrastructure delivery models such as the cloud.<br />
<br />
Bodies of knowledge such as NIST and CISSP recommend a <b>layered approach to security </b>(also known as "<b>defence in depth</b>" and "<b>Segmentation/Micro-segmentation</b>") - Zero Trust Architecture is a type of layered approach which will protect the confidentiality, integrity and availability of your information. This includes not just servers and devices but also protecting at the application/microservice (e.g. with JSON Web Tokens) and user levels.<br />
<br />
<b>What is Zero Trust Security?</b><br />
<b><br /></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiA-YMf1q7CmDDfg6LEYnq5yyA88yDpdB6x7PK4x-lPFM7O4oYIgUzIxXNHn0h0805A1AhHLRrClH1B5eJusQKwg1G6xolO3C_bI7-8W04OgNc7Wt95oVl6YhTEsGav9I7uzrf7TYOoG4c/s1600/TrustNoOne.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1000" data-original-width="1000" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiA-YMf1q7CmDDfg6LEYnq5yyA88yDpdB6x7PK4x-lPFM7O4oYIgUzIxXNHn0h0805A1AhHLRrClH1B5eJusQKwg1G6xolO3C_bI7-8W04OgNc7Wt95oVl6YhTEsGav9I7uzrf7TYOoG4c/s320/TrustNoOne.jpg" width="320" /></a></div>
<ul>
<li>Zero Trust follows the motto of the X-Files - "Trust No One". Regardless of whether the traffic is from internal or external sources - access is <b>regularly </b>scrutinized, verified, validated and processed in the same way. </li>
<li>Zero Trust assumes that there is no implicit trust based on a user's or resource's location (e.g. intranet or intranet). Normal perimeter or edge-based security approaches segment the network this way in a static way based on location, subnets and IP ranges.</li>
<li>A useful analogy that is often used is the <b>Castle versus the Hotel Model</b>. Once inside a castle, a device or user has great lateral freedom. In a hotel, each room requires a key and is checked on entry to different rooms (representing applications and/or systems). </li>
<li>Zero trust security focuses more on protecting the resources and users both inside and outside those network boundaries. It includes <b>Establishing Trust </b>(e.g. do I trust a jail-broken/unpatched/unencrypted/unsecured/unrecognized device with all of its ports open?), <b>Enforcing Access </b>and <b>Continuously verifying </b>the trust. It also includes continuous monitoring to detect anomalies. It is a combination of technologies and methods of protection.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1btjrETN6PLCVhaMRwGsr7fY3JIwk7MiSBI5UFowMutyhhPQzNW2wmXK08MjQjyf9F48RaNqA5PCDX_d0_ZTdewsLRq5LYDj2rSVgVHY8oVlcIBfjRE1B0kq0k5nhitLWHsoOXGNRavQ/s1600/ZeroTrust.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" data-original-height="1019" data-original-width="1181" height="343" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1btjrETN6PLCVhaMRwGsr7fY3JIwk7MiSBI5UFowMutyhhPQzNW2wmXK08MjQjyf9F48RaNqA5PCDX_d0_ZTdewsLRq5LYDj2rSVgVHY8oVlcIBfjRE1B0kq0k5nhitLWHsoOXGNRavQ/s400/ZeroTrust.png" width="400" /></a></li>
<li>Zero Trust is a more granular and flexible approach to securing resources reflective of the reality of modern workplaces. </li>
<li>Zero Trust typically uses the following parameters and checks <b>in combination </b>to determine policy-based access to resources:</li>
<ul>
<li>User Identity</li>
<li>Device (including assurance services, Mobile Device Management Flags - identifying <b>patch levels </b>to establish device-level trust or vulnerabilities)</li>
<li>Location</li>
<li>Session Risk (such as anomalous/unusual access behaviors or times)</li>
</ul>
</ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgI_eD6Cb6xJJ1-Ojr-gSxk6mUP6TjRQiOTHDx-2JouT2ppmg-jKfLwMUt7vpNrMoP8JOprSYnVKcPgR3nH6AV72cyeFcavqTgQPwxMEbde_jZeo3Um02bTjbTph60BVQTGzCZJ01SrJaM/s1600/ZeroTrustAccess.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="773" data-original-width="676" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgI_eD6Cb6xJJ1-Ojr-gSxk6mUP6TjRQiOTHDx-2JouT2ppmg-jKfLwMUt7vpNrMoP8JOprSYnVKcPgR3nH6AV72cyeFcavqTgQPwxMEbde_jZeo3Um02bTjbTph60BVQTGzCZJ01SrJaM/s640/ZeroTrustAccess.png" width="556" /></a></div>
<br />
<b>Why has it become important?</b><br />
<br />
<ul>
<li>The rise of working from home, remote users, and Bring Your Own Devices (BYOD) and cloud-based services (e.g. Salesforce, Office 365, Microsoft Teams and other AWS, Azure and GCP-based applications) have led to resources and users being located outside traditional network boundaries. </li>
<li>Consequently, authentication and authorization cannot be assumed to be valid just because of the source location of a request - credentials and associated tokens need to be validated independently of location. </li>
<li>Zero Trust is also required because of greater awareness of the "Insider Threat" from contractors and employees - through negligence or malicious intent.</li>
<li>As part of the Zero Trust mindset - there are also greater requirements around monitoring, logging and auditing activities as part of due diligence when complying with legal obligations (e.g. Australian Prudential Regulation Laws such as APRA Prudential Standard CPS 234). It is not good enough just to log external activities - internal activities need to be monitored as well. </li>
</ul>
<div>
<br /></div>
<b>Why is it difficult?</b><br />
<br />
<ul>
<li>Zero Trust requires a much better understanding of the assets and resources that need protection and the behavior of the users consuming and accessing those resources. </li>
<li>Phenomena such as "Shadow IT" also introduce problems because they are not visible and so Zero Trust approaches may actually exclude previously functioning devices from resource access. </li>
<li>Zero Trust requires the creation of more refined corporate and technical policies to handle the more granular resource-based approach to accessing your critical corporate systems.</li>
<li>Zero Trust requires much more intensive logging and scrutiny of user activity. This typically necessitates AI other anomaly detection mechanisms (e.g. out of hours access alerts).</li>
</ul>
<div>
<br /></div>
<div>
<br /></div>
David Kleinhttp://www.blogger.com/profile/13657389334766989234noreply@blogger.com15tag:blogger.com,1999:blog-7130587409577087282.post-22617268350131556912020-02-29T21:37:00.002+11:002020-03-05T14:01:31.863+11:00Basic Guidelines for Product Offering Go/No-Go Decisions (Including Product Fit/Market Fit)I've worked for Software/IT Consulting companies, Product Development Companies and System/Service Integration companies along my career path. Most recently I've noticed that some of the basic decision making around what products and service offerings that should be developed have missed some critical gateways that resulted in full or partial product failure (i.e. it doesn't make a good return on investment or ever turn a profit).<br />
<br />
Often, component licensing costs are ignored or forgotten or the actual pricing is something that the market cannot bear. Sometimes this is due to lack of multi-tenancy support so the product offering economics are not scalable.<br />
<br />
Licensing and subscription costs may go down over time (esp with AWS and Azure services becoming gradually cheaper as they reach greater economies of scale and proportional levels of competition). However, this may not happen quickly enough over the product lifetime to deliver profitability. In this case service offerings/products need to be "end-of-lifed" ("EOL'd") or migrated to new platforms and using components with lower cost structures.<br />
<br />
Going back to basics, I put this diagram together to outline some key principles of product offer development which should be considered as gateways when deciding to bring a product to market.<br />
<br />
What makes a product worthwhile? It starts with being something customers want to buy (and buy enough of). If you find this sweet spot, then you have product/market fit - which means you're no longer pushing your product onto customers. You also need to have a clear vision - otherwise delivery will be problematic when building your product out. There are many articles on product and market fit available - these are just some of my ideas that resonate based on recent experience.<br />
<br />
In particular, critical profitability constraints can be forgotten when that "cool new tech" comes out or "everyone else is doing this in the market":<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHMtyYktMuEV7hg8X8trF-d2XPICF4Ka5sWBLq2YwIP_APFaKv7AvRtpGlljijNUF0txGX_poPPPirQE2yovFNZ6nnfBdW8Otemo_7-2z26LA52FjrY7OZbegZHt8J35a7DcXk_CR7CaI/s1600/Picture5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="598" data-original-width="1411" height="270" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHMtyYktMuEV7hg8X8trF-d2XPICF4Ka5sWBLq2YwIP_APFaKv7AvRtpGlljijNUF0txGX_poPPPirQE2yovFNZ6nnfBdW8Otemo_7-2z26LA52FjrY7OZbegZHt8J35a7DcXk_CR7CaI/s640/Picture5.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
What is clear is that product-market fit is an ideal - but not a sufficient indicator of whether a product should go to market. There are other factors to be considered including cost structures and viability of ongoing product development and marketing to maintain that fit, customer value and (hopefully) margins. </div>
<br />
<br />David Kleinhttp://www.blogger.com/profile/13657389334766989234noreply@blogger.com2tag:blogger.com,1999:blog-7130587409577087282.post-71598933299795242022019-06-07T16:41:00.000+10:002019-06-11T15:06:03.396+10:00List of Azure Region Codes for Azure 2019 DevOps Migration Tool (and TFSMigrator Tool)Whilst using the Azure DevOps 2019 migration tool to move from an on-premise DevOps server to the cloud, you will be required to enter the desired destination region. Below is a list of all the valid entries as at June 2019:<br />
<br />
CC = Central Canada<br />
WEU = Western Europe<br />
EA = East Asia<br />
EAU = East Australia<br />
CUS = Central US<br />
MA = South India<br />
SBR = South Brazil<br />
WCUS = West Central US<br />
UKS = UK South<br />
EUS = East US<br />
NCUS = North Central US<br />
SCUS = South Central US<br />
WUS2 = West US 2<br />
GH = ?<br />
EUS2 = East US 2<br />
<br />
These values appear to come from the server and are not embedded in the tool - otherwise I'd be able to use Reflection to get more information! These region codes seem to be undocumented by Microsoft at present.<br />
<br />
[Update - documentation has some more details - but doesn't cover off all available Region options - <a href="https://docs.microsoft.com/en-us/azure/devops/migrate/migration-import?view=azure-devops#supported-azure-regions-for-import">https://docs.microsoft.com/en-us/azure/devops/migrate/migration-import?view=azure-devops#supported-azure-regions-for-import</a>)]David Kleinhttp://www.blogger.com/profile/13657389334766989234noreply@blogger.com33tag:blogger.com,1999:blog-7130587409577087282.post-45229511040307601142019-06-07T14:06:00.001+10:002019-06-07T14:06:32.677+10:00Deleting Azure Active Directory Tenant – Unable to delete all Enterprise Applications - Can't Delete Azure DevOps from within User InterfaceEncountered an issue today with removal of an Azure AD Tenant that is no longer used. When attempting to delete the Azure AD Directory - I simply received warnings that I had to "Delete All Enterprise Applications" - with a warning status indicator. <br /><br />When I tried to remove the single Azure Enterprise Application (Azure DevOps) - the Delete button was disabled. As you could imagine - this put me in a bit of a pickle!<br /><br />The fix that worked for me is as follows:<br /><br />
1. Create a new Global Admin account in the Azure Active Directory you are trying to delete. Make sure you copy the temporary password as you'll need to log in with it.<br />
<br />
2. To ensure you have the Azure AD Powershell extensions, Start Powershell and run: <br /><b>Install-Module -Name AzureAD</b><br />
<br />
3. Once done run <b>Connect-AzureAD.</b> You will be prompted to login. Login with the user you created and will be asked to change your password.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIDOwxJ-cCIEctdkkm3Ayf4Y20JnDBgBOiEH9ITLTtcsgRXyJZmi8qfZyVLVnruerBdnjec85qhkBjw1J7Nmkd3ELXJNypR5j3Yf4gufVoVaO3V8HMkO3Mi8Fr7zT5nqTYuw1qMgcHw1A/s1600/RemoveApplications.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="485" data-original-width="858" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIDOwxJ-cCIEctdkkm3Ayf4Y20JnDBgBOiEH9ITLTtcsgRXyJZmi8qfZyVLVnruerBdnjec85qhkBjw1J7Nmkd3ELXJNypR5j3Yf4gufVoVaO3V8HMkO3Mi8Fr7zT5nqTYuw1qMgcHw1A/s320/RemoveApplications.PNG" width="320" /></a></div>
<br />4. Run<br /><b>Get-AzureADServicePrincipal</b>to retrieve the Object Id of the Enterprise Application that you can't delete.<br />
<br />
5. Run<br /><b>Remove-AzureADServicePrincipal -objectid [enter objectid here]</b> directly.<br />
<br />
6. Remove your temporary user.<br />
<br />
You should now be able to delete your Azure Active Directory (Azure AD) Tenant instance.<br />
<br />
Source: <a href="https://blogs.msdn.microsoft.com/kennethteo/2017/09/19/deleting-azure-ad-tenant/">https://blogs.msdn.microsoft.com/kennethteo/2017/09/19/deleting-azure-ad-tenant/</a>David Kleinhttp://www.blogger.com/profile/13657389334766989234noreply@blogger.com5tag:blogger.com,1999:blog-7130587409577087282.post-28420096141380146862018-06-13T12:24:00.002+10:002018-06-13T12:25:35.742+10:00Forcing Synchronization of Display Name and Email from Active Directory without User Profile Synchronization - PowerShell ScriptJust made this script to Synchronize Display Name and Email for all users in a root web if they have been updated in AD and aren't flowing through to your display name in SharePoint. This may be required if the user profile service is not set up or is failing. This problem is discussed in more detail at <span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Consolas; font-size: 13.33px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: pre; word-spacing: 0px;">https://gallery.technet.microsoft.com/office/User-Information-List-in-8b420e8c</span><br />
<b></b><i></i><u></u><sub></sub><sup></sup><strike></strike><br />
<pre class="csharp" name="code">Add-PSSnapin "Microsoft.SharePoint.PowerShell"
#As discussed in https://gallery.technet.microsoft.com/office/User-Information-List-in-8b420e8c
Write-Host -ForegroundColor Yellow "-------------------Process Start---------------------------------------------------------------"
Write-Host -ForegroundColor Yellow "This script will sync the AD display name and email from AD without running a user profile sync"
Write-Host -ForegroundColor Yellow "As discussed in https://gallery.technet.microsoft.com/office/User-Information-List-in-8b420e8c"
Write-Host -ForegroundColor Yellow "-------------------Process Start---------------------------------------------------------------"
$stopWatch = [Diagnostics.Stopwatch]::StartNew()
$rootWeb = Get-SPWeb "https://demo01.berkeleyit.com/"
ForEach ($user in $rootWeb.AllUsers)
{
Write-Host -ForegroundColor Green "Syncing Email and DisplayName with Active Directory... for $user"
Set-SPUser -Web $rootWeb -identity $user.UserLogin -SyncFromAD
}
$stopWatch.Stop()
$timeTaken = $stopWatch.Elapsed
Write-Host -ForegroundColor Yellow "-------------------Process Completed in $timeTaken second(s)------------------"
</pre>
David Kleinhttp://www.blogger.com/profile/13657389334766989234noreply@blogger.com4tag:blogger.com,1999:blog-7130587409577087282.post-33386793079229873932018-03-28T16:34:00.001+11:002018-03-29T12:44:51.141+11:00TypeScript - Importing jQuery TypeScript Definitions (d.ts) for Visual Studio 2017 <div style="border-image: none;">
<div style="border-image: none;">
<div style="border-image: none;">
TypeScript is building in popularity and JQuery is remains one of the most popular JavaScript frameworks. Consequently you will typically want to use them together in the same project at one stage or another.<br />
If you do want to use JQuery within your TypeScript files in Visual Studio 2017, you need a "DefinitelyTyped" definition specifically for jQuery. This will allow Visual Studio to correctly recognise jQuery objects when validating and compiling (or transpiling based on your preferred terminology).</div>
</div>
</div>
<div style="border-image: none;">
<div style="border-image: none;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpjp4309kQ3X5o-ixVGGGeS7RYS9sncVjQHuZkNbk2P5fG-9eq_rC9niPyys2eaBu7bJ-bsVbSXDUFvvP0C7Q5X8tKKGjUtpsZUOUtJFHAbuMocZRqBowQr-HDzyaz3owPQJ8Zy20RoHo/s1600/NugetTypeScript.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="484" data-original-width="1600" height="192" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpjp4309kQ3X5o-ixVGGGeS7RYS9sncVjQHuZkNbk2P5fG-9eq_rC9niPyys2eaBu7bJ-bsVbSXDUFvvP0C7Q5X8tKKGjUtpsZUOUtJFHAbuMocZRqBowQr-HDzyaz3owPQJ8Zy20RoHo/s640/NugetTypeScript.png" width="640" /></a><br />
<br />
<div style="border-image: none;">
To do this, just download the TypeScript definitions (d.ts) for jQuery through the Nuget Package Manager (npm) UI or with the Nuget package manager console, use the following command:<br />
<br />
<strong><em>Install-Package jquery.TypeScript.DefinitelyTyped</em></strong></div>
</div>
</div>
<div style="border-image: none;">
<br /></div>
<div style="border-image: none;">
<div style="border-image: none;">
<div style="border-image: none;">
Now the typescript compiler will recognise your jQuery calls:</div>
<div style="border-image: none;">
<br /></div>
<div style="border-image: none;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7Oguftg3DIXe0uWSkLHg_SLXlAFbNAXaPHo1LDAuYgxUMYiJXm-fmdD5OcCrcUtGKnZa2ba_fE7A4hyphenhyphenayDtbplvd2mIS8iYWdloYAyJ-7Zn7gbokP8EJnpB_Fevpzpg2hYT_cKOOzNUw/s1600/JQuery.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="368" data-original-width="896" height="163" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7Oguftg3DIXe0uWSkLHg_SLXlAFbNAXaPHo1LDAuYgxUMYiJXm-fmdD5OcCrcUtGKnZa2ba_fE7A4hyphenhyphenayDtbplvd2mIS8iYWdloYAyJ-7Zn7gbokP8EJnpB_Fevpzpg2hYT_cKOOzNUw/s400/JQuery.png" width="400" /></a></div>
</div>
<div style="border-image: none;">
<br /></div>
</div>
</div>
<div style="border-image: none;">
<div style="border-image: none;">
DDK</div>
</div>
David Kleinhttp://www.blogger.com/profile/13657389334766989234noreply@blogger.com3tag:blogger.com,1999:blog-7130587409577087282.post-71836648624614979112017-09-01T17:30:00.001+10:002017-09-01T19:09:07.122+10:00BOSE QuietComfort 35 - How to Tell You Have a Fake set of BOSE HeadphonesI've had fake MicroSD cards sent to me previously when bought online - but the attention to detail in the <strong>fake BOSE QC35 </strong>headphones I recently received was amazing.<br />
<br />
After ordering my Bose QuietComfort 35 noise-cancelling headphones off Ebay, I was surprised how slick they looked - but the positive impression did not last. Once I plugged them in and charged them up it became painfully apparent that the electronics inside them were not up to scratch:<br />
<br />
1) They would cut out intermittently from the Bluetooth connection.<br />
2) The noise cancellation was ineffective. I've used the QC25 headphones before and it is clear when the noise cancellation is turned on and off (thinking night and day). When noise cancellation is on, it reminds me of when people go deaf (in movies like "Saving Private Ryan" or "Dunkirk") from the concussive effects of a grenade or bomb (yes they're that good!).<br />
<br />
I contacted Bose (<a class="bose-link" href="mailto:Report_Counterfeits@bose.com">Report_Counterfeits@bose.com</a>) and they confirmed that they were in fact very well done fakes and they didn't exhibit most of the superficial faults that most fakes have. In particular, the "BOSE" writing on the headphones was embossed perfectly and there was no clear marks where the ear cups had been glued together. All the serial numbers on the headphones and on the box also matched. The box, plastic and packaging was also hard to fault. <br />
<br />
The only issue was that the serial number was invalid - the number after the Z is meant to be a date.<br />
<br />
<strong>S/N:072536<span style="color: red;">Z0823</span>1568AE</strong><br />
<br />
So it seems that the most important (and most expensive components) - the internal chips and electronics - are the part you are probably paying for and the part that is hardest to reproduce accurately by the guys making the yum-cha/knock-off copies.<br />
<br />
So the simplest way to check for a fake is to attempt to register you headphones online at:<br />
<a href="https://www.bose.com.au/en_au/support/product_registration.html">https://www.bose.com.au/en_au/support/product_registration.html</a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIkiOAKdwKzyfpMgtbecsxVllewquEmTQbD9UohrA3IdWJTs4GC1ab7Xs9tqyKmjHt90TJlVdAuMBwZq1_0rgiz0kaZ0Flwi4d7zCd-W5LnEtoS3HuRIO38sUoIm-EA6yqNkf1RKas_ko/s1600/20170825_222027_2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="900" data-original-width="1600" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIkiOAKdwKzyfpMgtbecsxVllewquEmTQbD9UohrA3IdWJTs4GC1ab7Xs9tqyKmjHt90TJlVdAuMBwZq1_0rgiz0kaZ0Flwi4d7zCd-W5LnEtoS3HuRIO38sUoIm-EA6yqNkf1RKas_ko/s640/20170825_222027_2.jpg" width="640" /></a></div>
<br />
The guy I was dealing with on Ebay even tried to negotiate the refund to 30% of the original price before I told him how it is meant to work. Make sure you demand a 100% refund including the return postage cost on a fake substandard item like this. The guys at BOSE will also help you to get a refund if needs be.<br />
<br />
Hope this helps!<br />
DDKDavid Kleinhttp://www.blogger.com/profile/13657389334766989234noreply@blogger.com8tag:blogger.com,1999:blog-7130587409577087282.post-77671944696878681802017-03-13T12:47:00.002+11:002017-03-13T12:51:19.351+11:00Fix - Error in lc.exe when Compiling Solution upgraded to Visual Studio 2017 RTM from Visual Studio 2015 Upgraded our product solution today to the latest Visual Studio 2017 RTM and everything seemed to work fine - until I started getting the following error in the build:<br />
<br />
"The specified task executable "lc.exe" could not be run. The filename or extension is too long"<br />
<br />
What is this lc.exe command and why is it running? It is used by the standard .NET licensing mechanism and is maintained by Visual Studio for information about all licensed components.<br />
<br />
In my case, the error <span style="font-family: inherit;">was</span> occurring in "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets" Line 2975 according to my error log.<br />
<br />
Clearly this problem was related to the fact we are using Telerik Controls which require a licx file to compile (or so I thought).<br />
<br />
I turned on full diagnostics in Visual Studio 2017 to help get to the bottom of the issue:<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZ2hMCVHeT6nenXWsCn4r4PaomOZ0dt74F7ooNbZAN_xKtnP6aXj9Oauwn0NzTA2nnpOLIec8EVwmXItj3Uh-nvwY8Pb5eS0YQ8pRGwXx8ek0CZGxqn5V2bYoOs3CuGmMluBevlZcxo0k/s1600/DiagnosticLogging.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="191" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZ2hMCVHeT6nenXWsCn4r4PaomOZ0dt74F7ooNbZAN_xKtnP6aXj9Oauwn0NzTA2nnpOLIec8EVwmXItj3Uh-nvwY8Pb5eS0YQ8pRGwXx8ek0CZGxqn5V2bYoOs3CuGmMluBevlZcxo0k/s320/DiagnosticLogging.png" width="320" /></a></div>
<br />
<br />
This showed the full path that was being passed to lc.exe is over 42000 characters long (!):<br />
<span style="font-family: "consolas";"><span style="font-family: "consolas";"><span style="font-size: x-small;">1> C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\lc.exe /target:ESSP.ApplicationPages.dll /complist:Properties\licenses.licx /outdir:obj\Debug_SP2013\ ....[SNIP]</span><br />
<span style="font-size: x-small;"> </span><br />
</span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: "consolas";"><span style="font-family: "consolas";"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpf2tOEXqQ3FMXdbByJyfN7GwIHFoTfwajrId6ticK3Qd4_NJxBRLlRhMW9JtI0Copv-woSq4TDIVadhlsPkOvVjdyWwdgf3558xqF6vM7JfHaWp2WZXDluKUZvPe94vqSZWxlmpXYuho/s1600/DiagnosticLogging2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-size: x-small;"><img border="0" height="196" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpf2tOEXqQ3FMXdbByJyfN7GwIHFoTfwajrId6ticK3Qd4_NJxBRLlRhMW9JtI0Copv-woSq4TDIVadhlsPkOvVjdyWwdgf3558xqF6vM7JfHaWp2WZXDluKUZvPe94vqSZWxlmpXYuho/s640/DiagnosticLogging2.png" width="640" /></span></a></span></span></div>
<br />
Several places such as on Microsoft Connect - suggested that the "solution" (pardon the pun) is just to delete the licx file (also as per <a href="http://docs.telerik.com/devtools/aspnet-ajax/licensing/license-file">http://docs.telerik.com/devtools/aspnet-ajax/licensing/license-file</a>) I could then recompile without any build exceptions.<br />
<br />
This issue comes about because the lc.exe executable can only handle a parameter length of 32000 characters or less - and the full path is used for all references. Needless to say this is a restrictive limitation in the licensing mechanism!<br />
<br />
So the possible alternatives to fix this issue:<br />
1) Remove the licx file if possible when you don't need the full licensed functionality (in my case this was fine - as we don't need design mode for the Telerik controls).<br />
2) Reduce the length of your references by adding a shared drive or logical redirect to a shorter path e.g. c:\references instead of c:\src\DDK\product name\releases\ etc)<br />
3) Reduce the number of references that you have in the project that has issues with lc.exe<br />
<br />
DDKDavid Kleinhttp://www.blogger.com/profile/13657389334766989234noreply@blogger.com6tag:blogger.com,1999:blog-7130587409577087282.post-66735005974417040042016-03-23T11:44:00.002+11:002016-03-23T11:46:36.673+11:00How to identify the application pool for a worker process (Windows Server 2012 and 2012 R2 using IIS 8)Use the following command to determine which application pool maps to your w3wp.exe worker instance. This is particularly handy with SharePoint as it has 3 w3wp.exe processes running at any one time by default.<br />
<span style="color: #3d85c6;">cd %windir%\system32\inetsrv<br />
appcmd list wp</span><br />
This will give you an output similar to the following:<br />
<br />
<b>
<span style="color: #38761d;">C:\Windows\System32\inetsrv>appcmd list wp</span></b><br />
<b><span style="color: #38761d;">
WP "21192" (applicationPool:SharePoint - 80)
</span></b><br />
<b><span style="color: #38761d;">WP "12256" (applicationPool:SecurityTokenServiceApplicationPool)</span></b><br />
<span style="color: #38761d;"><b>
WP "19972" (applicationPool:5f2e9be121504641ae144bcae3b8cf6e)</b>
</span><br />
DDK
David Kleinhttp://www.blogger.com/profile/13657389334766989234noreply@blogger.com72tag:blogger.com,1999:blog-7130587409577087282.post-64880956209612303042015-09-22T19:12:00.001+10:002015-09-22T19:19:59.935+10:00Impersonation of Web Users in ASP.NET/SharePoint 2013 without a passwordThere seemed to be a lack of samples available to demonstrate how Windows impersonation can be done within the context of a web application (such as SharePoint 2013 or ASP.NET). Most of the examples use the "LogonUser" Windows API call to get a user token. e.g. <a href="https://msdn.microsoft.com/en-us/library/chf6fbt4.aspx">https://msdn.microsoft.com/en-us/library/chf6fbt4.aspx</a>. However - that call requires a password to work. You don't really want all your user passwords to have to sit in a secure store to enable impersonation!<br />
<br />
In my scenario, I had to write to a file through an existing COM Component via a .NET COM Interop library. It depended on the write operation being done from the context of a valid user - otherwise the file wouldn't be stamped correctly with author metadata. <br />
<br />
To do this, I had to use an overload of the WindowsIdentity constructor which accepts a UPN (User Principal Name). From there, you can impersonate users within your code at will.<br />
<br />
<strong>NOTE: </strong>the account that is doing the impersonation (e.g. svcSP) will need to have the <strong>"Act as Part of the Operating System" </strong>right as defined in your Local User Policy for this to work. <br />
<br />
Code Sample:<br />
<br />
<pre class="csharp" name="code">
void Main()
{
var userName = "LOCALDEV\\david.klein";
PrincipalContext ctx = new PrincipalContext(ContextType.Domain);
var user = UserPrincipal.FindByIdentity(ctx, userName);
if (user != null)
{
var upn = user.UserPrincipalName;
Debug.Print(upn);
WindowsIdentity id = new WindowsIdentity(upn);
WindowsImpersonationContext wic = id.Impersonate();
try
{
// Do what you need here under the impersonation context.
var currentId = WindowsIdentity.GetCurrent().Name;
Debug.Print(currentId);
}
finally
{
wic.Undo();
}
}
}
</pre>
David Kleinhttp://www.blogger.com/profile/13657389334766989234noreply@blogger.com61tag:blogger.com,1999:blog-7130587409577087282.post-69986099224696263402015-04-20T18:22:00.000+10:002015-04-20T18:22:03.012+10:00Microsoft Team Foundation Server 2013 Update - Error When Installing - "SQL Server Reporting Services is configured to require a secure connection."You may get the following exception when upgrading to Team Foundation Server 2013 (TFS 2013) or update packages - when you are using self-signed certificates or your SQL Report server runs unsecured (not using SSL):
<br /><br />
<span style="color: red;">TF255455: SQL Server Reporting Services is configured to require a secure connection. However, no HTTPS URL is configured with a valid certificate. Use the Reporting Services Configuration Manager to configure or remove HTTPS support. For more information see <a href="http://go.microsoft.com/fwlink/?LinkId=179982">http://go.microsoft.com/fwlink/?LinkId=179982</a>
</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgg0uzMD1E_NHdBMV7QaP4BkZKS33zVkUsGzfLIH_BIM_gYhn6yL77NthSmkhuQfsDSoSPrpg2y8unXdhd-cvFDmEA5HagDMywvHrjBG_52yutO6lccWldv7iggf2Klh-4SrR9aOiUQyNw/s1600/ErrorInstallingTFS2013Update4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgg0uzMD1E_NHdBMV7QaP4BkZKS33zVkUsGzfLIH_BIM_gYhn6yL77NthSmkhuQfsDSoSPrpg2y8unXdhd-cvFDmEA5HagDMywvHrjBG_52yutO6lccWldv7iggf2Klh-4SrR9aOiUQyNw/s1600/ErrorInstallingTFS2013Update4.png" height="300" width="400" /></a></div>
<br />
<span style="color: black;">To resolve this issue (without getting valid certificates or securing your site), you can go to your Microsoft SQL Server Reporting Services (SSRS) folder and find the <strong>rsreportserver.config</strong> file. This is typically in:<br /><br />C:\Program Files\Microsoft SQL Server\MSRSXX.<ServerInstance>\Reporting Services\ReportServer\rsreportserver.config <br /><br />Update the "SecureConnectionLevel" from 2 to 0 - and you will be able to run the update. Change it back after the update has completed.</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBOvZSXj0sgw7FhohJY241PQL-QPXGpmyj4F7xx14-y5hq-0eT9Z__egagYG9x3o17bnN2KHNovnraO3JSoLcgtibIvOhGzbcPazTXPpl0swWmpS1KX9q8lnDyzBuQFhfc1j9pyKLDXBw/s1600/ErrorInstallingTFS2013Update4-Fix.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBOvZSXj0sgw7FhohJY241PQL-QPXGpmyj4F7xx14-y5hq-0eT9Z__egagYG9x3o17bnN2KHNovnraO3JSoLcgtibIvOhGzbcPazTXPpl0swWmpS1KX9q8lnDyzBuQFhfc1j9pyKLDXBw/s1600/ErrorInstallingTFS2013Update4-Fix.png" height="340" width="640" /></a></div>
<br /><br />DDK<br />
David Kleinhttp://www.blogger.com/profile/13657389334766989234noreply@blogger.com8tag:blogger.com,1999:blog-7130587409577087282.post-82396697312830052922015-01-23T12:23:00.001+11:002015-01-23T12:30:07.665+11:00How can I easily have different app.config files for different build configurations in MSBUILD?<none include="App.config">There are a few different proposed solutions I have seen suggested, some including recommendations involving 3rd party tools and Visual Studio Transformation Extensions. The following is the simplest method I have found. It involves a violation of the DRY principle (Don't Repeat Yourself) as the app.config files are duplicated (due to the lack of transforms) - but I considered this to be a small sacrifice based on the simplicity of the solution. </none><br />
<none include="App.config"></none><br />
<none include="App.config"><strong>Steps:</strong></none><br />
<none include="App.config">1) Unload your Project file (csproj) file in Visual Studio and Right click and select "Edit {My Project Name}.csproj" on that same file to edit it.</none><br />
<none include="App.config">2) Add a folder for each MSBUILD configuration that you want and put your different App.Config files in those subfolders e.g. \Release\App.config and \Debug\App.Config</none><br />
<none include="App.config">2) Find the section in your csproj project file <None Include="App.config" /> and replace it with the following conditional Include statements for each of your MSBUILD configurations:</none><none include="App.config"><br />
</none><pre class="xml" name="code"><None Condition=" '$(Configuration)' == 'Debug' " Include="Debug\App.config" />
<None Condition=" '$(Configuration)' == 'Release' " Include="Release\App.config" /></pre>
<br />
<none include="App.config">When you build, it will use either of the application configuration files that you have created and put them in the relevant build configuration output directory.</none><br />
<none include="App.config"></none><br />
<none include="App.config">DDK</none><br />
<none include="App.config"></none><br />David Kleinhttp://www.blogger.com/profile/13657389334766989234noreply@blogger.com3tag:blogger.com,1999:blog-7130587409577087282.post-28578282774772146672014-11-17T18:37:00.001+11:002014-11-18T11:02:40.863+11:00SQL Server Database Projects and Visual Studio 2012, 2013 - Why Doesn't My DACPAC Post-Deployment Script Run?SQL Server Database Projects are a new feature from Visual Studio 2012 onwards.<br />
The SQL DACPAC format is generated by SQL Database Projects and is a Microsoft-endorsed way for deploying SQL schema changes as part of a deployment package (also known as a Data Tier Application). These can be deployed by a setup package or even a SQL Database Administrator through SQL Server Management Studio.<br />
<br />
I noticed today that every time I built my project, it would include the wrong post-deployment SQL script file inside my DACPAC - so my reference tables were not populated with data correctly.<br />
<br />
Turns out that there can only ever be one designated Post-Deployment Script in a SQL Server Database Project. I originally thought it was just a naming convention that was used to find the designated post-build file (i.e. anything named "Script.PostDeployment*.*". <br />
<br />
This was not correct - you just have to make sure it is labelled as the Post-Deployment script for that project as per the file properties below.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPu0JYT-iA7y2JFhfFzZ5qq1yGHMQOoU6GI5HzGwWpzzWe_gG4G9dXDn6bpHApjeTg_pJ1zkrcWHDYqVHpX-dUp13xTHsvEOjRfbqdavZW2mEzIfQ_EiEVBNXHI-Skozr_dW_5TfEAbrA/s1600/OnePostDeployment.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPu0JYT-iA7y2JFhfFzZ5qq1yGHMQOoU6GI5HzGwWpzzWe_gG4G9dXDn6bpHApjeTg_pJ1zkrcWHDYqVHpX-dUp13xTHsvEOjRfbqdavZW2mEzIfQ_EiEVBNXHI-Skozr_dW_5TfEAbrA/s1600/OnePostDeployment.png" height="165" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjneuHSOs2sELu6aEDKVysusRKhTUsBar3kvmVL4ZZ9e1NAm5Ba7LEe_R_IysujQpYyLu9_2sbwjiBd6MtLymJeJbB_4Gwr_-NUyzWVMLyOHJrlwUM1AN2i5r-GcPyXeq5KpGmknFxWKrA/s1600/OnePostDeployment3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjneuHSOs2sELu6aEDKVysusRKhTUsBar3kvmVL4ZZ9e1NAm5Ba7LEe_R_IysujQpYyLu9_2sbwjiBd6MtLymJeJbB_4Gwr_-NUyzWVMLyOHJrlwUM1AN2i5r-GcPyXeq5KpGmknFxWKrA/s1600/OnePostDeployment3.png" /></a></div>
<br />
As a side note, I generated the SQL MERGE statements for reference/lookup data using the dbo.sp_generate_merge tool on github: <br />
<a href="https://github.com/readyroll/generate-sql-merge">https://github.com/readyroll/generate-sql-merge</a><br />
<br />
<strong>DDK</strong>David Kleinhttp://www.blogger.com/profile/13657389334766989234noreply@blogger.com1tag:blogger.com,1999:blog-7130587409577087282.post-37224653278408247582014-05-14T21:47:00.002+10:002014-05-20T21:01:37.344+10:00China, Hong Kong and Macau Trip 2014Arrived home this week after a lengthy trip around Hong Kong, Macau and China. Went with the family including dad this time. We saw some truly jaw-dropping scenery this time round. See below.<br />
<br />
The highlights:<br />
<br />
<strong>1) China - The clouds curling around Huangshan (Yellow) Mountain and the Extremely Steep Steps.<br /><br /> </strong>Known as "Yellow Mountain" to the average guilau. It was exactly like the old Chinese watercolour paintings you see everywhere (and they obviously inspired the scenery from the movie Avatar.). The 1000s of stairs were quite punishing - and the lack of hand rails, gale-force winds and sheer drops off granite cliffs was too hair raising for my Dad (plus he had a cold) - who pulled out. <br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjTod2MMwJXqTT6Mu-vZKwR6GiKnR632fsQ6Kc8Urf_Pt36McT-tbgct3_qqUZvcj6vs5SsZqfJh80aLBWkUDZX04R61o16DXzoBhMJWSlH9QwwlxZUfjUPlhIdBBaML9XxficJfmAsqE/s1600/1_20140504_153818.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjTod2MMwJXqTT6Mu-vZKwR6GiKnR632fsQ6Kc8Urf_Pt36McT-tbgct3_qqUZvcj6vs5SsZqfJh80aLBWkUDZX04R61o16DXzoBhMJWSlH9QwwlxZUfjUPlhIdBBaML9XxficJfmAsqE/s1600/1_20140504_153818.jpg" height="360" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZek6Q_QkYJJ_Z1weY3Y0tdtWuNEdk6DjqFsEsa5QNukZhumBC9695hfEXvc30T0ZZKMyLSzeLv5erOYR6GUqkmL6xISWZxabR2BrGwEfuDb48DqvXkhZdNUbLFewXkMKPIcWw-6Cvbbc/s1600/2__20140505_083852.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZek6Q_QkYJJ_Z1weY3Y0tdtWuNEdk6DjqFsEsa5QNukZhumBC9695hfEXvc30T0ZZKMyLSzeLv5erOYR6GUqkmL6xISWZxabR2BrGwEfuDb48DqvXkhZdNUbLFewXkMKPIcWw-6Cvbbc/s1600/2__20140505_083852.jpg" height="360" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhe4YScSS9F-RR1YWo3U1qVd1L2q3QQwT7Ndk61NyCXlz3nY-UEoNcP7PIXCf-nznzDF_54fetyUChfLfmivYID7lVPjRsNZPxoedpDPiQp9r2FAdcEet6GoidYfA_xV7LOhT3aFGb6x-o/s1600/2_HuangShan2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhe4YScSS9F-RR1YWo3U1qVd1L2q3QQwT7Ndk61NyCXlz3nY-UEoNcP7PIXCf-nznzDF_54fetyUChfLfmivYID7lVPjRsNZPxoedpDPiQp9r2FAdcEet6GoidYfA_xV7LOhT3aFGb6x-o/s1600/2_HuangShan2.jpg" height="640" width="360" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRSLiLrZtMv82wYVJ5zBgkz4gy13Ko6bNVMFl39PXZo_bq6hCFATsi37SYjyH8sL5dGuFmTCKvuS2wMr4PBMlnaxvxKtgr50OXgwNdghMkPsmUhsncrEqwvBwV59SnMF57I8D5miAftBk/s1600/2_YellowMountain_HuangShan.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRSLiLrZtMv82wYVJ5zBgkz4gy13Ko6bNVMFl39PXZo_bq6hCFATsi37SYjyH8sL5dGuFmTCKvuS2wMr4PBMlnaxvxKtgr50OXgwNdghMkPsmUhsncrEqwvBwV59SnMF57I8D5miAftBk/s1600/2_YellowMountain_HuangShan.jpg" height="360" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNN8YaSTpq6SmxCzwCzaZ2JAxA2qSWL2gLn5mak0qAerxPU5NwHX5vwv3yISOpI_KJ1T8ZNZ-5afEsnm6VfcuU_3NSzz6SfATIp8Fz0eKtqETJ96AJ1HgsaMCNSGK0hSj-5_JaaoPVxSM/s1600/20140504_151002.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNN8YaSTpq6SmxCzwCzaZ2JAxA2qSWL2gLn5mak0qAerxPU5NwHX5vwv3yISOpI_KJ1T8ZNZ-5afEsnm6VfcuU_3NSzz6SfATIp8Fz0eKtqETJ96AJ1HgsaMCNSGK0hSj-5_JaaoPVxSM/s1600/20140504_151002.jpg" height="360" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgko8db4YujxI9tA706k4BKnhGo58YNUVlUqmtrCwSId0-f7HIKZON5DfVuCmCexDaPwfobUcqVOsMfO5dd5ZUXzZpG6PAyXbZfFDggkBoqltPkesK19-qZb_DIGYPFdHOc-9qehTUMHVc/s1600/20140504_152300.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgko8db4YujxI9tA706k4BKnhGo58YNUVlUqmtrCwSId0-f7HIKZON5DfVuCmCexDaPwfobUcqVOsMfO5dd5ZUXzZpG6PAyXbZfFDggkBoqltPkesK19-qZb_DIGYPFdHOc-9qehTUMHVc/s1600/20140504_152300.jpg" height="360" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqdXO0a2KjXT0PLlanMQRZdCNPaKt3J2nTCWPqc7nQ118ZM6c_N-sJ7lIB9oAzqxB8BPbGOGyeENFSH7qhyphenhyphen3nvLw_WovWzp9icLyCd2900gI4FCUUmtGha_XUm3vVEtE9oSSbhRyQ9rPU/s1600/20140504_154642.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqdXO0a2KjXT0PLlanMQRZdCNPaKt3J2nTCWPqc7nQ118ZM6c_N-sJ7lIB9oAzqxB8BPbGOGyeENFSH7qhyphenhyphen3nvLw_WovWzp9icLyCd2900gI4FCUUmtGha_XUm3vVEtE9oSSbhRyQ9rPU/s1600/20140504_154642.jpg" height="360" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKDYPlDeTDo1rDv2MWm6nW6CMsjJUKXWz_YBefAqFQkjkb8AOIFxwryus5XlPZ_fkv5rLuJfzDlQ1xVOrNF9oBnR8nbUYItvhmZszpbHd7dZT_J6lx5oeWK3vwwIMTlUBOvanCHDLZ1Uk/s1600/20140504_154856.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKDYPlDeTDo1rDv2MWm6nW6CMsjJUKXWz_YBefAqFQkjkb8AOIFxwryus5XlPZ_fkv5rLuJfzDlQ1xVOrNF9oBnR8nbUYItvhmZszpbHd7dZT_J6lx5oeWK3vwwIMTlUBOvanCHDLZ1Uk/s1600/20140504_154856.jpg" height="640" width="360" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5Ijr7_yjAXQcj3MFiqengaJ1gbTvSri7s69Lx5CtS-ptbRbtOcu4RqYg5Rlezle59JhCZZJlP2ZAw7HvswGpNTlrbRytBGio-FweQqbxSuVUn9-ihbGSEIvBKPEPfm5fR1GHDkyIeWt4/s1600/20140504_155400+(2).jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5Ijr7_yjAXQcj3MFiqengaJ1gbTvSri7s69Lx5CtS-ptbRbtOcu4RqYg5Rlezle59JhCZZJlP2ZAw7HvswGpNTlrbRytBGio-FweQqbxSuVUn9-ihbGSEIvBKPEPfm5fR1GHDkyIeWt4/s1600/20140504_155400+(2).jpg" height="360" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjz0IpUsDGajhqTn_zVBoNqLZiISpDTBAbZ1IEjcFYlrpDibmykERSEpL2J3HiSJOk6gJWCW-Accd0OJhXhiue9pKV7OJErHbDPMnlZ445Dtbo1xVl3xCN-zAB2wao2cShqif5L4gr7Kp4/s1600/20140504_161002.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjz0IpUsDGajhqTn_zVBoNqLZiISpDTBAbZ1IEjcFYlrpDibmykERSEpL2J3HiSJOk6gJWCW-Accd0OJhXhiue9pKV7OJErHbDPMnlZ445Dtbo1xVl3xCN-zAB2wao2cShqif5L4gr7Kp4/s1600/20140504_161002.jpg" height="360" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbQcF15LYjJAs8LyM3_MekUiBLtlOzu3yPCXyYu1qD1rxDPDGROrO3L9YNReFuN1oLHL7Lzfhf2b6XBvN5BbQslzZ7woC7lyaU-tr1F5GTvYevtqj-kxlTUpUIgJafGMo_gLjy_ZQQiMw/s1600/20140504_163042.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbQcF15LYjJAs8LyM3_MekUiBLtlOzu3yPCXyYu1qD1rxDPDGROrO3L9YNReFuN1oLHL7Lzfhf2b6XBvN5BbQslzZ7woC7lyaU-tr1F5GTvYevtqj-kxlTUpUIgJafGMo_gLjy_ZQQiMw/s1600/20140504_163042.jpg" height="360" width="640" /></a></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWc9LfBZDPcrqb0SwYlsfpyHKxBRVIdKNDbJ7rg7M03iLtoN-u3kEnSqf11LGY1Y518KsTXQwEfdj2lae4qPSHQfmgjH3F7iSLJwkoS5sssjP1vLvTG7epf9kiu6wXycSP4zBD-8iAA_g/s1600/2_20140504_151204.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWc9LfBZDPcrqb0SwYlsfpyHKxBRVIdKNDbJ7rg7M03iLtoN-u3kEnSqf11LGY1Y518KsTXQwEfdj2lae4qPSHQfmgjH3F7iSLJwkoS5sssjP1vLvTG7epf9kiu6wXycSP4zBD-8iAA_g/s1600/2_20140504_151204.jpg" height="360" width="640" /></a></div>
<br />
<strong>Fairy Bridge (ahem. I'm not the fairy...)</strong><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghsG5nYDSba5hHcibgolGxvNvOt8cTHAwGDfMdrCGYvnQI1ltAQE-x5y1Sze8AN1aARxLIjujWfTbsJ0cMRjGWwsOabYcrj9qBmfeXDg7s1URB3UsYQUAhqaXQxCy4P1jac_j7X8EoZUo/s1600/2_20140504_162828.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghsG5nYDSba5hHcibgolGxvNvOt8cTHAwGDfMdrCGYvnQI1ltAQE-x5y1Sze8AN1aARxLIjujWfTbsJ0cMRjGWwsOabYcrj9qBmfeXDg7s1URB3UsYQUAhqaXQxCy4P1jac_j7X8EoZUo/s1600/2_20140504_162828.jpg" height="640" width="360" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkwah5J2Dlr8kTN364lwyRwIEtkkW9ZvrOXjt5w6VkLqZGOcYVdzuoWusZmBoreQIAJ2bN-xhkhMNrlMvQZTnz0ZanWBuzdjvxC2XY2oSVkB6B4t7BnGGhbgyCgfCXX-XO6Vg_TLZfKY4/s1600/20140503_194859.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkwah5J2Dlr8kTN364lwyRwIEtkkW9ZvrOXjt5w6VkLqZGOcYVdzuoWusZmBoreQIAJ2bN-xhkhMNrlMvQZTnz0ZanWBuzdjvxC2XY2oSVkB6B4t7BnGGhbgyCgfCXX-XO6Vg_TLZfKY4/s1600/20140503_194859.jpg" height="180" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3ebd9UIteo5jWJn6ANepI1CMuOqYYvsmJ5ZJMb_qwCitIumUiiTYVDE-fDF39Vg1W6uuTDrECNdqNuR4ZVajzClKItRZt_fTe_fkS_4Eu2gvT65K2SleintU2AVXDSi6B3elToLP2nZY/s1600/20140504_152954.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3ebd9UIteo5jWJn6ANepI1CMuOqYYvsmJ5ZJMb_qwCitIumUiiTYVDE-fDF39Vg1W6uuTDrECNdqNuR4ZVajzClKItRZt_fTe_fkS_4Eu2gvT65K2SleintU2AVXDSi6B3elToLP2nZY/s1600/20140504_152954.jpg" height="180" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCMmULheTpCPF7jwT4kC8tsVnYoYJrcKsqKJvHxk36Zmmr0FPm0Ppem_SoQvDX1jBS9RpzWrugdZt-pSOm8lFIy1RT0W8yfKd_YkuEdu4HQ8lzw9yjDpQRD-3Bk46V4b2-PwmwWSDD56o/s1600/20140504_160605.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCMmULheTpCPF7jwT4kC8tsVnYoYJrcKsqKJvHxk36Zmmr0FPm0Ppem_SoQvDX1jBS9RpzWrugdZt-pSOm8lFIy1RT0W8yfKd_YkuEdu4HQ8lzw9yjDpQRD-3Bk46V4b2-PwmwWSDD56o/s1600/20140504_160605.jpg" height="320" width="180" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6eYtkr_8oK9_EpcwmqhSBrARFbqPeTAE4fijaSfbLsbb9WvpJcY5Medpd1Ib_wBt-a08K5loWLWKfUb6FpTTMz2uAbDzcaQ4ZiaebUIqWeaEa6ILFzT9b7J6KzVvLIwlog6L0lM4H_c8/s1600/20140505_080632.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6eYtkr_8oK9_EpcwmqhSBrARFbqPeTAE4fijaSfbLsbb9WvpJcY5Medpd1Ib_wBt-a08K5loWLWKfUb6FpTTMz2uAbDzcaQ4ZiaebUIqWeaEa6ILFzT9b7J6KzVvLIwlog6L0lM4H_c8/s1600/20140505_080632.jpg" height="180" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div align="left" class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: left;">
These Guys get 100 Yuan Per Container they get to the Top (10km of stairs!):</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7YMTVCrOfiZhBwyJQuynU7H_ov4HOKZs2B7Mp6M7Y5kvPD8Z-khujJrBSxdoREzMxDyTgUdCYtxph6EAv6QnomXYeQ2XeUdY4cd5lvDPgyLUOEh-gV_6KbcGD7cxSCYQPfjRR6NmuC6g/s1600/20140505_094005.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7YMTVCrOfiZhBwyJQuynU7H_ov4HOKZs2B7Mp6M7Y5kvPD8Z-khujJrBSxdoREzMxDyTgUdCYtxph6EAv6QnomXYeQ2XeUdY4cd5lvDPgyLUOEh-gV_6KbcGD7cxSCYQPfjRR6NmuC6g/s1600/20140505_094005.jpg" height="360" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjz-GiN3ImcWXgKKIw8EsjDTZjbnwx8jPA0dGuBkqiJGDkOOtdMjLIAgX2f40YjQwBl1yEaQcB-Zgb9J9Pgxh5vOkKPLJ6EEab5jWn3FJlitfsXkdebkzkDESFouN-uwk37nq6QjIfk_Z0/s1600/20140505_102803.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjz-GiN3ImcWXgKKIw8EsjDTZjbnwx8jPA0dGuBkqiJGDkOOtdMjLIAgX2f40YjQwBl1yEaQcB-Zgb9J9Pgxh5vOkKPLJ6EEab5jWn3FJlitfsXkdebkzkDESFouN-uwk37nq6QjIfk_Z0/s1600/20140505_102803.jpg" height="360" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<br />
<strong>2) China - Cycling Around Hangzhou (aka the "Most Beautiful City in China") and the West Lake </strong><br />
The whole city of Hangzhou is like a big jungle with beautiful Willows, pagodas and bridges everywhere. Probably the most livable city in China from my perspective as they take pride in how their city looks. Last time I went there, I got food poisioning so this experience was marginally better.<br />
<br />
The 7km Tea Plantation Walk Near Hangzhou<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2JqsRuUwaGpP_mcc5IHkOFi8N3Cw3WzyezEyCZpzMMxb9azun-5yIMYpu1JHxheD06Q3C7LAJA3B3Q_ysYeiWOD103fLb5LMwk5ookYe0pHxS-Ry4YWRMZEQDYUpjaHEARjyQ9QFZRi8/s1600/4_20140506_120432.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2JqsRuUwaGpP_mcc5IHkOFi8N3Cw3WzyezEyCZpzMMxb9azun-5yIMYpu1JHxheD06Q3C7LAJA3B3Q_ysYeiWOD103fLb5LMwk5ookYe0pHxS-Ry4YWRMZEQDYUpjaHEARjyQ9QFZRi8/s1600/4_20140506_120432.jpg" height="360" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDu1t40XOblfej0VJWbNzEqeQqcyDsheKdukaXnWrkCGLyRunPcV3z-OlFGd7aUOJBxzFaemfbVz6j5WWElr_LAE2uhO6Bri0Qjhm7TZJpppY3hi2cmEA7b2O8OpqJ56UUwZHSKRo-Evc/s1600/4_20140506_125456.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDu1t40XOblfej0VJWbNzEqeQqcyDsheKdukaXnWrkCGLyRunPcV3z-OlFGd7aUOJBxzFaemfbVz6j5WWElr_LAE2uhO6Bri0Qjhm7TZJpppY3hi2cmEA7b2O8OpqJ56UUwZHSKRo-Evc/s1600/4_20140506_125456.jpg" height="640" width="360" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEint0qddPinDFhw7LhhYOGOv6mgpkfTjx4BpF158I9s9I_L_mG6nuhFZUjV2aEamI_NbQ_xr86Vn9TPw4jjY_FcvM5nW9b-1DqRlvAroktOefZotuQtw07CXLgltdIcHdUaYXDHMIscyBA/s1600/4_20140507_104334.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEint0qddPinDFhw7LhhYOGOv6mgpkfTjx4BpF158I9s9I_L_mG6nuhFZUjV2aEamI_NbQ_xr86Vn9TPw4jjY_FcvM5nW9b-1DqRlvAroktOefZotuQtw07CXLgltdIcHdUaYXDHMIscyBA/s1600/4_20140507_104334.jpg" height="360" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdSwgdh5Epy7i_Xd_vfi40EEHwElZQYxwxkCSj8Nar824t-Mf1g_uHYjVqMu2nbUysNJzVyQunadtotyndQglPEQb4zZEBjfxET92qLwnOTAY5W-XRVqAZpup0qjkLNk05TTNOyR2Ds7U/s1600/4_Hangzhou.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdSwgdh5Epy7i_Xd_vfi40EEHwElZQYxwxkCSj8Nar824t-Mf1g_uHYjVqMu2nbUysNJzVyQunadtotyndQglPEQb4zZEBjfxET92qLwnOTAY5W-XRVqAZpup0qjkLNk05TTNOyR2Ds7U/s1600/4_Hangzhou.jpg" height="360" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOZ1hFpZWpGDF1MfMXdgKmG972T-cEXbd1lDb0B8DBaD6K_fxq_0Sv45oYlPphlYcRnaaWN5DQorY_vgUX4UD3wuuadTf-qHImxittZ8upiQlHK-sfl9iuOo6FFmqIhXf1vzhfs49u3O4/s1600/20140506_170548.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOZ1hFpZWpGDF1MfMXdgKmG972T-cEXbd1lDb0B8DBaD6K_fxq_0Sv45oYlPphlYcRnaaWN5DQorY_vgUX4UD3wuuadTf-qHImxittZ8upiQlHK-sfl9iuOo6FFmqIhXf1vzhfs49u3O4/s1600/20140506_170548.jpg" height="360" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiP6qkyNqX2TfOFvH5zbLw-EBXq6Vcc7qnMfF7kJA3EgRVEsE-5P70E9x02V_bmQ-ijszR8KuhFlDOlNSSuofAEo4d5B8rhYcW9WG5EWNB04AYJRb-D_Q4dOjKNDSG-0_mAPKXT01x8K2E/s1600/20140507_110723.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiP6qkyNqX2TfOFvH5zbLw-EBXq6Vcc7qnMfF7kJA3EgRVEsE-5P70E9x02V_bmQ-ijszR8KuhFlDOlNSSuofAEo4d5B8rhYcW9WG5EWNB04AYJRb-D_Q4dOjKNDSG-0_mAPKXT01x8K2E/s1600/20140507_110723.jpg" height="360" width="640" /></a></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPGEVNvXFHg3kSGDFJN0gf_WZkK-4O2s5oBb8ZlTmsMjSATPlWnE_x3eYb50fd9aN-KN4eCKIIfVC3_1RX7mWyjSc_mmWK3KmhA3E-X9KEZizzBiYrDgJGb011gIYm49AD-WidCZhlXWk/s1600/20140507_111250.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPGEVNvXFHg3kSGDFJN0gf_WZkK-4O2s5oBb8ZlTmsMjSATPlWnE_x3eYb50fd9aN-KN4eCKIIfVC3_1RX7mWyjSc_mmWK3KmhA3E-X9KEZizzBiYrDgJGb011gIYm49AD-WidCZhlXWk/s1600/20140507_111250.jpg" height="640" width="360" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVeqGudIbRh65ZPFVzIGLKq5eGh1lroTDkEpITfLGuQ4780eLqUTQPkxLDqQFbAhOcEoumxgj-UEh3BYwoeHh6SwcCGR6RumZZFqRh3bUErpoqI6Lj-Hi8n0knenEIi3H3414oKr7BZvw/s1600/20140507_115820.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVeqGudIbRh65ZPFVzIGLKq5eGh1lroTDkEpITfLGuQ4780eLqUTQPkxLDqQFbAhOcEoumxgj-UEh3BYwoeHh6SwcCGR6RumZZFqRh3bUErpoqI6Lj-Hi8n0knenEIi3H3414oKr7BZvw/s1600/20140507_115820.jpg" height="640" width="360" /></a></div>
<br />
<strong>3) China - Great Wall of China at Mutianyu and the Mega-Taboggan on the way back down </strong>Lisa and I had been to the Badaling section of the Great Wall in 2007 - but never to the less touristy section at Mutianyu. There you can actually move without a loud Chinese Tourist Operator deafening you with a megaphone in your ear and a dictatorial snarl to their voice.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijHQGoxPGmuB18uTB9Au6AyucM6TOgpBs-D5QxZvP2wLrhxg-Js9C32ckUmqCgbyH2dZWGDXsDItBMlj3mYQFGL8l9LFjIlVDoPBQQtZCStjH2K2PjagkMK0752EWwasjAgKhCSwufG7k/s1600/1_GreatWall_Motanu.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijHQGoxPGmuB18uTB9Au6AyucM6TOgpBs-D5QxZvP2wLrhxg-Js9C32ckUmqCgbyH2dZWGDXsDItBMlj3mYQFGL8l9LFjIlVDoPBQQtZCStjH2K2PjagkMK0752EWwasjAgKhCSwufG7k/s1600/1_GreatWall_Motanu.jpg" height="640" width="360" /></a></div>
<br />
Zach and Chinese 70's moustache guy<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOZv3IWrF_ZjOnpm3cKoF6ixhhQHEfHhORS9WCXocUKCtc0Y6GB5aQ1Sv-96XL5St63RwJsVeUQuAfjKIkyZa733pCgVcdPA9DZW6TghWRoeYzGFJHZIeoZaPzijtS5iW7hIXmmSKmw64/s1600/2_GreatWall.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOZv3IWrF_ZjOnpm3cKoF6ixhhQHEfHhORS9WCXocUKCtc0Y6GB5aQ1Sv-96XL5St63RwJsVeUQuAfjKIkyZa733pCgVcdPA9DZW6TghWRoeYzGFJHZIeoZaPzijtS5iW7hIXmmSKmw64/s1600/2_GreatWall.jpg" height="640" width="360" /></a></div>
<br />
Some videos of the kids mucking around on the Great Wall:<br />
<br />
a) Great wall of China Song inspired by the Wolf of Wall Street - <a href="http://youtu.be/xskGz1nrz8Q">http://youtu.be/xskGz1nrz8Q</a><br />
b) Zach and Heidi - General Horseplay - Running Up and Down the Wall - <a href="http://youtu.be/Kp7PTl0cq-M">http://youtu.be/Kp7PTl0cq-M</a><br />
<br />
<br />
<strong>4) China - Eating the Poisonous Fugu Puffer Fish and Stinky Tofu in Shanghai</strong><br />
<br />
I've eaten a lot of weird and wonderful animals in China - but never had the poisonous (and potentitally deadly) Puffer fish Fugu. Had it on the river side of Shanghai a few blocks from the Shanghai Pearl Tower. Apparently your tongue is meant to tingle from the neurotoxins - but I found it had limited effect. Well at least I didn't suffer from paralysis and rapid death like hundreds of people in Japan in the 1950s! That's why serving of it is now strictly controlled and licensed.<br />
<strong><br /> </strong><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJliCMH-wjvvDNp9ml64LiSc8VfaPHpZqPxAIVUv4pnKZ38qMUo_37nMGOXmoDy-OyoqgSUyIGO9BCapWf_1Q9YMuyZjy07lVgI66b_NH5iYo7To-0945MJmniidyzTtgVA47-tULJlaI/s1600/FuguPufferFish.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJliCMH-wjvvDNp9ml64LiSc8VfaPHpZqPxAIVUv4pnKZ38qMUo_37nMGOXmoDy-OyoqgSUyIGO9BCapWf_1Q9YMuyZjy07lVgI66b_NH5iYo7To-0945MJmniidyzTtgVA47-tULJlaI/s1600/FuguPufferFish.jpg" height="360" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: left;">
I'd also never been brave enough to eat Cho Dofu (or Stinky Tofu). I will not be doing it again - as it smells and tastes like a perverse combination if Urine and Faeces. Yummo!</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy9S1eImDH1S4YqK858APrxiArJ2vEF8VvvAuTqFRZNCox3I7iQQ07S3VIq8nFwgRuMgcCm175IYdsFgn6PwoL3Zb9cUmYbvxnJqiwz7SOBsCKE5OocSYskbn71y5rl_YxRS10MGq7Oo4/s1600/StinkyTofu.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy9S1eImDH1S4YqK858APrxiArJ2vEF8VvvAuTqFRZNCox3I7iQQ07S3VIq8nFwgRuMgcCm175IYdsFgn6PwoL3Zb9cUmYbvxnJqiwz7SOBsCKE5OocSYskbn71y5rl_YxRS10MGq7Oo4/s1600/StinkyTofu.jpg" height="320" width="240" /></a></div>
<br />
<br />
<strong>5) Macau - Touring St Pauls, and The Venetian and Galaxy Casinos. </strong><br />
<strong><br /></strong>The massive scale of the Venetian Casino and it's lifelike sky meant that: <br />
a) We regularly got lost (that's probably by design as they never want you to escape before you gamble your money away.<br />
b) We regularly experienced "The Truman Show" moments as the sky high above our heads seemed to move before your eyes if you look at it long enough - but it was just a well painted and lit ceiling.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSTnZtd5MY0-w1k-hhKmTs7XwQlumJnEppDLnhtxt6TfCA-r7Eq4ON4xLx_m2zjvoa6gfhsP3oAf1LVUTMULVX8VZNYX75TzYAD8rRqhSXbWly4-tsBRW9M804gCTa3vd3UWG6ttxUueI/s1600/20140412_153525.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSTnZtd5MY0-w1k-hhKmTs7XwQlumJnEppDLnhtxt6TfCA-r7Eq4ON4xLx_m2zjvoa6gfhsP3oAf1LVUTMULVX8VZNYX75TzYAD8rRqhSXbWly4-tsBRW9M804gCTa3vd3UWG6ttxUueI/s1600/20140412_153525.jpg" height="360" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXdhfaQMv-s8h9nWTcI-dh3C0SdS9pccBNdYJr8G9t1RfpqPCUVQZ0iVYigpc4LfFq14oXK8r49k5GHZ2SikxyDE_1K464kfWz1vU_t7wgnXYZzYQa_txav-79B9Jz5mXgjWAMdcS6zhY/s1600/20140412_154023.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXdhfaQMv-s8h9nWTcI-dh3C0SdS9pccBNdYJr8G9t1RfpqPCUVQZ0iVYigpc4LfFq14oXK8r49k5GHZ2SikxyDE_1K464kfWz1vU_t7wgnXYZzYQa_txav-79B9Jz5mXgjWAMdcS6zhY/s1600/20140412_154023.jpg" height="640" width="360" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmvphS2xgrPKjEqMQuHl4r3UxIrG4_Sc4JwTzAZccuICmECQt_gAAPx6UBD6cshciKQWeztiuWqa5A9qRZMQXGpnfrkqorIONFkr9FjKbCZs0MMnweM-iuOJt8abAhLHbaSqwQwZpZ60o/s1600/20140412_175646.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmvphS2xgrPKjEqMQuHl4r3UxIrG4_Sc4JwTzAZccuICmECQt_gAAPx6UBD6cshciKQWeztiuWqa5A9qRZMQXGpnfrkqorIONFkr9FjKbCZs0MMnweM-iuOJt8abAhLHbaSqwQwZpZ60o/s1600/20140412_175646.jpg" height="360" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnkCmRx_EZmFatQ7OY-Apveoez0jxdkH57mFLApUu4b6SHXfksSARRrs_JVtoPr4AmkI_IrntkmXV_4_9744Up8zgoL35pGfHNf49IS8jswJpXPQ3jNa704ZzrDEb-7eSlWPYRCILKoEU/s1600/20140412_181713.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnkCmRx_EZmFatQ7OY-Apveoez0jxdkH57mFLApUu4b6SHXfksSARRrs_JVtoPr4AmkI_IrntkmXV_4_9744Up8zgoL35pGfHNf49IS8jswJpXPQ3jNa704ZzrDEb-7eSlWPYRCILKoEU/s1600/20140412_181713.jpg" height="360" width="640" /></a></div>
<br />
There is a few hundred metres of canals within the Casino.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcAMuaIyEk_pFAo-zzFIOHpbQuqY_MX7AbXqJo6UZ1B49c3quhDXrHtF7AKWB6IA_OSaawWG5BcmW21v8-y2D4mVWHgn3LoVlF2XHFpPaQmqwU19iH6Vw2O8nDIpxezd5IVEtVMhLiuc8/s1600/20140412_182719.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcAMuaIyEk_pFAo-zzFIOHpbQuqY_MX7AbXqJo6UZ1B49c3quhDXrHtF7AKWB6IA_OSaawWG5BcmW21v8-y2D4mVWHgn3LoVlF2XHFpPaQmqwU19iH6Vw2O8nDIpxezd5IVEtVMhLiuc8/s1600/20140412_182719.jpg" height="640" width="360" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div align="left" class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: left;">
The lack of signs meant that we got lost a couple of times. This is Heidi having enough of walking around in circles:</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiU78Kq-M60Qp0m0HUXSUuoHjH3D8qYHDfWfCatAkoEeI2rPUbQbnFCzP5fe74tHBtf8tcMHWGfzlv6M5YOcJvrE62_VPQr_NS_z7lZoci-AVNinAr-NlDI1KD3p7Jx4vzP-pgjuTjO96w/s1600/Casino.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiU78Kq-M60Qp0m0HUXSUuoHjH3D8qYHDfWfCatAkoEeI2rPUbQbnFCzP5fe74tHBtf8tcMHWGfzlv6M5YOcJvrE62_VPQr_NS_z7lZoci-AVNinAr-NlDI1KD3p7Jx4vzP-pgjuTjO96w/s1600/Casino.jpg" height="640" width="360" /></a></div>
<br />
The Portuguese Architecture on the way to St Pauls<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeGOn3BzHe1Vgj2WOWkq1OhZo9bqNIqBImX_1U5O496PlWHONBzAlHePIrFADfoSLBw0QyES9qSZdxdZyAEkzhvFx-cRVutH0CFf0IGWGRfbRCQ7G-GSU91W05T_VVfy6RF1zPL4kLgRw/s1600/KidsAtMacau.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeGOn3BzHe1Vgj2WOWkq1OhZo9bqNIqBImX_1U5O496PlWHONBzAlHePIrFADfoSLBw0QyES9qSZdxdZyAEkzhvFx-cRVutH0CFf0IGWGRfbRCQ7G-GSU91W05T_VVfy6RF1zPL4kLgRw/s1600/KidsAtMacau.jpg" height="640" width="360" /></a></div>
<br />
<br />
6) <strong>China - Shanghai - Bar Rouge @ Bund 18 </strong>- Unfortunately missed out on the pole dancing and the "Bar on Fire" (a definite OH&S Issue and wouldn't be allowed in Australia) - on account of the weather but the view was spectacular and the Tiramisu cocktail was a winner. Most of the people in the bar had a distinctly British accent.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaY-DPWZUpchfvR-2RYxYtd9QjPeFnN8fEmlzJ0DIQ1vEUMoCh2lEnQIqy1rzNWGRfJlVaZl1xdY-VQXZVCeJblxQZkqcjnkhW2Te0XdPyzwPybLom1dzdSRxQPThxX0NUcxgJUlZZfUM/s1600/4_RougeBar_Shanghai.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaY-DPWZUpchfvR-2RYxYtd9QjPeFnN8fEmlzJ0DIQ1vEUMoCh2lEnQIqy1rzNWGRfJlVaZl1xdY-VQXZVCeJblxQZkqcjnkhW2Te0XdPyzwPybLom1dzdSRxQPThxX0NUcxgJUlZZfUM/s1600/4_RougeBar_Shanghai.jpg" height="360" width="640" /></a></div>
<br />
7) <strong>Chinglish Signs </strong><br />
<br />
Some of the Awesome examples of the obligatory "Chinglish" signs I came accross this time. These included:<br />
<br />
a) The <strong>"Chubby Lady"</strong> Fashion Store. It was not for Plus size women. "<strong>Mudd</strong>" fashion was also an inappropriate mechanism for generating interest in their clothing lines.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0SbeYL7DXWGh33zhMJdcVfk8BtAUk6v0HbjWDMvD7AM_RqMk19ZlKIq6LC6dDqD5wMgI_3hAJujnLjxmx6jAQXkPOx1zYl3QN1sldpuILtY6mnQ80Fb4d77f7xyIIlvs6oGwQYZ8hph0/s1600/20140423_183442.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0SbeYL7DXWGh33zhMJdcVfk8BtAUk6v0HbjWDMvD7AM_RqMk19ZlKIq6LC6dDqD5wMgI_3hAJujnLjxmx6jAQXkPOx1zYl3QN1sldpuILtY6mnQ80Fb4d77f7xyIIlvs6oGwQYZ8hph0/s1600/20140423_183442.jpg" height="360" width="640" /></a></div>
<br />
<br />
b) Instructions in the urinal to stand closer to avoid spillage - "<strong>One small step for forward, a big step for civilization</strong>". An interesting attempt at Chinese self-effacement - and recognition of the apalling state of urinals in China generally.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgWMLPt2T_y0XRrKaXgk4SLo3r44h19qhE_OS8j7lbV4ptjPIEgpiV8Mrm0Fek36-aXy7GzRfcqkdRj0Ra3VWy-mr-rC4w-XmAIHpCPCzBnIaW0JLdI7XolfePvrsz0bUPZ_T0upLQyek/s1600/20140415_103928.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgWMLPt2T_y0XRrKaXgk4SLo3r44h19qhE_OS8j7lbV4ptjPIEgpiV8Mrm0Fek36-aXy7GzRfcqkdRj0Ra3VWy-mr-rC4w-XmAIHpCPCzBnIaW0JLdI7XolfePvrsz0bUPZ_T0upLQyek/s1600/20140415_103928.jpg" height="360" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
c) Engraved on a steel sign, instructions that "no verminous of filthy people are allowed in the park"... and that they must not "expose or exhibit sores when begging". Even beggars need to have standards.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7u1xoC0D_Q2z_bNniW3khIKsuykBjo83WNee7OtUCDfyVHXW4A_VGXgWdZG0veq6ip4r8Q_DIG10SM8Ttb1eXxNQhzDbofmAOqkAd0kEhR3y1rpS-TutwPyE6eEPFKtyorzJsYGLAC0k/s1600/20140414_103924.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7u1xoC0D_Q2z_bNniW3khIKsuykBjo83WNee7OtUCDfyVHXW4A_VGXgWdZG0veq6ip4r8Q_DIG10SM8Ttb1eXxNQhzDbofmAOqkAd0kEhR3y1rpS-TutwPyE6eEPFKtyorzJsYGLAC0k/s1600/20140414_103924.jpg" height="360" width="640" /></a></div>
<br />
8) <strong>China - Single-wheeled Segways and Mini-Segways</strong><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizvOi15w3ZwB8due56gTlW99OkUlvhs4KaVBR0jsC7pUGcNDaIOHso2tVPDwXml7zdtnTOTnQVAcyj9uMtuA15DTVQ1h1p284qfY2-hgMoAmMePUMYNvR-SYQjPL91KmiZtkBvek1WIwg/s1600/20140501_161925.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizvOi15w3ZwB8due56gTlW99OkUlvhs4KaVBR0jsC7pUGcNDaIOHso2tVPDwXml7zdtnTOTnQVAcyj9uMtuA15DTVQ1h1p284qfY2-hgMoAmMePUMYNvR-SYQjPL91KmiZtkBvek1WIwg/s1600/20140501_161925.jpg" height="360" width="640" /></a></div>
<br />
I saw about 20 of these on streets in China that people ride to work - I've never seen anything like it. Must have a very powerful gyro. Most of the motorbikes are all now electric (a big difference from my last visit 3 years before).<br />
<br />
<strong>9) China - Yuanmingyuan Ruins and Terracotta Warriors in Xian</strong><br />
Yuanmingruan are the ruins left of the old Summer Palace during the Opium Wars - the British and French Destroyed the massive fountains and palace complex that they helped to create. Dad (as a history teacher) - finally got to see the Terracotta warriors - and was very impressed.<br />
<br />
The Terracotta Warriors - every one of them different. All holding weapons with a chromium covering (allegedly 2200 years before the Germans discovered the technique) - so they were still shiny when excavated. The warriors were all coloured like the Chinese Temples - with blue faces.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfWv9Wik6A71A4OOKbbtFQuEPfbHRX8nUtEHtUD4llsKTDqHDtfF_se0crnJPZJ2a0aWViPuhYcS2iYD5WGL8B11k2xjUFuq-JBBHOTIQB6sX2ei6y1Eex_2QmukikEHpFCvUwAz422i0/s1600/20140427_122146.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfWv9Wik6A71A4OOKbbtFQuEPfbHRX8nUtEHtUD4llsKTDqHDtfF_se0crnJPZJ2a0aWViPuhYcS2iYD5WGL8B11k2xjUFuq-JBBHOTIQB6sX2ei6y1Eex_2QmukikEHpFCvUwAz422i0/s1600/20140427_122146.jpg" height="360" width="640" /></a></div>
<br />
Yuanmingyuan Ruins Destroyed in the Opium Wars<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjA8Qb_3z1h3NOe7O4hTH8VGMuGTELdutEM6N0JZKK3xRWeblnHdHFxFVCTolVoxa2KM7mNLY5IXweaeeff7GVyCN1-UoFCA6jeaSoWCFDpRrELiHC_nKhNqTuwD8lOsUxedmLT_8SkpyY/s1600/20140425_123551.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjA8Qb_3z1h3NOe7O4hTH8VGMuGTELdutEM6N0JZKK3xRWeblnHdHFxFVCTolVoxa2KM7mNLY5IXweaeeff7GVyCN1-UoFCA6jeaSoWCFDpRrELiHC_nKhNqTuwD8lOsUxedmLT_8SkpyY/s1600/20140425_123551.jpg" height="360" width="640" /></a></div>
<br />
Yuanmingyuan Maze<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQtqPRaMybXXntBYK1zLJi5sgj4OFWy1X0KllFqrUnNaJus5Ve50REnSHKxyR3zoJu76ur0fN2NuKIUlma0nHvXNRkXFAqPdUaUK2QHh1uKtDKUhpvwWgmUg52QmnSmUWh7BGIVAsCgb0/s1600/20140425_114755.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQtqPRaMybXXntBYK1zLJi5sgj4OFWy1X0KllFqrUnNaJus5Ve50REnSHKxyR3zoJu76ur0fN2NuKIUlma0nHvXNRkXFAqPdUaUK2QHh1uKtDKUhpvwWgmUg52QmnSmUWh7BGIVAsCgb0/s1600/20140425_114755.jpg" height="360" width="640" /></a></div>
<br />
<strong>10) China - Cooking my own food at a street vendor in Shanghai</strong><br />
<strong><br /></strong>Like cooking your own steak in the poor man's Oaks!<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijhMKzVeNUC-OV_ya55bE3mMX9HbEJUcVv26l0FgOSMlECpje0X7fthGJcKqyVUWf1Qp6bfuqk-p7ex0EjYkOItSFntX-9MxWLhf7EE1sFnEKkgfDrd59Dyh294mQg_WGTST0QsetMjCA/s1600/CookingStreetFood.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijhMKzVeNUC-OV_ya55bE3mMX9HbEJUcVv26l0FgOSMlECpje0X7fthGJcKqyVUWf1Qp6bfuqk-p7ex0EjYkOItSFntX-9MxWLhf7EE1sFnEKkgfDrd59Dyh294mQg_WGTST0QsetMjCA/s1600/CookingStreetFood.jpg" height="225" width="400" /></a></div>
<br />
<br />
<strong>11) The large number of times random people asked the kids and I to have photos with them</strong><br />
<strong><br /></strong>I had 4 groups ask me to hug them for photos just in Tiananmen Square! Zach then complained that everyone wanted photos with Heidi and I - "Who's taking a photo with me???". Sure enough he was asked about 10 minutes later!<br />
<br />
<strong>12) On our Cathay Flight Home, they played the Chinese Language of "Prepare for Landing" while we were in the middle of the Ocean!</strong>The captain apologized shortly after this boo-boo - as they had no native Mandarin speakers on the plane and got the messages mixed up. Shortly after, they asked if a doctor on the plane for an emergency. I would have had a heart attack too if I believed the message... when we landed, several people clapped and cheered. Apparently some countries have that as a tradition - but I think people were relieved that they were still alive...<br />
<br />
There are about a million other things I could say about the trip - but that will have to do!<br />
<br />
Till Next Time, <br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7m6CwDNgOnEn_ck4Aqxki-uEEmQFem4y1m-BXCbU0z0aEgy-3inizQKHkX0NDz0KTlAmFDjF1r7rKpe-Md1-AWuzxo5bzoJ7kmKn_adVYxCzNAc_GeLipHbPmV3HdFkyqd3VLieoLdho/s1600/3_ForbiddenCity.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7m6CwDNgOnEn_ck4Aqxki-uEEmQFem4y1m-BXCbU0z0aEgy-3inizQKHkX0NDz0KTlAmFDjF1r7rKpe-Md1-AWuzxo5bzoJ7kmKn_adVYxCzNAc_GeLipHbPmV3HdFkyqd3VLieoLdho/s1600/3_ForbiddenCity.jpg" height="360" width="640" /></a><br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAreLe5UMIfl5QhziCCYLWbSyRkx7hYq6RfrtMQAzqcVDdLBFKpbbd1S1FBABaoamMCAA0AeFowqMxXSuzlIE3rVUXBjtPPWzXIEArvI4YlPIWJOndq92zQB5kfpVeztjsS8dRbbW7pAc/s1600/20140429_155918.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAreLe5UMIfl5QhziCCYLWbSyRkx7hYq6RfrtMQAzqcVDdLBFKpbbd1S1FBABaoamMCAA0AeFowqMxXSuzlIE3rVUXBjtPPWzXIEArvI4YlPIWJOndq92zQB5kfpVeztjsS8dRbbW7pAc/s1600/20140429_155918.jpg" height="360" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibikymwFXWnxUTv1S3FLMTY-5tMuOK4SM-61AXZQ4m0pAUr8OMmO-1rklkwMM5rFdogzl47G6mwnQcjMQSL2Ek_jQEmaBItwT_ajv0l623ai8rGj3VWevgtwYCQJV2BZhfiogWa2OyQww/s1600/20140421_123856.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibikymwFXWnxUTv1S3FLMTY-5tMuOK4SM-61AXZQ4m0pAUr8OMmO-1rklkwMM5rFdogzl47G6mwnQcjMQSL2Ek_jQEmaBItwT_ajv0l623ai8rGj3VWevgtwYCQJV2BZhfiogWa2OyQww/s1600/20140421_123856.jpg" height="400" width="340" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8sIrobXRAo4k38RRKaMRdefzdPYXdS6dz-w4OTtcp4LMJJDjLzGscQlPNTeRfQgu3xtRmWptMvsy3x73Y1ZvgRfAk714-OgjafuRd6T_Rfc5OSJg2Y4H_0OgwgyEGTnkMoAvmuE4wGaU/s1600/20140423_101651.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8sIrobXRAo4k38RRKaMRdefzdPYXdS6dz-w4OTtcp4LMJJDjLzGscQlPNTeRfQgu3xtRmWptMvsy3x73Y1ZvgRfAk714-OgjafuRd6T_Rfc5OSJg2Y4H_0OgwgyEGTnkMoAvmuE4wGaU/s1600/20140423_101651.jpg" height="170" width="640" /></a></div>
<strong></strong><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXZhHzstdnhF7ZYLvf4MVO4E4dwLgc4fbHSqw6o1FVkPIMOVxe2_K2pwJPkU2DLdOqr513CEp3BdFwI4tDlEd2ljiPasNm2hjKrS4HDxvlnC2-vg_RGL6TLXatAfs8UIj1PwaLN431KEI/s1600/20140425_161820.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXZhHzstdnhF7ZYLvf4MVO4E4dwLgc4fbHSqw6o1FVkPIMOVxe2_K2pwJPkU2DLdOqr513CEp3BdFwI4tDlEd2ljiPasNm2hjKrS4HDxvlnC2-vg_RGL6TLXatAfs8UIj1PwaLN431KEI/s1600/20140425_161820.jpg" height="400" width="225" /></a></div>
<br />
<strong>DDK</strong><br />
<br />David Kleinhttp://www.blogger.com/profile/13657389334766989234noreply@blogger.com5tag:blogger.com,1999:blog-7130587409577087282.post-81051815426371426422014-03-10T14:37:00.002+11:002014-03-10T14:49:15.258+11:00FIX - Millions of Files Keep Clogging Up My System in Windows\System32\config\systemprofile\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5Recently, my windows system drive kept filling to take up all available space. I originally thought it was a virus or malware (or a dodgy windows update) causing the issue - but all the scanners I tried (such as MalwareBytes, Kaspersky Root Kit, AdwCleaner, ComboFix) detected nothing. Zilch.<br />
<br />
Using TreeSize, I discovered that there were so many gigabytes of files in my c:\Windows\System32\config\systemprofile\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5 directory that I couldn't even open the folder. The only way to delete the files was via a del *.* at an MS-DOS prompt (or PowerShell if you prefer). Even after doing this, the problem came back again.<br />
<br />
It turned out that the problem was that I had left the .NET Fusion Log Viewer Setting to "All Binds" - and all the HTML files being created in that temporary directory were actually just log bind text files. <br />
I opened up the Visual Studio 2013 command Prompt on the problem machine (Running as an Administrator), ran fuslogvw and turned off all logging. <br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZEoEFtxC5bTwEGrKqyyWeJA1T8342tZFzpBFICujukkM4VpXaO4fp9zKIWpRba8y1WPcOEXZaeIsTtGdOKwtz8YRxGiJ9Ue0i2Jogc0AVbenzqFsP0Rq_Wx05lkJzvOYePrw3YFHbnaQ/s1600/FusionLog.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZEoEFtxC5bTwEGrKqyyWeJA1T8342tZFzpBFICujukkM4VpXaO4fp9zKIWpRba8y1WPcOEXZaeIsTtGdOKwtz8YRxGiJ9Ue0i2Jogc0AVbenzqFsP0Rq_Wx05lkJzvOYePrw3YFHbnaQ/s1600/FusionLog.png" height="456" width="640" /></a><br />
<br />
<br />
Et Voila. No more problem. <br />
<br />
I also changed the default log path to a different directory to avoid confusion later (and to make it easier to clear out by deleting the whole directory rather than the millions of files within when I next want to troubleshoot assembly binding issues). <br /><br />Really, the FusLogVw should have an automatic rolling logging feature the same as the SharePoint ULS Logs so this problem wouldn't bring a system to its knees.<br />
<br />
DDKDavid Kleinhttp://www.blogger.com/profile/13657389334766989234noreply@blogger.com1tag:blogger.com,1999:blog-7130587409577087282.post-32636651937955740282014-02-13T15:17:00.000+11:002014-02-13T15:32:43.362+11:00SharePoint 2013 - Warning! Access of SPContext.Current before PostRequestHandlerExecute in an IHttpModule will Cause Improper Initialization and Partial Failure of SharePoint ComponentsRan into a particularly <strong>insidious </strong>issue yesterday with a HttpModule (implementing the IHttpModule interface) running on a SharePoint 2013 web application. The symptoms of the problem were:<br />
<ol>
<li>A user Clicks Settings > Add A Page<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihYEsP08FVHN8eerVuCnieTJUuRE-z4vyiYAXBlZoMyCMpZC77tPWcRsyAo0XJlVizeP9afavYIKbJpE3u5S1jXtmMmhEDbxGNhPrJ_gYfI5VMM6RoPa1EwQdCdU9to_ufhY94tqaHqp8/s1600/AddPage.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihYEsP08FVHN8eerVuCnieTJUuRE-z4vyiYAXBlZoMyCMpZC77tPWcRsyAo0XJlVizeP9afavYIKbJpE3u5S1jXtmMmhEDbxGNhPrJ_gYfI5VMM6RoPa1EwQdCdU9to_ufhY94tqaHqp8/s1600/AddPage.png" /></a></li>
<li>The "Create Default Wiki Pages" Dialog Appears<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfVZMqxP_yo2izzRGcp_Q6RoL_Ik47siK3SnOEuNmAXzRX8PQyFuiZ29lO-ioE0CEAzIpz2Be1loDB8BfP4tamvdfXIyUxVDzc4H-AQ2J-sGc1ASaMkiMS9Dbp9cUb7vIVmsZtcPgI9mk/s1600/CreateDefaultWikiLibraries.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfVZMqxP_yo2izzRGcp_Q6RoL_Ik47siK3SnOEuNmAXzRX8PQyFuiZ29lO-ioE0CEAzIpz2Be1loDB8BfP4tamvdfXIyUxVDzc4H-AQ2J-sGc1ASaMkiMS9Dbp9cUb7vIVmsZtcPgI9mk/s1600/CreateDefaultWikiLibraries.png" height="168" width="320" /></a></li>
<li>The User Gets an "Access Required - Sorry, this site hasn't been shared with you." Error Dialog<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOeKigA21Atv1UCFeNhkPATfhMjlZ4TZvUqlXCUlhJcz0BGvs087Aj7AI_QB9oxV_WUQfCCZCXHfbFEfw8KbDd0pxx8zkq2kgUqlTkGjiUXbc9gTvlwXo0a1fFR8bGxAxcOfMQlbFWzko/s1600/SorryThisSite.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOeKigA21Atv1UCFeNhkPATfhMjlZ4TZvUqlXCUlhJcz0BGvs087Aj7AI_QB9oxV_WUQfCCZCXHfbFEfw8KbDd0pxx8zkq2kgUqlTkGjiUXbc9gTvlwXo0a1fFR8bGxAxcOfMQlbFWzko/s1600/SorryThisSite.png" height="117" width="320" /></a></li>
</ol>
This originally looked like a permissions issue - but that was a red herring. With great difficulty (and a smidgen of persistence), I found out that this problem occurs if you access the SPContext in an Event Handler that is before the PreRequestHandlerExecute Event. See my table below for when you can use SPContext.Current.<br />
<div style="text-align: center;">
</div>
<div style="text-align: center;">
</div>
<div style="text-align: center;">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; text-align: center; width: 459px;">
<colgroup><col style="mso-width-alt: 2486; mso-width-source: userset; width: 51pt;" width="68"></col>
<col style="mso-width-alt: 6838; mso-width-source: userset; width: 140pt;" width="187"></col>
<col style="mso-width-alt: 7460; mso-width-source: userset; width: 153pt;" width="204"></col>
<tbody>
<tr height="20" style="height: 15pt;">
<td height="20" style="background: rgb(237, 125, 49); border-color: white; border-style: none solid solid none; border-width: 0px 0.5pt 1.5pt 0px; color: white; font-family: Calibri; font-size: 11pt; font-weight: 700; height: 15pt; mso-pattern: #ED7D31 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 51pt;" width="68">Event #</td>
<td style="background: rgb(237, 125, 49); border-color: white; border-style: none solid solid; border-width: 0px 0.5pt 1.5pt; color: white; font-family: Calibri; font-size: 11pt; font-weight: 700; mso-pattern: #ED7D31 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 140pt;" width="187">HttpApplication Event Name</td>
<td style="background: rgb(237, 125, 49); border-color: white; border-style: none none solid solid; border-width: 0px 0px 1.5pt 0.5pt; color: white; font-family: Calibri; font-size: 11pt; font-weight: 700; mso-pattern: #ED7D31 none; text-decoration: none; text-line-through: none; text-underline-style: none; width: 153pt;" width="204">OK
to use SPContext.Current</td>
</tr>
<tr height="20" style="height: 15pt;">
<td height="20" style="background: rgb(248, 203, 173); border-color: white white white black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; height: 15pt; mso-pattern: #F8CBAD none; text-align: right; text-decoration: none; text-line-through: none; text-underline-style: none;">1</td>
<td style="background: rgb(248, 203, 173); border: 0.5pt solid white; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: #F8CBAD none; text-decoration: none; text-line-through: none; text-underline-style: none;">BeginRequest</td>
<td class="xl64" style="background: rgb(255, 199, 206); border-color: white rgb(156, 0, 6) white white; border-style: solid none solid solid; border-width: 0.5pt 0px 0.5pt 0.5pt; color: #9c0006; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none;">NO</td>
</tr>
<tr height="20" style="height: 15pt;">
<td height="20" style="background: rgb(252, 228, 214); border-color: white white white black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; height: 15pt; mso-pattern: #FCE4D6 none; text-align: right; text-decoration: none; text-line-through: none; text-underline-style: none;">2</td>
<td style="background: rgb(252, 228, 214); border: 0.5pt solid white; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: #FCE4D6 none; text-decoration: none; text-line-through: none; text-underline-style: none;">AuthenticateRequest</td>
<td class="xl64" style="background: rgb(255, 199, 206); border-color: white rgb(156, 0, 6) white white; border-style: solid none solid solid; border-width: 0.5pt 0px 0.5pt 0.5pt; color: #9c0006; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none;">NO</td>
</tr>
<tr height="20" style="height: 15pt;">
<td height="20" style="background: rgb(248, 203, 173); border-color: white white white black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; height: 15pt; mso-pattern: #F8CBAD none; text-align: right; text-decoration: none; text-line-through: none; text-underline-style: none;">3</td>
<td style="background: rgb(248, 203, 173); border: 0.5pt solid white; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: #F8CBAD none; text-decoration: none; text-line-through: none; text-underline-style: none;">PostAuthenticateRequest</td>
<td class="xl64" style="background: rgb(255, 199, 206); border-color: white rgb(156, 0, 6) white white; border-style: solid none solid solid; border-width: 0.5pt 0px 0.5pt 0.5pt; color: #9c0006; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none;">NO</td>
</tr>
<tr height="20" style="height: 15pt;">
<td height="20" style="background: rgb(252, 228, 214); border-color: white white white black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; height: 15pt; mso-pattern: #FCE4D6 none; text-align: right; text-decoration: none; text-line-through: none; text-underline-style: none;">4</td>
<td style="background: rgb(252, 228, 214); border: 0.5pt solid white; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: #FCE4D6 none; text-decoration: none; text-line-through: none; text-underline-style: none;">AuthorizeRequest</td>
<td class="xl64" style="background: rgb(255, 199, 206); border-color: white rgb(156, 0, 6) white white; border-style: solid none solid solid; border-width: 0.5pt 0px 0.5pt 0.5pt; color: #9c0006; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none;">NO</td>
</tr>
<tr height="20" style="height: 15pt;">
<td height="20" style="background: rgb(248, 203, 173); border-color: white white white black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; height: 15pt; mso-pattern: #F8CBAD none; text-align: right; text-decoration: none; text-line-through: none; text-underline-style: none;">5</td>
<td style="background: rgb(248, 203, 173); border: 0.5pt solid white; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: #F8CBAD none; text-decoration: none; text-line-through: none; text-underline-style: none;">PostAuthorizeRequest</td>
<td class="xl64" style="background: rgb(255, 199, 206); border-color: white rgb(156, 0, 6) white white; border-style: solid none solid solid; border-width: 0.5pt 0px 0.5pt 0.5pt; color: #9c0006; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none;">NO</td>
</tr>
<tr height="20" style="height: 15pt;">
<td height="20" style="background: rgb(252, 228, 214); border-color: white white white black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; height: 15pt; mso-pattern: #FCE4D6 none; text-align: right; text-decoration: none; text-line-through: none; text-underline-style: none;">6</td>
<td style="background: rgb(252, 228, 214); border: 0.5pt solid white; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: #FCE4D6 none; text-decoration: none; text-line-through: none; text-underline-style: none;">ResolveRequestCache</td>
<td class="xl64" style="background: rgb(255, 199, 206); border-color: white rgb(156, 0, 6) white white; border-style: solid none solid solid; border-width: 0.5pt 0px 0.5pt 0.5pt; color: #9c0006; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none;">NO</td>
</tr>
<tr height="20" style="height: 15pt;">
<td height="20" style="background: rgb(248, 203, 173); border-color: white white white black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; height: 15pt; mso-pattern: #F8CBAD none; text-align: right; text-decoration: none; text-line-through: none; text-underline-style: none;">7</td>
<td style="background: rgb(248, 203, 173); border: 0.5pt solid white; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: #F8CBAD none; text-decoration: none; text-line-through: none; text-underline-style: none;">PostResolveRequestCache</td>
<td class="xl64" style="background: rgb(255, 199, 206); border-color: white rgb(156, 0, 6) white white; border-style: solid none solid solid; border-width: 0.5pt 0px 0.5pt 0.5pt; color: #9c0006; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none;">NO</td>
</tr>
<tr height="20" style="height: 15pt;">
<td height="20" style="background: rgb(252, 228, 214); border-color: white white white black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; height: 15pt; mso-pattern: #FCE4D6 none; text-align: right; text-decoration: none; text-line-through: none; text-underline-style: none;">8</td>
<td style="background: rgb(252, 228, 214); border: 0.5pt solid white; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: #FCE4D6 none; text-decoration: none; text-line-through: none; text-underline-style: none;">PostMapRequestHandler</td>
<td class="xl64" style="background: rgb(255, 199, 206); border-color: white rgb(156, 0, 6) white white; border-style: solid none solid solid; border-width: 0.5pt 0px 0.5pt 0.5pt; color: #9c0006; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none;">NO</td>
</tr>
<tr height="20" style="height: 15pt;">
<td height="20" style="background: rgb(248, 203, 173); border-color: white white white black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; height: 15pt; mso-pattern: #F8CBAD none; text-align: right; text-decoration: none; text-line-through: none; text-underline-style: none;">9</td>
<td style="background: rgb(248, 203, 173); border: 0.5pt solid white; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: #F8CBAD none; text-decoration: none; text-line-through: none; text-underline-style: none;">AcquireRequestState</td>
<td class="xl64" style="background: rgb(255, 199, 206); border-color: white rgb(156, 0, 6) white white; border-style: solid none solid solid; border-width: 0.5pt 0px 0.5pt 0.5pt; color: #9c0006; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none;">NO</td>
</tr>
<tr height="20" style="height: 15pt;">
<td height="20" style="background: rgb(252, 228, 214); border-color: white white white black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; height: 15pt; mso-pattern: #FCE4D6 none; text-align: right; text-decoration: none; text-line-through: none; text-underline-style: none;">10</td>
<td style="background: rgb(252, 228, 214); border: 0.5pt solid white; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: #FCE4D6 none; text-decoration: none; text-line-through: none; text-underline-style: none;">PostAcquireRequestState</td>
<td class="xl64" style="background: rgb(255, 199, 206); border-color: white rgb(156, 0, 6) white white; border-style: solid none solid solid; border-width: 0.5pt 0px 0.5pt 0.5pt; color: #9c0006; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none;">NO</td>
</tr>
<tr height="20" style="height: 15pt;">
<td class="xl63" height="20" style="background: rgb(248, 203, 173); border-color: white white white black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; color: black; font-family: Calibri; font-size: 11pt; font-weight: 700; height: 15pt; mso-pattern: #F8CBAD none; text-align: right; text-decoration: none; text-line-through: none; text-underline-style: none;">11</td>
<td class="xl63" style="background: rgb(248, 203, 173); border: 0.5pt solid white; color: black; font-family: Calibri; font-size: 11pt; font-weight: 700; mso-pattern: #F8CBAD none; text-decoration: none; text-line-through: none; text-underline-style: none;">PreRequestHandlerExecute</td>
<td class="xl66" style="background: rgb(198, 239, 206); border-color: white rgb(0, 97, 0) white white; border-style: solid none solid solid; border-width: 0.5pt 0px 0.5pt 0.5pt; color: #006100; font-family: Calibri; font-size: 11pt; font-weight: 700; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none;">YES</td>
</tr>
<tr height="20" style="height: 15pt;">
<td height="20" style="background: rgb(252, 228, 214); border-color: white white white black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; height: 15pt; mso-pattern: #FCE4D6 none; text-align: right; text-decoration: none; text-line-through: none; text-underline-style: none;">12</td>
<td style="background: rgb(252, 228, 214); border: 0.5pt solid white; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: #FCE4D6 none; text-decoration: none; text-line-through: none; text-underline-style: none;">PostRequestHandlerExecute</td>
<td class="xl65" style="background: rgb(198, 239, 206); border-color: white rgb(0, 97, 0) white white; border-style: solid none solid solid; border-width: 0.5pt 0px 0.5pt 0.5pt; color: #006100; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none;">YES</td>
</tr>
<tr height="20" style="height: 15pt;">
<td height="20" style="background: rgb(248, 203, 173); border-color: white white white black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; height: 15pt; mso-pattern: #F8CBAD none; text-align: right; text-decoration: none; text-line-through: none; text-underline-style: none;">13</td>
<td style="background: rgb(248, 203, 173); border: 0.5pt solid white; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: #F8CBAD none; text-decoration: none; text-line-through: none; text-underline-style: none;">ReleaseRequestState</td>
<td class="xl65" style="background: rgb(198, 239, 206); border-color: white rgb(0, 97, 0) white white; border-style: solid none solid solid; border-width: 0.5pt 0px 0.5pt 0.5pt; color: #006100; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none;">YES</td>
</tr>
<tr height="20" style="height: 15pt;">
<td height="20" style="background: rgb(252, 228, 214); border-color: white white white black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; height: 15pt; mso-pattern: #FCE4D6 none; text-align: right; text-decoration: none; text-line-through: none; text-underline-style: none;">14</td>
<td style="background: rgb(252, 228, 214); border: 0.5pt solid white; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: #FCE4D6 none; text-decoration: none; text-line-through: none; text-underline-style: none;">PostReleaseRequestState</td>
<td class="xl65" style="background: rgb(198, 239, 206); border-color: white rgb(0, 97, 0) white white; border-style: solid none solid solid; border-width: 0.5pt 0px 0.5pt 0.5pt; color: #006100; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none;">YES</td>
</tr>
<tr height="20" style="height: 15pt;">
<td height="20" style="background: rgb(248, 203, 173); border-color: white white white black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; height: 15pt; mso-pattern: #F8CBAD none; text-align: right; text-decoration: none; text-line-through: none; text-underline-style: none;">15</td>
<td style="background: rgb(248, 203, 173); border: 0.5pt solid white; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: #F8CBAD none; text-decoration: none; text-line-through: none; text-underline-style: none;">UpdateRequestCache<span style="mso-spacerun: yes;"> </span></td>
<td class="xl65" style="background: rgb(198, 239, 206); border-color: white rgb(0, 97, 0) white white; border-style: solid none solid solid; border-width: 0.5pt 0px 0.5pt 0.5pt; color: #006100; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none;">YES</td>
</tr>
<tr height="20" style="height: 15pt;">
<td height="20" style="background: rgb(252, 228, 214); border-color: white white white black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; height: 15pt; mso-pattern: #FCE4D6 none; text-align: right; text-decoration: none; text-line-through: none; text-underline-style: none;">16</td>
<td style="background: rgb(252, 228, 214); border: 0.5pt solid white; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: #FCE4D6 none; text-decoration: none; text-line-through: none; text-underline-style: none;">PostUpdateRequestCache<span style="mso-spacerun: yes;"> </span></td>
<td class="xl65" style="background: rgb(198, 239, 206); border-color: white rgb(0, 97, 0) white white; border-style: solid none solid solid; border-width: 0.5pt 0px 0.5pt 0.5pt; color: #006100; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none;">YES</td>
</tr>
<tr height="20" style="height: 15pt;">
<td height="20" style="background: rgb(248, 203, 173); border-color: white white white black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; height: 15pt; mso-pattern: #F8CBAD none; text-align: right; text-decoration: none; text-line-through: none; text-underline-style: none;">17</td>
<td style="background: rgb(248, 203, 173); border: 0.5pt solid white; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: #F8CBAD none; text-decoration: none; text-line-through: none; text-underline-style: none;">LogRequest</td>
<td class="xl65" style="background: rgb(198, 239, 206); border-color: white rgb(0, 97, 0) white white; border-style: solid none solid solid; border-width: 0.5pt 0px 0.5pt 0.5pt; color: #006100; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none;">YES</td>
</tr>
<tr height="20" style="height: 15pt;">
<td height="20" style="background: rgb(252, 228, 214); border-color: white white white black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; height: 15pt; mso-pattern: #FCE4D6 none; text-align: right; text-decoration: none; text-line-through: none; text-underline-style: none;">18</td>
<td style="background: rgb(252, 228, 214); border: 0.5pt solid white; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: #FCE4D6 none; text-decoration: none; text-line-through: none; text-underline-style: none;">PostLogRequest</td>
<td class="xl65" style="background: rgb(198, 239, 206); border-color: white rgb(0, 97, 0) white white; border-style: solid none solid solid; border-width: 0.5pt 0px 0.5pt 0.5pt; color: #006100; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none;">YES</td>
</tr>
<tr height="20" style="height: 15pt;">
<td height="20" style="background: rgb(248, 203, 173); border-color: white white black black; border-style: solid solid none none; border-width: 0.5pt 0.5pt 0px 0px; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; height: 15pt; mso-pattern: #F8CBAD none; text-align: right; text-decoration: none; text-line-through: none; text-underline-style: none;">19</td>
<td style="background: rgb(248, 203, 173); border-color: white white black; border-style: solid solid none; border-width: 0.5pt 0.5pt 0px; color: black; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: #F8CBAD none; text-decoration: none; text-line-through: none; text-underline-style: none;">EndRequest</td>
<td class="xl65" style="background: rgb(198, 239, 206); border-color: white rgb(0, 97, 0) rgb(0, 97, 0) white; border-style: solid none none solid; border-width: 0.5pt 0px 0px 0.5pt; color: #006100; font-family: Calibri; font-size: 11pt; font-weight: 400; mso-pattern: black none; text-decoration: none; text-line-through: none; text-underline-style: none;">YES</td>
</tr>
</tbody></colgroup></table>
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijqFhQV2tC-2bKCLSVwXGY9jd4R0GaKq6ZuW7btTTvQF-gxYvt-uKI5HViQP-Hks8llMIAt98ELRg2DwYZyyQ1Y0yHU2Mii_ClmO33G4uO8L3GTTRtXH1otCzIuPkZ-xuGSyuQ3Ere2uE/s1600/AddPageCode.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"></a> </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFMER_Rb2o6l7gkzsIZQSHn39tuzWsSEU6fDemVaNweH_HY7H1xFF4xjLFOlcuwnK86-8rrvzGiysMbsgxPf1DoObc-q__PYcr1wA0qKwJpNQj8Pj-jllMaA7KZm4XuUPF-aJLp0vBOKw/s1600/AddPageCode.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"></a> </div>
In my case, we (not to place blame on any particular developer!) created calls to the SPContext in the PostAcquireRequestState event handler. As soon as any access to the SPContext takes place this early in the processing pipeline, forces an incorrect initialization of variables such as "SitePages" and "SiteAssetsLibrary". The SPContext.Current is not null - just half-baked.<br />
The following code in an HttpModule will cause your "Add Pages" functionality in SharePoint 2013 to fail as well:<br />
<pre class="csharp" name="code"> public class SecurityModule : IHttpModule, IRequiresSessionState
{
private void context_PostAcquireRequestState(object sender, EventArgs e)
{
if (SPContext.Current == null)
{
//Do nothing - this call to SPContext.Current too early in the Http Processing Pipeline will cause "Add Pages" in SP2013 to fail.
//This is because the SiteAssets and SitePages Collections in SPWeb are not initialized properly for later calls in the pipeline.
}
}
}
</pre>
<br />
Using Reflector, you can see that internally, the "Add Page" Dialog uses the SPWeb.SitePagesLibrary internal property. <br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFMER_Rb2o6l7gkzsIZQSHn39tuzWsSEU6fDemVaNweH_HY7H1xFF4xjLFOlcuwnK86-8rrvzGiysMbsgxPf1DoObc-q__PYcr1wA0qKwJpNQj8Pj-jllMaA7KZm4XuUPF-aJLp0vBOKw/s1600/AddPageCode.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFMER_Rb2o6l7gkzsIZQSHn39tuzWsSEU6fDemVaNweH_HY7H1xFF4xjLFOlcuwnK86-8rrvzGiysMbsgxPf1DoObc-q__PYcr1wA0qKwJpNQj8Pj-jllMaA7KZm4XuUPF-aJLp0vBOKw/s1600/AddPageCode.png" height="250" width="640" /></a><br />
<br />
If I step through Microsoft's SharePoint code with Reflector VS PRO, I see that some properties are not initialized when I use SPContext in my custom code before the PreRequestHandlerExecute event. <br />
<br />
Lesson Learned (and something to watch out for as the problem is hard to detect) - even if you CAN access the SPContext.Current before PreRequestHandlerExecute, DON'T DO IT. Otherwise, it <strong><span style="color: red;">causes instability in objects initialized by your SPContext later in the request pipeline</span></strong>. <br />
<br />
This includes SharePoint itself. You have been warned!<br />
<br />
<strong>DDK</strong><br />
<br />David Kleinhttp://www.blogger.com/profile/13657389334766989234noreply@blogger.com1tag:blogger.com,1999:blog-7130587409577087282.post-54315013860682769962013-10-24T11:41:00.001+11:002013-10-24T11:41:25.696+11:00Build and Package/Publish Behaviour Changes for SharePoint 2013 Projects from Visual Studio 2012 to Visual Studio 2013I recently moved to a fresh SharePoint Development Farm with Visual Studio 2013 (from an install with VS 2012 and VS 2013 RC) - and noticed that my projects would build but not publish or deploy correctly. When attempting to Publish or deploy certain projects (i.e. to build SharePoint Solution or .wsp files) in Visual Studio 2013, I found that they would fail on the publish step after rebuilding other projects with your usual build failure exceptions:<br />
<br />
<span style="color: red;">The type or namespace name "Interfaces" does not exist in the namespace "ProjectName.Repository" (are you missing an assembly reference?)</span><br />
<br />
I tried to see if there were differences in the Project (csproj) structure in Team Foundation Server (TFS) - as my colleague still had Visual Studio 2012 and could build the project without issue. There were no differences. <br />
<br />
To troubleshoot the issue, I turned build logging way up to the Diagnostics Level from the default of Minimum (in Tools > Options > Projects and Solutions > Build and Run > MSBuild project build output verbosity) as seen below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFZvbzNk42cQT2Qw-ipymtLm4_XJog9xFqrDXT2pZ6eKSDGXvW6xWXKVOZLbOqNw8ebDWmub7zislh5HydLNEay_r4CIivgEk5yVynAAvVGN_rLOWFB6E3_vbCoCBiQdYcc2ekrocf5fI/s1600/FullDiagnostics.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="235" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFZvbzNk42cQT2Qw-ipymtLm4_XJog9xFqrDXT2pZ6eKSDGXvW6xWXKVOZLbOqNw8ebDWmub7zislh5HydLNEay_r4CIivgEk5yVynAAvVGN_rLOWFB6E3_vbCoCBiQdYcc2ekrocf5fI/s400/FullDiagnostics.png" width="400" /></a></div>
<br />
Once you do this, you will have tens of thousands of lines of errors and information to sift through. A lot of the errors are spurious and are actually part of the normal functioning of MSBuild. One of the first errors that came up related to the ToolSet Version Installed. It was apparently looking for the Visual Studio 2010 Tools (not even the 2012 Toolset from the Project File (csproj) Definition):<br />
<br />
1>------ Build started: Project: MyProject.Model, Configuration: Debug Any CPU ------<br />1>Build started 23/10/2013 6:32:46 PM.<br />1>Building with tools version "12.0".<br />1><span style="color: red;">Project file contains ToolsVersion="4.0". This toolset may be unknown or missing, in which case you may be able to resolve this by installing the appropriate version of MSBuild, or the build may have been forced to a particular ToolsVersion for policy reasons. Treating the project as if it had ToolsVersion="12.0". For more information, please see http://go.microsoft.com/fwlink/?LinkId=293424.</span><br />1>Target "_CheckForInvalidConfigurationAndPlatform" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "C:\src\DDK\BIT\MyProject\trunk\MyProject.Models\MyProject.Model.csproj" (entry point):<br />1>Task "Error" skipped, due to false condition; ( '$(_InvalidConfigurationError)' == 'true' ) was evaluated as ( '' == 'true' ).<br />1>Task "Warning" skipped, due to false condition; ( '$(_InvalidConfigurationWarning)' == 'true' ) was evaluated as ( '' == 'true' ).<br />1>Using "Message" task from assembly "Microsoft.Build.Tasks.v12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".<br />1>Task "Message"<br />1> Configuration=Debug<br />1>Done executing task "Message".<br />1>Task "Message"<br />1> Platform=AnyCPU<br />1>Done executing task "Message".<br />1>Task "Error" skipped, due to false condition; ('$(OutDir)' != '' and !HasTrailingSlash('$(OutDir)')) was evaluated as ('bin\Debug\' != '' and !HasTrailingSlash('bin\Debug\')).<br />1>Task "Error" skipped, due to false condition; ('$(BaseIntermediateOutputPath)' != '' and !HasTrailingSlash('$(BaseIntermediateOutputPath)')) was evaluated as ('obj\' != '' and !HasTrailingSlash('obj\')).<br />1>Task "Error" skipped, due to false condition; ('$(IntermediateOutputPath)' != '' and !HasTrailingSlash('$(IntermediateOutputPath)')) was evaluated as ('obj\Debug\' != '' and !HasTrailingSlash('obj\Debug\')).<br /><br />
I tried to replace all the ToolsVersions to the Visual Studio 2013 version (which is ToolsVersion="12.0" - but to no avail.<br />
<br />
I also had exceptions pointing to files that didn't exist - like so:<br />
<span style="color: red;">8>Output file "__NonExistentSubDir__\__NonExistentFile__" does not exist.</span><br />
<br />
I checked with the Fusion Log Viewer (fuslogvw from a Visual Studio Command Prompt) - but there were no errors loading assemblies found. I also checked the GAC with gacutil /l and the files definitely got installed there - so that wasn't the issue. I also considered that it may be one of the perennial problems involving permissions - but Visual Studio was running as an Administrator and the Diagnostics Build log showed no permissions errors like this.<br />
<br />
Thinking about how the error only occurred during a Publish or Deploy in Visual Studio, I considered that it may be a problem with the SharePoint Package (Package.package) file. Turns out this was right on the money. <br />
<br />
Looking at the very end of the Diagnostic Build log:<br />
<br />
8>Done executing task "Exec".<br />8>Done building target "PostBuildEvent" in project "MyProject.Common.UI.csproj".<br />8>Target "CoreBuild" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "C:\src\DDK\BIT\MyProject\trunk\MyProject.Common.UI\MyProject.Common.UI.csproj" (target "Build" depends on it):<br />8>Done building target "CoreBuild" in project "MyProject.Common.UI.csproj".<br />8>Target "CreateTfsBuildInfoResource" skipped, due to false condition; ( $(AddBuildInfoToAssembly)==true ) was evaluated as ( false==true ).<br />8>Target "AfterBuild" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "C:\src\DDK\BIT\MyProject\trunk\MyProject.Common.UI\MyProject.Common.UI.csproj" (target "Build" depends on it):<br />8>Done building target "AfterBuild" in project "MyProject.Common.UI.csproj".<br />8>Target "Build" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "C:\src\DDK\BIT\MyProject\trunk\MyProject.Common.UI\MyProject.Common.UI.csproj" (entry point):<br />8>Done building target "Build" in project "MyProject.Common.UI.csproj".<br />8>Done executing task "MSBuild" -- FAILED.<br />8>Done building target "BuildSharePointProjectReferences" in project "MyProject.ApplicationPages.csproj" -- FAILED.<br />8>Done executing task "CallTarget" -- FAILED.<br />8>Done building target "ConditionalPackage" in project "MyProject.ApplicationPages.csproj" -- FAILED.<br />8><br />8>Build FAILED.<br />8><br />
<br />
When I removed all project assemblies from the Package.Package File (under "Additional Assemblies") that were in my project output (i.e. any non-3rd Party Components), the package would work correctly. Turns out the main difference between Visual Studio 2012 and 2013 is that the order of "Additional Assemblies" defined in a SharePoint package actually makes a difference - and they must be in order of your project dependencies. If they are out of order, MSBuild process (during creation of the wsp only) will not find them in its working directory and spit the dummy.<br />
<br />
The fix to resolve the issue then is to make sure all your "Additional Assemblies" are created in correct dependency order - this didn't make a difference during the build process in Visual Studio 2012 but it makes a big difference in Visual Studio 2013.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4dltGlPr5VFpHK5otjS-PwGaAXDgu-57R2RocniVMapBFw14q0edi1IrSxWehET7uIeJyKvRT8cTof_Vp3C1MhBUPa0y0WPxS_Ry93N0pf8enQn3Cv1mEWehf8o0k8tFSdtHuW1gOPeg/s1600/OrderHasToBeCorrect.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="104" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4dltGlPr5VFpHK5otjS-PwGaAXDgu-57R2RocniVMapBFw14q0edi1IrSxWehET7uIeJyKvRT8cTof_Vp3C1MhBUPa0y0WPxS_Ry93N0pf8enQn3Cv1mEWehf8o0k8tFSdtHuW1gOPeg/s320/OrderHasToBeCorrect.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<br />
I suspect this difference in behavior is related to the changes in architecture to MSBuild and its migration from .NET into Visual Studio itself as discussed here - <!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-AU</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><br />
<!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman","serif";}
</style>
<![endif]-->
<br />
<div class="MsoNormal">
<a href="http://blogs.msdn.com/b/visualstudio/archive/2013/07/24/msbuild-is-now-part-of-visual-studio.aspx">http://blogs.msdn.com/b/visualstudio/archive/2013/07/24/msbuild-is-now-part-of-visual-studio.aspx</a></div>
<br />
<br />
<br />
<b>DDK</b><br />
<br />
David Kleinhttp://www.blogger.com/profile/13657389334766989234noreply@blogger.com3tag:blogger.com,1999:blog-7130587409577087282.post-12088679942649447652013-10-08T11:42:00.002+11:002013-10-10T12:45:23.455+11:00SharePoint 2013 - Bug - Breaking Role Inheritance on Document Library Items within a Synchronous ItemAdded Item Event Receiver will always generate an exception when not a Site Collection Administrator (e.g. a Site Owner) - FixThis particular issue has caused me a fair amount of grief in the past when developing List Item Event Receivers against Document Libraries (there is no such problem with other List types that don't have Checkouts). I believe it is a bug (or at least a sub-optimal design) in the SaveButton code in SharePoint itself.<br />
<br />
It essentially means you cannot change permissions on an item without getting an exception in certain scenarios/use cases like so:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgB4xjWLdcjtO7umCrPHm9VA6CAO2PQOrcqPy9KvGNeKgDuvq7WOVLqLDdjGVPuY1edxIo_l_22-YJQHC4MdiIKYodinmwQUIofiAb1Jx2pHo-9LYTwWkmr7HKFuKLYNKJuAaNql-uxWyk/s1600/SomeThingWentWrongException.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="306" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgB4xjWLdcjtO7umCrPHm9VA6CAO2PQOrcqPy9KvGNeKgDuvq7WOVLqLDdjGVPuY1edxIo_l_22-YJQHC4MdiIKYodinmwQUIofiAb1Jx2pHo-9LYTwWkmr7HKFuKLYNKJuAaNql-uxWyk/s640/SomeThingWentWrongException.png" width="640" /></a></div>
<br />
<br />
In short, if you (as a non-site collection admin user such as a site owner) perform a BreakRoleInheritance() or any overloads on an item in an <b>ItemAdded Synchronous</b> Receiver against a Document Library in SharePoint 2013, you will always receive the following exception in your SharePoint ULS Logs and the user will see a spurious exception:<br />
<br />
<span style="color: red;"> Application error when access /Secured Document Library/Forms/EditForm.aspx, Error=Specified argument was out of the range of valid values. <br /> at Microsoft.SharePoint.SPListItemCollection.get_Item(Int32 iIndex) <br /> at Microsoft.SharePoint.SPListItem.EnsureItemIsValid() <br /> at Microsoft.SharePoint.SPListItem.GetValue(SPField fld, Int32 columnNumber, Boolean bRaw, Boolean bThrowException) <br /> at Microsoft.SharePoint.SPListItem.GetValue(String strName, Boolean bThrowIfValueMissing, Boolean bThrowIfFieldMissing) <br /> at Microsoft.SharePoint.SPListItem.GetValue(String strName) <br /> at Microsoft.SharePoint.SPListItem.get_File() <br /> at Microsoft.SharePoint.WebControls.SaveButton.SaveItem(SPContext itemContext, Boolean uploadMode, String checkInComment) <br /> at Microsoft.SharePoint.WebControls.SaveButton.SaveItem() <br /> at Microsoft.SharePoint.WebControls.SaveButton.OnBubbleEvent(Object source, EventArgs e) <br /> at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) </span><br />
<span style="color: red;"> at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)</span><br />
<br />
Followed by this:<br />
<br />
<span style="color: red;"> System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. <br /> at Microsoft.SharePoint.SPListItemCollection.get_Item(Int32 iIndex) <br /> at Microsoft.SharePoint.SPListItem.EnsureItemIsValid() <br /> at Microsoft.SharePoint.SPListItem.GetValue(SPField fld, Int32 columnNumber, Boolean bRaw, Boolean bThrowException) <br /> at Microsoft.SharePoint.SPListItem.GetValue(String strName, Boolean bThrowIfValueMissing, Boolean bThrowIfFieldMissing) <br /> at Microsoft.SharePoint.SPListItem.GetValue(String strName) <br /> at Microsoft.SharePoint.SPListItem.get_File() <br /> at Microsoft.SharePoint.WebControls.SaveButton.SaveItem(SPContext itemContext, Boolean uploadMode, String checkInComment) <br /> at Microsoft.SharePoint.WebControls.SaveButton.SaveItem() <br /> at Microsoft.SharePoint.WebControls.SaveButton.OnBubbleEvent(Object source, EventArgs e) <br /> at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) <br /> at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)</span><br />
<br />
Then this equally entertaining Exception:<br />
<br />
<span style="color: red;">Getting Error Message for Exception System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. <br /> at Microsoft.SharePoint.SPListItemCollection.get_Item(Int32 iIndex) <br /> at Microsoft.SharePoint.SPListItem.EnsureItemIsValid() <br /> at Microsoft.SharePoint.SPListItem.GetValue(SPField fld, Int32 columnNumber, Boolean bRaw, Boolean bThrowException) <br /> at Microsoft.SharePoint.SPListItem.GetValue(String strName, Boolean bThrowIfValueMissing, Boolean bThrowIfFieldMissing) <br /> at Microsoft.SharePoint.SPListItem.GetValue(String strName) <br /> at Microsoft.SharePoint.SPListItem.get_File() <br /> at Microsoft.SharePoint.WebControls.SaveButton.SaveItem(SPContext itemContext, Boolean uploadMode, String checkInComment) <br /> at Microsoft.SharePoint.WebControls.SaveButton.SaveItem() <br /> at Microsoft.SharePoint.WebControls.SaveButton.OnBubbleEvent(Object source, EventArgs e) <br /> at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) <br /> at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) <br /> at System.Web.UI.Page.HandleError(Exception e) <br /> at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) <br /> at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) <br /> at System.Web.UI.Page.ProcessRequest() <br /> at System.Web.UI.Page.ProcessRequest(HttpContext context) <br /> at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() <br /> at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)</span><br />
<div class="post-body entry-content">
<h3>
Let's Debug Some Microsoft Code!</h3>
Using various tools such as Redgate's Reflector VS Pro and SQL Profiler to step through SharePoint's code, I managed to find why an exception always occurs after you break inheritance on an item. Reflector was particularly useful as I could step through Microsoft's code and see all the variables as if it was my own. <br />
<br />
To get this debugging working, I followed this article on the Redgate site: <a href="http://documentation.red-gate.com/display/REF8/Debugging+into+SharePoint+and+seeing+the+locals"><span style="color: #ff9900;">http://documentation.red-gate.com/display/REF8/Debugging+into+SharePoint+and+seeing+the+locals</span></a>. Essentially, you need to make 2 changes to debug the SharePoint code:<br />
<br />
1) Run regedit from the Run menu HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment and add a string entry of COMPLUS_ZAPDISABLE, with a value of 1<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1Xj5HtWXzkackF3JYftr1tCvrsHOWzopXE2wstZUlXxmAyrmHpbeEv7TH5Pkgb9HBdNxIhxIB_wLWjI_EKIxBdSl2YGzuPkkNxjxe8RnM66rZV8UsWjS-Yblbhk3IoeWqpqQr03mA4Jw/s1600/COMPLUS_ZAPIDISABLE.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="161" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1Xj5HtWXzkackF3JYftr1tCvrsHOWzopXE2wstZUlXxmAyrmHpbeEv7TH5Pkgb9HBdNxIhxIB_wLWjI_EKIxBdSl2YGzuPkkNxjxe8RnM66rZV8UsWjS-Yblbhk3IoeWqpqQr03mA4Jw/s320/COMPLUS_ZAPIDISABLE.png" width="320" /></a></div>
<br />
2) To stop the code being optimized away and to see the local variables in Visual Studio, you also need to add an ini file in the SharePoint assembly directory (you can find this out via the modules window when in debug mode) e.g.C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.SharePoint\v4.0_15.0.0.0__71e9bce111e9429c\Microsoft.SharePoint.dll<br />
<br />
The ini file should be called <b>Microsoft.SharePoint.ini</b> with the following contents:<br />
[.NET Framework Debugging Control]<br />
GenerateTrackingInfo=1<br />
AllowOptimize=0<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxApFEMSprJZ2NXvva_DBYC_E7eT4LZD_TWnpaKrpDpeuLItQlp6pfudBnnv2E4n2HLlL5ue0tGk7T2nYuYpujnnqDZzl0MIJpbuwNifewV3OjFKUij9EMdIoBtzJLV0PfF5WMBoluAGc/s1600/Microsoft.SharePoint.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="87" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxApFEMSprJZ2NXvva_DBYC_E7eT4LZD_TWnpaKrpDpeuLItQlp6pfudBnnv2E4n2HLlL5ue0tGk7T2nYuYpujnnqDZzl0MIJpbuwNifewV3OjFKUij9EMdIoBtzJLV0PfF5WMBoluAGc/s320/Microsoft.SharePoint.png" width="320" /></a></div>
<br />
<br />
<h3>
Why does this happen?</h3>
<br />
You will always get an exception (with no way to handle it) because the properties.ListItem and properties.ListItem.File are invalidated by the BreakRoleInheritance() call. This occurs in the Update() call within the SaveButton.cs code in SharePoint 2013. I assume the code was also the same in 2010.<br />
<br />
Because a CheckIn is attempted after the Update() code, against the file, the properties.ListItem.File will always throw the exceptions you see above. <br />
<br />
You can see this in the code screenshot of the Microsoft SaveButton code below. Because BreakRoleInheritance invalidates the item during the update (because the SharePoint callback SQL code can't find the item), the CheckIn line will always get an exception.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXg-BIN_s9EagvZMZNaQkYQW0D2XO-Uuimmag2nNJDC4LzObCB_T6wplhmcisD3i2FT97MFJ-ERimZ4LNf3Wn8xAwUEDkJgNsd2TYO4ylM2m19hFsx_hSDdd3Y9TBDr_cikzyPl5OBk4I/s1600/CheckinCode.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="212" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXg-BIN_s9EagvZMZNaQkYQW0D2XO-Uuimmag2nNJDC4LzObCB_T6wplhmcisD3i2FT97MFJ-ERimZ4LNf3Wn8xAwUEDkJgNsd2TYO4ylM2m19hFsx_hSDdd3Y9TBDr_cikzyPl5OBk4I/s320/CheckinCode.png" width="320" /></a></div>
<br />
<br />
The screenshot below shows the call (which goes to an external COM component, and then to SQL). This callback returns zero records.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheLe62nLh3P-U7Z7kSBNjyUCPUO9elflVWe1iQXQKfqZ-CdNrLIgOSxhG1QpEt1vVWx3R0sx21ro7gzbH1Env_3xHR2VZc7T4bNXnwXqEi-JRauZ_tf3wiot1CuyWzZ4gCmZaOFzUmvDs/s1600/CallBackWhichReturnsZero.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="81" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheLe62nLh3P-U7Z7kSBNjyUCPUO9elflVWe1iQXQKfqZ-CdNrLIgOSxhG1QpEt1vVWx3R0sx21ro7gzbH1Env_3xHR2VZc7T4bNXnwXqEi-JRauZ_tf3wiot1CuyWzZ4gCmZaOFzUmvDs/s320/CallBackWhichReturnsZero.png" width="320" /></a></div>
<br />
<br />
The External Call to GetListItemDataWithCallback2():<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHDe6YMLotmtMxLL0bETvckRyzbYyChOtdVztiqL-QJdlModyF-ZvoX73Ot745J19WSJvmq_vZwIVz9-4NzsNm9cpY49YxWXV6hFc6_vYnQOUKJndGnKP91M5CWAGCnVeQ02EzAprF71E/s1600/ExternalCall.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="103" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHDe6YMLotmtMxLL0bETvckRyzbYyChOtdVztiqL-QJdlModyF-ZvoX73Ot745J19WSJvmq_vZwIVz9-4NzsNm9cpY49YxWXV6hFc6_vYnQOUKJndGnKP91M5CWAGCnVeQ02EzAprF71E/s320/ExternalCall.png" width="320" /></a></div>
<br />
If you run SQL Profiler at the same time, you will see that the SQL query is too specific and excludes the item on which you just Broke Role Inheritance.<br />
<br />
<br />
After the call to SQL (which failed to retrieve the item and returns an array of zero length), an index is used on an array assuming that there is a record there. The index is out of the bounds of the array, and so fails with an exception. This is where the invalid index call occurs (during the Save Button <br />
CheckIn() call):<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZGEpk0gKUdfUg8L1oDooHVuPzdVHjn1PrWOLQQNzqijCvcfc5oQExAnCSE8ASzsEM5Tiq_-i5K1S27LlMxJpJ8BYgHATxZtlIVK5W6ZFpsANA89y6WlwPr9NzwJhxNUHJuGdNFLqJ5FQ/s1600/CallBackWithZero2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="142" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZGEpk0gKUdfUg8L1oDooHVuPzdVHjn1PrWOLQQNzqijCvcfc5oQExAnCSE8ASzsEM5Tiq_-i5K1S27LlMxJpJ8BYgHATxZtlIVK5W6ZFpsANA89y6WlwPr9NzwJhxNUHJuGdNFLqJ5FQ/s640/CallBackWithZero2.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
The SQL that returns no records (and why the array is empty) is as below:<br />
<br />
exec sp_executesql N' SELECT t3.[nvarchar12] AS c15c10, t1.[SortBehavior] AS c0, UserData.[nvarchar10], UserData.[tp_ItemOrder], UserData.[nvarchar1], t1.[FolderChildCount] AS c31, t1.[ParentLeafName] AS c36, t2.[nvarchar4] AS c3c6, UserData.[ntext1], UserData.[nvarchar14], t4.[nvarchar6] AS c22c7, UserData.[tp_AppAuthor], t2.[tp_Created] AS c3c11, t3.[nvarchar6] AS c15c7, t1.[ProgId] AS c18, UserData.[nvarchar19], UserData.[tp_AppEditor], t1.[Type] AS c13, UserData.[tp_ID], t1.[ScopeId] AS c21, UserData.[nvarchar5], UserData.[bit1], t1.[ClientId] AS c26, UserData.[tp_GUID], t1.[TimeCreated] AS c1, UserData.[tp_Editor], t2.[nvarchar11] AS c3c9, UserData.[tp_Author], t4.[tp_ID] AS c22c5, t4.[nvarchar3] AS c22c12, t2.[nvarchar1] AS c3c4, t3.[tp_Created] AS c15c11, UserData.[nvarchar13], UserData.[nvarchar18], t1.[CheckinComment] AS c29, t3.[tp_ID] AS c15c5, CASE WHEN DATALENGTH(t1.DirName) = 0 THEN t1.LeafName WHEN DATALENGTH(t1.LeafName) = 0 THEN t1.DirName ELSE t1.DirName + N''/'' + t1.LeafName END<span style="mso-spacerun: yes;"> </span>AS c16, UserData.[tp_ContentTypeId], t1.[Size] AS c24, UserData.[tp_WorkflowVersion], t1.[ETagVersion] AS c37, UserData.[nvarchar4], UserData.[tp_CheckoutUserId], UserData.[tp_Version], UserData.[nvarchar9], t4.[nvarchar9] AS c22c8, t5.[nvarchar1] AS c4, UserData.[tp_IsCurrentVersion], t2.[nvarchar6] AS c3c7, UserData.[tp_HasCopyDestinations], UserData.[tp_Level], UserData.[nvarchar12], UserData.[nvarchar17], t4.[nvarchar12] AS c22c10, t2.[nvarchar3] AS c3c12, t1.[TimeLastModified] AS c14, t3.[nvarchar9] AS c15c8, t1.[MetaInfo] AS c19, t1.[Size] AS c27, t1.[ParentVersionString] AS c35, t1.[LeafName] AS c2, UserData.[nvarchar3], UserData.[tp_Modified], UserData.[nvarchar8], t4.[nvarchar4] AS c22c6, UserData.[tp_UIVersion], t1.[ItemChildCount] AS c30, t2.[tp_ID] AS c3c5, t3.[nvarchar3] AS c15c12, UserData.[tp_CopySource], UserData.[nvarchar11], UserData.[nvarchar16], t7.[Title] AS c34c33, UserData.[tp_InstanceID], t2.[nvarchar12] AS c3c10, t3.[nvarchar4] AS c15c6, t1.[IsCheckoutToLocal] AS c17, t1.[LTCheckoutUserId] AS c25, t6.[Title] AS c32c33, UserData.[tp_UIVersionString], t1.[Id] AS c20, UserData.[nvarchar2], UserData.[nvarchar7], t4.[nvarchar11] AS c22c9, t2.[nvarchar9] AS c3c8, UserData.[nvarchar15], t4.[nvarchar1] AS c22c4, t4.[tp_Created] AS c22c11, t3.[nvarchar11] AS c15c9, t3.[nvarchar1] AS c15c4, UserData.[tp_ModerationStatus], UserData.[nvarchar6], UserData.[tp_Created], t1.[DirName] AS c23, UserData.[tp_WorkflowInstanceID] FROM AllUserData AS UserData WITH(FORCESEEK(AllUserData_PK(tp_SiteId,tp_ListID,tp_DeleteTransactionId,tp_IsCurrentVersion))) INNER LOOP JOIN Docs AS t1 WITH(NOLOCK) ON (UserData.[tp_RowOrdinal] = 0) AND (t1.SiteId=UserData.tp_SiteId) AND (t1.SiteId = @SITEID) AND (t1.ParentId = UserData.tp_ParentId) AND (t1.Id = UserData.tp_DocId) AND ( (UserData.tp_Level = 1 OR<span style="mso-spacerun: yes;"> </span>UserData.tp_Level =255) ) AND (t1.Level = UserData.tp_Level) AND ((UserData.tp_Level = 255 AND t1.LTCheckoutUserId =@IU OR (UserData.tp_Level = 1 AND (UserData.tp_DraftOwnerId IS NULL) OR UserData.tp_Level = 2)AND (t1.LTCheckoutUserId IS NULL OR t1.LTCheckoutUserId <> @IU ))) AND (UserData.tp_ListId = @L3 AND UserData.tp_SiteId = @SITEID) AND (UserData.[tp_IsCurrentVersion] = CONVERT(bit,1) ) AND (UserData.[tp_CalculatedVersion] = 0 ) AND (UserData.[tp_DeleteTransactionId] = 0x ) AND (UserData.[tp_ListID] =@LISTID) AND (UserData.[tp_SiteId] =@SITEID) AND (UserData.[tp_CalculatedVersion] = 0 ) AND (UserData.[tp_IsCurrentVersion] = CONVERT(bit,1) ) AND (UserData.[tp_DeleteTransactionId] = 0x ) INNER LOOP JOIN (SELECT CAST(val AS uniqueidentifier) AS InValues FROM dbo.fn_UnpackCsvString(@L4TXP) ) AS Scopes ON (t1.ScopeId = Scopes.InValues) LEFT OUTER LOOP JOIN AllUserData AS t2 WITH(FORCESEEK(AllUserData_PK(tp_SiteId,tp_ListId,tp_DeleteTransactionId,tp_IsCurrentVersion,tp_ID,tp_CalculatedVersion)),NOLOCK) ON (UserData.[tp_Editor]=t2.[tp_ID]) AND (UserData.[tp_RowOrdinal] = 0) AND (t2.[tp_RowOrdinal] = 0) AND ( (t2.tp_Level = 1) ) AND (t2.[tp_IsCurrentVersion] = CONVERT(bit,1) ) AND (t2.[tp_CalculatedVersion] = 0 ) AND (t2.[tp_DeleteTransactionId] = 0x ) AND (t2.tp_ListId = @L5 AND t2.tp_SiteId = @SITEID) AND (UserData.tp_ListId = @L3 AND UserData.tp_SiteId = @SITEID) AND (UserData.[tp_IsCurrentVersion] = CONVERT(bit,1) ) AND (UserData.[tp_CalculatedVersion] = 0 ) AND (UserData.[tp_DeleteTransactionId] = 0x ) LEFT OUTER LOOP JOIN AllUserData AS t3 WITH(FORCESEEK(AllUserData_PK(tp_SiteId,tp_ListId,tp_DeleteTransactionId,tp_IsCurrentVersion,tp_ID,tp_CalculatedVersion)),NOLOCK) ON (UserData.[tp_CheckoutUserId]=t3.[tp_ID]) AND (UserData.[tp_RowOrdinal] = 0) AND (t3.[tp_RowOrdinal] = 0) AND ( (t3.tp_Level = 1) ) AND (t3.[tp_IsCurrentVersion] = CONVERT(bit,1) ) AND (t3.[tp_CalculatedVersion] = 0 ) AND (t3.[tp_DeleteTransactionId] = 0x ) AND (t3.tp_ListId = @L5 AND t3.tp_SiteId = @SITEID) AND (UserData.tp_ListId = @L3 AND UserData.tp_SiteId = @SITEID) AND (UserData.[tp_IsCurrentVersion] = CONVERT(bit,1) ) AND (UserData.[tp_CalculatedVersion] = 0 ) AND (UserData.[tp_DeleteTransactionId] = 0x ) LEFT OUTER LOOP JOIN AllUserData AS t4 WITH(FORCESEEK(AllUserData_PK(tp_SiteId,tp_ListId,tp_DeleteTransactionId,tp_IsCurrentVersion,tp_ID,tp_CalculatedVersion)),NOLOCK) ON (UserData.[tp_Author]=t4.[tp_ID]) AND (UserData.[tp_RowOrdinal] = 0) AND (t4.[tp_RowOrdinal] = 0) AND ( (t4.tp_Level = 1) ) AND (t4.[tp_IsCurrentVersion] = CONVERT(bit,1) ) AND (t4.[tp_CalculatedVersion] = 0 ) AND (t4.[tp_DeleteTransactionId] = 0x ) AND (t4.tp_ListId = @L5 AND t4.tp_SiteId = @SITEID) AND (UserData.tp_ListId = @L3 AND UserData.tp_SiteId = @SITEID) AND (UserData.[tp_IsCurrentVersion] = CONVERT(bit,1) ) AND (UserData.[tp_CalculatedVersion] = 0 ) AND (UserData.[tp_DeleteTransactionId] = 0x ) LEFT OUTER LOOP JOIN AllUserData AS t5 WITH(FORCESEEK(AllUserData_PK(tp_SiteId,tp_ListId,tp_DeleteTransactionId,tp_IsCurrentVersion,tp_ID,tp_CalculatedVersion)),NOLOCK) ON (t1.[LTCheckoutUserId]=t5.[tp_ID]) AND (t5.[tp_RowOrdinal] = 0) AND ( (t5.tp_Level = 1) ) AND (t5.[tp_IsCurrentVersion] = CONVERT(bit,1) ) AND (t5.[tp_CalculatedVersion] = 0 ) AND (t5.[tp_DeleteTransactionId] = 0x ) AND (t5.tp_ListId = @L5 AND t5.tp_SiteId = @SITEID) LEFT OUTER LOOP JOIN AppPrincipals AS t6 WITH(NOLOCK) ON (UserData.[tp_AppAuthor]=t6.[Id]) AND (UserData.[tp_RowOrdinal] = 0) AND (t6.SiteId = @SITEID) AND (UserData.tp_ListId = @L3 AND UserData.tp_SiteId = @SITEID) AND (UserData.[tp_IsCurrentVersion] = CONVERT(bit,1) ) AND (UserData.[tp_CalculatedVersion] = 0 ) AND (UserData.[tp_DeleteTransactionId] = 0x ) LEFT OUTER LOOP JOIN AppPrincipals AS t7 WITH(NOLOCK) ON (UserData.[tp_AppEditor]=t7.[Id]) AND (UserData.[tp_RowOrdinal] = 0) AND (t7.SiteId = @SITEID) AND (UserData.tp_ListId = @L3 AND UserData.tp_SiteId = @SITEID) AND (UserData.[tp_IsCurrentVersion] = CONVERT(bit,1) ) AND (UserData.[tp_CalculatedVersion] = 0 ) AND (UserData.[tp_DeleteTransactionId] = 0x ) WHERE (UserData.[tp_CalculatedVersion] = 0 ) AND (UserData.[tp_IsCurrentVersion] = CONVERT(bit,1) ) AND (UserData.[tp_DeleteTransactionId] = 0x ) AND (UserData.tp_ListID=@LISTID) AND (UserData.tp_SiteId=@SITEID) AND ( (UserData.tp_Level = 1 OR<span style="mso-spacerun: yes;"> </span>UserData.tp_Level =255)<span style="mso-spacerun: yes;"> </span>AND ( UserData.tp_Level= 255 AND UserData.tp_CheckoutUserId = @IU OR<span style="mso-spacerun: yes;"> </span>( UserData.tp_Level<span style="mso-spacerun: yes;"> </span>= 2 AND UserData.tp_DraftOwnerId IS NOT NULL OR UserData.tp_Level<span style="mso-spacerun: yes;"> </span>= 1 AND UserData.tp_DraftOwnerId IS<span style="mso-spacerun: yes;"> </span>NULL<span style="mso-spacerun: yes;"> </span>) AND ( UserData.tp_CheckoutUserId IS<span style="mso-spacerun: yes;"> </span>NULL<span style="mso-spacerun: yes;"> </span>OR UserData.tp_CheckoutUserId <> @IU))) AND (UserData.tp_RowOrdinal=0) AND ((UserData.[tp_ID] = @II)) ORDER BY t1.[SortBehavior]<span style="mso-spacerun: yes;"> </span>DESC ,UserData.[tp_ID]<span style="mso-spacerun: yes;"> </span>ASC<span style="mso-spacerun: yes;"> </span>OPTION (FORCE ORDER, MAXDOP 1)',N'@LFFP uniqueidentifier,@SITEID uniqueidentifier,@IU int,@L3 uniqueidentifier,@L4TXP nvarchar(4000),@L5 uniqueidentifier,@II int,@LISTID uniqueidentifier,@RequestGuid uniqueidentifier',@LFFP='00000000-0000-0000-0000-000000000000',@SITEID='DC59B5ED-EF2E-4701-89A5-88057D449776',@IU=10,@L3='5E68F1D8-4EF0-4375-9433-246368FC6E2C',@L4TXP=N'{32C47E39-1A7E-4949-9A71-CEBA54BE5AC7},{882F0725-834F-48F0-95F4-FDA490367003},{4AE1520E-ACF9-4014-BDB8-4F0C897ECD6A},{7D93E0FA-FF19-4E3A-A344-378A5E8DFD4E},{5DC69BCF-2778-4AFD-B4E9-FCAAC84AA40F},{5FCA1571-0643-4467-8067-9E24CA271EBE}',@L5='70002672-8F36-4F40-BB22-7AD9D75923F9',@II=332,@LISTID='5E68F1D8-4EF0-4375-9433-246368FC6E2C',@RequestGuid='8F43499C-ADFE-1030-7AAF-EE92CFD86881'<br />
<br />
<b>The Problem In Summary:</b><br />
1) Your BreakRoleInheritance() call in code makes another call to the SharePoint stored procedure proc_SecRemovePrincipalFromScope<br />
2) proc_SecRemovePrincipalFromScope updates values that are specifically filtered for in the SQL generated by SaveButton.cs for the properties.ListItem.File call<br />
3) Because the query returns an empty array, you will get an out of index exception - even if you try <br />
the properties.InvalidateListItem() or properties.InvalidateWeb() to force a reload.<br />
<br />
<br />
<b>The Fix:</b><br />
<br />
If you look at the decompiled SharePoint Save Button code, you may notice that there is a Non-fatal error handler at the end. You can essentially short-circuit the CheckIn() call (that is causing the exceptions against the "missing" object in the empty array) by setting the SPItemEventProperties Event Receiver to SPEventReceiverStatus.CancelNoError in the CheckingIn() override like so:<br />
<pre class="csharp" name="code"> /// <summary>
/// An item is being checked in.
/// </summary>
public override void ItemCheckingIn(SPItemEventProperties properties)
{
//For document libraries, need to do Role Inheritance on Checking in.
ProcessMetadataChange(properties, SPEventReceiverType.ItemCheckingIn);
properties.Status = SPEventReceiverStatus.CancelNoError;
//base.ItemCheckingIn(properties);
} </pre>
<br />
You then do the CheckIn() call in the code yourself rather than rely on SharePoint to do it for you. You can see our entry point in the screenshot below - which means we can Cancel the CheckIn Event and effectively prevent the code that causes exceptions against the expired/invalidated objects in SaveButton from being processed:
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr4Rs3N3nmDthRFEU8Ie-67o4DIY6GxpnQLv7g8QKeekBv1kaTKiZWjXNKYe4fsMpEc9mO6dA-FcTVyWcB1eWdoFT119AZPyXSyXM97l-0-Hvhve2UH2KTtOWKHMewmitJb9-zVJlStag/s1600/EntryPoint.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="248" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr4Rs3N3nmDthRFEU8Ie-67o4DIY6GxpnQLv7g8QKeekBv1kaTKiZWjXNKYe4fsMpEc9mO6dA-FcTVyWcB1eWdoFT119AZPyXSyXM97l-0-Hvhve2UH2KTtOWKHMewmitJb9-zVJlStag/s320/EntryPoint.png" width="320" /></a></div>
<br />
When we set the properties.Status to CancelNoError, the code jumps to this soft goto handler and doesn't throw an exception like so:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSoYPowD0ma6FYlWCgCDV0VABmEWRsaJDvndUGwvPDCbeDMFpn7QzXjFjMXi0nJ-rjW4ZpA4LrT1I7VXqmAtMdRTdhOtqUYpra8i6PWcl6ohRFZNpzuQbsXhlh5qKyQ2cB-L31TRNQixk/s1600/SoftErrorHandler.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="165" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSoYPowD0ma6FYlWCgCDV0VABmEWRsaJDvndUGwvPDCbeDMFpn7QzXjFjMXi0nJ-rjW4ZpA4LrT1I7VXqmAtMdRTdhOtqUYpra8i6PWcl6ohRFZNpzuQbsXhlh5qKyQ2cB-L31TRNQixk/s320/SoftErrorHandler.png" width="320" /></a></div>
<br />
<br />
DDK</div>
David Kleinhttp://www.blogger.com/profile/13657389334766989234noreply@blogger.com3tag:blogger.com,1999:blog-7130587409577087282.post-44124218357805148962013-06-21T13:43:00.000+10:002013-06-21T13:49:36.876+10:00SharePoint 2013 - Custom Field Type Controls - How can I use the JSLink Property for Rendering in the List View, but still Use Server Controls (e.g. Telerik Controls) for Edit and Display View?You may know that in SharePoint 2013, you can now control how a field renders completely by using JavaScript via the new JSLink Property on field controls. An example of this can be found on MSDN at <a href="http://msdn.microsoft.com/en-us/library/jj163799.aspx" target="_blank">"How to: Extend the Geolocation field type using client-side rendering"</a>. What if you want to do JavaScript rendering for just the list view - and use fully featured controls for editing and item display?<br />
<br />
This is not documented anywhere (I found this by trial and error and some help from .NET Reflector - <a href="http://www.red-gate.com/products/dotnet-development/reflector/">http://www.red-gate.com/products/dotnet-development/reflector/</a>) - but you can actually have both the JSLink render your field in your SharePoint list view and take full advantage of server rendering of controls (e.g. using Telerik AutoComplete for Token Selection) at the same time.<br />
<br />
You can do this by <strong>overriding </strong>the JSLink property in your Field class (inheriting from SPField) as below so that it renders your full controls for Display/Edit and renders your JSLink for viewing in a list:<br />
<br />
<pre class="csharp" name="code"> public override string JSLink
{
get
{
if (SPContext.Current != null && SPContext.Current.FormContext.FormMode == SPControlMode.Invalid)
return "../_layouts/15/MyProjectName/CustomFieldControl.js";
else
{
return string.Empty;
}
}
set
{
base.JSLink = value;
}
}
</pre>
As above, this looks at the current SPContext to determine whether it is currently rendering in the list view (and renders the JSLink property) - otherwise, it just uses the default server control rendering behaviour.<br />
<br />
<strong>DDK</strong>David Kleinhttp://www.blogger.com/profile/13657389334766989234noreply@blogger.com0tag:blogger.com,1999:blog-7130587409577087282.post-1323525466656610672013-06-21T13:22:00.002+10:002013-06-21T13:46:08.609+10:00SharePoint 2013 - Why do my Custom Field Type Controls Seem to be Cached and keep Loading Up An Old Version? Some Gotchas for SharePoint Custom Field TypesWhen creating custom Field Types in SharePoint 2013 (see <a href="http://msdn.microsoft.com/en-us/library/jj901637.aspx">http://msdn.microsoft.com/en-us/library/jj901637.aspx</a> for examples), there are several steps you need to take to register it with SharePoint. These are all convention-based. <br />
<br />
<ol>
<li>You must create a file called fldtypes_<strong><em>MYFIELDNAME</em></strong>Field.xml e.g. fldTypes_ParentField if you want to add a field called "Parent". SharePoint will pick this field up based on this naming convention for your file.</li>
<li>You need to deploy a user control (e.g. ParentFieldControl.ascx) to the SharePoint HIVE Control Templates directory (it <strong>will not work in a subdirectory</strong>).</li>
<li>Within the ascx files, you should Specify a rendering Template like so:</li>
</ol>
<pre class="xml" name="code"><SharePoint:RenderingTemplate ID="ParentFieldControl" runat="server">
<Template>
<div class="customFieldType">
<telerik:RadAutoCompleteBox runat="server" ID="autoCompleteTextBox" CssClass="customFieldControlParentGroupList" Filter="Contains" DropDownHeight="400" DropDownWidth="375" InputType="Token" Delimiter='<%# Constants.DefaultDelimiter %>' DataTextField="Text" ToolTip='<%# DataBinder.Eval(Container.DataItem, "Description")%>' DataValueField="Value">
<DropDownItemTemplate>
</pre>
Problem is, I did this and deployed my solution and my changes were not being propagated when my updated custom field was rendered within SharePoint. I tried a few things:
<br />
<br />
<ol>
<li>Deleting the field from all lists and the Site fields collection in SharePoint with SharePoint Designer and/or the free tool SharePoint Manager 2013</li>
<li>Removing the Custom Field</li>
<li>Rebooting </li>
</ol>
Yet my changes weren't being reflected when I deployed the new version.
What was going on? Was it some kind of weird caching that persisted between reboots? <br />
<br />
What is not clear from the documentation is that the Rendering Template Id MUST be unique between all controls that you deploy as a custom field type. I was REUSING the same <strong>DefaultTemplateName</strong> and <strong>DisplayTemplateName</strong> between all controls (following the DRY principle). <br />
<br />
I originally thought that it was loading up my control based on the NAME of the ascx control e.g. fieldTypes_ParentField would (by convention) load up the ParentFieldControl.ascx file to perform rendering for that field. This is NOT the case.
Instead, the when you override the "DefaultTemplateName" or "DisplayTemplateName" properties on "Microsoft.SharePoint.WebControls.BaseFieldControl", you must ensure that these values have not been used elsewhere by custom fields in your project - otherwise SharePoint will keep picking up the first control it finds with a matching "DefaultTemplateName" or "DisplayTemplateName".
<br />
<br />
Now because I was reusing the same Template Name between all controls within my ascx files, it was rendering the first control it happened to find - without throwing an exception!
<br />
<br />
Be warned.
<br />
<br />
<b>DDK</b>
David Kleinhttp://www.blogger.com/profile/13657389334766989234noreply@blogger.com2tag:blogger.com,1999:blog-7130587409577087282.post-64953787762592979732013-06-13T22:41:00.003+10:002013-07-09T13:42:09.607+10:00Outlook 2013 Bug when using IMAP - Beware the Bandwidth Blowout!We recently had issues with our work internet connection that meant sizeable amounts of data were being chewed up without our users doing anything in particular or untoward.<br />
<br />
Using the bandwidth monitor utility <b>Networx </b>(<a href="http://www.softperfect.com/products/networx/">http://www.softperfect.com/products/networx/</a>) (which breaks accumulated traffic down by process), we specifically found that <b>Outlook 2013 </b>was downloading large amounts of data (40-50MB) - <i><b>many (but not all) </b></i>times that a "Send and Receive" synch was performed. This was using IMAP running against the open source <b>DoveCot</b> (<a href="http://www.dovecot.org/">http://www.dovecot.org/</a>) as a mail server.<br />
<br />
Now by default, this is set to every 30 minutes. If a machine is on 24 hours day, this can add up to 2.4GB per user - which clogs up your network and really adds up on anything but an unlimited plan!<br />
<br />
Cracking open <b>Wireshark</b> (<a href="http://www.wireshark.org/">http://www.wireshark.org/</a>), I turned off SSL to see what was going on in terms of the IMAP commands going down the wire and the full extent of the download. Nothing stuck out apart from the fact that setting the "Mail to keep offline setting" to 24 months as below performs an IMAP "UID SEARCH SINCE 13-Jun-2011" to filter results. This is as expected.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZsrvHmHoD-OvqIorRtj7xLbgaZtAubObS1Pvwb9k3xuZe1PLRNnCgu6jnlrXNjN6yBbQd-FaXarlmOPVqFhZ7oe8hrG1vfCdXwoMcEQ7ov0gMx2_xfU_BhEOJxi1sk4UJCuXWPYyD6vA/s1600/Outlook2013Bandwidth.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="333" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZsrvHmHoD-OvqIorRtj7xLbgaZtAubObS1Pvwb9k3xuZe1PLRNnCgu6jnlrXNjN6yBbQd-FaXarlmOPVqFhZ7oe8hrG1vfCdXwoMcEQ7ov0gMx2_xfU_BhEOJxi1sk4UJCuXWPYyD6vA/s400/Outlook2013Bandwidth.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
To my surprise, with the default "All" Setting for "Mail to keep offline", you can also see that on regular but apparently random occasions every single email (including ALL content and ALL binaries) was being downloaded every time from the mail server - regardless of whether Outlook already had a locally cached version or not. Sometimes, the download will only be 5MB per click of "Send and Receive All". I tried to reproduce it and it tends to happen when you save Drafts or send/receive large items in your inbox - but I wasn't able to isolate the issue through a process of elimination.<br />
<br />
This may well be part of the OST corruption issues mentioned here - the IMAP issues in Outlook 2013 are apparently high on the MS internal support agenda:<br />
<a href="http://productforums.google.com/forum/#!topic/gmail/9alMlaOkMC4">http://productforums.google.com/forum/#!topic/gmail/9alMlaOkMC4</a><br />
<br />
In terms of the mail server, the installed version of <b>Dovecot </b>also seems to support LIST-EXTENDED for special folder support introduced in Outlook 2013 - so that doesn't appear to be the problem (unless there is a variation on the standard between Outlook/the IMAP server - which is not impossible).<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-Lv0m5MX00ySbXb79dTHVt5p6fDn1OHCsh2qOUSdZenoknEv_BNakr-ROKG8AdAd0Tcr5miS1ghzCUElKUYG0N9vArS4_0puxZa_8IlQZ6keUvN3VEZVvhH4UzMjJCEdiVU-N9g9wZG4/s1600/DoveCotCompatability.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="152" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-Lv0m5MX00ySbXb79dTHVt5p6fDn1OHCsh2qOUSdZenoknEv_BNakr-ROKG8AdAd0Tcr5miS1ghzCUElKUYG0N9vArS4_0puxZa_8IlQZ6keUvN3VEZVvhH4UzMjJCEdiVU-N9g9wZG4/s640/DoveCotCompatability.png" width="640" /></a></div>
<br />
<b>So no clear conclusions I'm afraid. </b>The one thing that is clear is that there are problems with Outlook 2013 and IMAP - based on the large number of problems I've seen floating around the web. The above problem is just one example of these. I've also seen that Outlook 2013 sometimes doesn't download new emails at all (even though other clients such as Android download from the same mail server correctly.). In addition, when working with drafts and saving the draft email repeatedly, Outlook will not be able to save it and say that it must be saved as a new copy within your Drafts folder.<br />
<br />
Apparently, a fix to some of these problems should be released around August 2013 (as per <a href="http://productforums.google.com/forum/#!topic/gmail/9alMlaOkMC4">http://productforums.google.com/forum/#!topic/gmail/9alMlaOkMC4</a>)<br />
<br />
<b>In the meantime, to fix the heavy bandwidth usage issue, I can only suggest:</b><br />
<ol>
<li><b>Roll back to Outlook 2010</b> if you're using IMAP . This seems to be a
popular option - although you cannot have Outlook 2013 and 2010 running
simultaneously (unlike other MS Office Products). <span style="color: #6aa84f;">[Recommended - this worked in my situation and reduced synch bandwidth usage from 50MB to 850KB]</span></li>
<li>Perform a full initial synchronisation with the default "All" setting. Then reduce your "Mail to keep offline" time window to a smaller figure after this initial synchronization (e.g. 1 month) </li>
<li>Delete your local OST file and set up email again. This may give you temporary relief from the problem - but it wasn't a permanent fix for me.</li>
<li>Use yet another client like Thunderbird - although this apparently also has issues with non-appearing folders with some IMAP providers as well.</li>
<li>Reduce your synchronisation frequency (to something less than 30 minute full synchs). </li>
<li>Update your mail server if possible to ensure full compliance with standards. This isn't an option for me. You should also confirm this with a pilot/Proof of Concept to confirm that it fixes your specific issue.</li>
<li>Clean out/auto-archive your emails!</li>
</ol>
<br />
<b>DDK</b>David Kleinhttp://www.blogger.com/profile/13657389334766989234noreply@blogger.com88