<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>"I'm workin' here..."</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/chrischiaro/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/chrischiaro/feed.xml</link>
    <description>News and notes on development, working in IT, and other interests.</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:21:35 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Using Azure MobileServiceClient throws "The request could not be completed. (Method Not Allowed)" exception</title>
      <link>https://docs.microsoft.com/archive/blogs/chrischiaro/using-azure-mobileserviceclient-throws-the-request-could-not-be-completed-method-not-allowed-exception</link>
      <pubDate>Sun, 04 Jan 2015 10:50:00 GMT</pubDate>
      <dc:creator><![CDATA[chrischiaro]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/chrischiaro/2015/01/04/using-azure-mobileserviceclient-throws-the-request-could-not-be-completed-method-not-allowed-exception/</guid>
      <description><![CDATA[In case anyone else runs into this:
I'm working with the...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: verdana,geneva; font-size: small;">In case anyone else runs into this:</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">I'm working with the <em>Microsoft.WindowsAzure.MobileServices.MobileServiceClient </em>class, trying to call a mobile API I've set up in--where else--an Azure Mobile Service instance.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">My call looks something like this:</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: small;">JToken response = await _mobileClient.InvokeApiAsync("myapimethodname");</span></p>
<p>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;">And I'm trying to call an API containing pretty standard Node.js script that starts out like this:</span></p>
<p>&nbsp;</p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: small;"><span style="color: #0000ff;">var</span> azure = require('<span style="color: #ff0000;">azure</span>')<br />&nbsp; </span><span style="font-family: courier new,courier; font-size: small;">, qs = require('<span style="color: #ff0000;">querystring</span>');</span></p>
<p style="padding-left: 30px;"><span style="color: #008000; font-family: courier new,courier; font-size: small;">/* Issued by Raspberry Pi:<br /></span><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; <a href="https://[blank].azure-mobile.net/api/photos">https://[blank].azure-mobile.net/api/photos</a></span><span style="font-family: courier new,courier; font-size: small;"><br />&nbsp;&nbsp;&nbsp; <span style="color: #008000;">With headers = "X-ZUMO-APPLICATION: [mobile_services_app_key]"</span><br /></span><span style="font-family: courier new,courier; font-size: small;"><span style="color: #008000;">&nbsp;&nbsp;&nbsp; Header contains the application key</span><br /></span><span style="color: #008000; font-family: courier new,courier; font-size: small;">*/</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: small;">exports.get = <span style="color: #0000ff;">function</span>(request, response) {<br /></span><span style="font-family: courier new,courier; font-size: small;">&hellip;</span></p>
<p>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;">Now, I've already successfully used this API using an <em>HttpWebRequest</em> and some code like this:<br /></span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: small;">WebRequest r = WebRequest.Create("https://full_api_url_here");</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: small;">r.Method = "GET";</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: small;">r.Headers.Add("X-ZUMO-APPLICATION", "mobile_service_api_key_here");</span></p>
<p style="padding-left: 30px;">&nbsp;</p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: small;">using (var responseStream = r.GetResponse().GetResponseStream()) {</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier; font-size: small;">StreamReader sr = new StreamReader(responseStream);<br /></span><span style="font-family: courier new,courier; font-size: small;">string data = sr.ReadToEnd();<br /></span><span style="font-family: courier new,courier; font-size: small;">&hellip;</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier; font-size: small;">}</span></p>
<p>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;">The point is, I know the API call works, and I figured using the MobileServiceClient class would be a lot easier and cleaner. But I'm getting this odd error.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">I do a little Binging and find <a href="https://azure.microsoft.com/en-us/documentation/articles/mobile-services-how-to-use-server-scripts/">this</a>&nbsp;bit of Azure Mobile Services documentation that states:</span></p>
<p style="padding-left: 30px;"><span style="color: #808080; font-family: tahoma,arial,helvetica,sans-serif; font-size: large;">How to: Implement HTTP methods</span></p>
<p style="padding-left: 30px;"><span style="font-family: trebuchet ms,geneva; font-size: small;">A custom API can handle one or more of the HTTP methods, GET, POST, PUT, PATCH, and DELETE. An <br />exported function is defined for each HTTP method handled by the custom API. A single custom API code <br />file can export one or all of the following functions:</span></p>
<p style="padding-left: 60px;">&nbsp;&nbsp;&nbsp;<br /><span style="font-family: courier new,courier;">exports.<span style="color: #0000ff;">get</span> = <span style="color: #0000ff;">function</span>(request, response) { ... };</span><br /><span style="font-family: courier new,courier;">exports.post = <span style="color: #0000ff;">function</span>(request, response) { ... };</span><br /><span style="font-family: courier new,courier;">exports.patch = <span style="color: #0000ff;">function</span>(request, response) { ... };</span><br /><span style="font-family: courier new,courier;">exports.put = <span style="color: #0000ff;">function</span>(request, response) { ... };</span><br /><span style="font-family: courier new,courier;">exports.<span style="color: #0000ff;">delete</span> = <span style="color: #0000ff;">function</span>(request, response) { ... };</span></p>
<p style="padding-left: 30px;"><span style="font-family: trebuchet ms,geneva; font-size: small;"><span style="background-color: #ffff00;">The custom API endpoint cannot be called using an HTTP method that has not been implemented in the </span><br /><span style="background-color: #ffff00;">server script, and a 405 (Method Not Allowed) error response is returned.</span> Separate permission levels can<br /> be assigned to each support HTTP method.</span></p>
<p>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;">The highlights are mine, so take note. I then look up documentation on the <em><a href="https://msdn.microsoft.com/en-us/library/microsoft.windowsazure.mobileservices.mobileserviceclient.aspx">MobileServiceClient</a></em> class and find this:</span></p>
<div>
<table style="width: 834px; height: 56px;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<p><a href="https://msdn.microsoft.com/en-us/library/dn268385.aspx">InvokeApiAsync(String)</a></p>
</td>
<td>
<p>Invokes a&nbsp;user-defined custom API of a Windows Azure <br />Mobile Service <span style="background-color: #ffff00;">using an HTTP POST.</span></p>
</td>
</tr>
</tbody>
</table>
</div>
<p>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;">Again, the highlights are mine. Interesting.&nbsp;</span>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;">Finally, looking back at my script, I realize <em>I've only implemented GET functionality.</em></span></p>
<p>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;">Bingo.</span></p>
<p>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;">My solution? I changed the API code like so:</span></p>
<p style="padding-left: 30px;"><span style="color: #0000ff; font-family: courier new,courier; font-size: small;">function <span style="color: #000000;">myApi(request, response) {</span></span></p>
<p style="padding-left: 60px;"><span style="color: #0000ff; font-family: courier new,courier; font-size: small;"><span style="color: #000000;">...</span></span></p>
<p style="padding-left: 30px;"><span style="color: #0000ff; font-family: courier new,courier; font-size: small;"><span style="color: #000000;">}</span></span></p>
<p style="padding-left: 30px;"><span style="color: #0000ff; font-family: courier new,courier; font-size: small;"><span style="color: #000000;">exports.<span style="color: #0000ff;">get</span> = myApi;<br />exports.post = myApi;</span></span></p>
<p>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;">Pretty? No. But it works and it's resulted in much simpler code.</span></p>]]></content:encoded>
    </item>
    <item>
      <title>Programmatically setting Record Declaration settings in SP2010</title>
      <link>https://docs.microsoft.com/archive/blogs/chrischiaro/programmatically-setting-record-declaration-settings-in-sp2010</link>
      <pubDate>Wed, 05 Mar 2014 12:23:22 GMT</pubDate>
      <dc:creator><![CDATA[chrischiaro]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/chrischiaro/2014/03/05/programmatically-setting-record-declaration-settings-in-sp2010/</guid>
      <description><![CDATA[Needed to programmatically ensure that Record Declaration settings were set for a customer’s site...]]></description>
      <content:encoded><![CDATA[<p><font size="2">Needed to programmatically ensure that Record Declaration settings were set for a customer’s site template. </font></p>  <p><font size="2">Found this blog entry: </font><a href="https://sharepointfieldnotes.blogspot.com/2010/08/making-your-sharepoint-2010.html"><b><font size="2">https://sharepointfieldnotes.blogspot.com/2010/08/making-your-sharepoint-2010.html</font></b></a></p>  <p><font size="2">To summarize the information in the blog entry:</font></p>  <ul>   <li><font size="2">Allowing manual records declaration for all site in a Site Collection is done in the Site Collection Settings, under the “Record declaration settings” topic. </font></li>    <ul>     <li><font size="2">On the settings page, the “Record Declaration Availability” section allows an admin to turn <strong>manual record declaration</strong> on by default for all sub-sites.</font></li>      <li><font size="2">In the “Declaration Roles” section: if you select the “Only policy actions” option then manual record declaration will <em>not </em>be allowed. Selecting either of the other two options (“All list contributors and administrators” or “Only list administrators”) allows manual declaration.</font></li>   </ul>    <li><font size="2">A <strong>Document library administrator</strong> can override the settings from the SPSite level using the record declaration settings for a specific library.</font></li>    <li><font size="2">You have to reference the <strong><em>Microsoft.Office.Policy</em> assembly </strong>(in the GAC or in the ISAPI folder in the 14 hive) to get at the object model required to check some of the settings for Records Declaration.</font></li>    <li><font size="2">To check if the feature is enabled, use <em>Records.IsInPlaceRecordsEnabled(SPList.ParentWeb.Site)</em>.</font></li>    <li><font size="2">To check if manual declaration is set for an SPWeb, check for and read the <em>SPWeb.Properties[“<strong>ecm_SiteRecordDeclarationDefault&quot;</strong>”] </em>property. <strong>If the value is <em>true</em>, manual declaration is enabled by default</strong>.</font></li>    <li><font size="2">To check if a list is using list-specific settings, check for and read the value of <em>SPList.RootFolder.Properties[“<strong>ecm_IPRListUseListSpecific</strong>”]</em>. If <em>true</em>, well, the list uses list-specific settings.</font></li>    <li><font size="2">To check if Manual Declaration is enabled <em>in a specific list</em>, use <em>SPList.RootFolder.Properties[“<strong>ecm_AllowManualDeclaration</strong>”]</em>. Remember that checking <em>only </em>for this overlooks the fact that the Manual Declaration may have been set at the SPSite level.</font></li>    <li><font size="2">To validate Manual declaration is enabled, check that either:</font></li>    <ul>     <li><font size="2">List-specific settings are NOT set <em>AND</em> manual declaration IS set at the SPSite level; or</font></li>      <li><font size="2">List-specific settings ARE set <em>AND</em> list-specific settings are set to <em><strong>true</strong></em>.</font></li>   </ul> </ul>  <p><font size="2">The referenced blog post provides code samples to check values using the logic described above. The rest of the blog post goes on to show how to check if a specific user can manually declare a record; how to check if a file is a record; how to actually declare—or undeclared—and item as a record (using code); and how to determine record restrictions (settings that can also be set using the UI’s <em>Record Restrictions</em> section.</font></p>  <p><font size="2">In any case, I highly recommend reading through the post I’ve referenced above. I’ve summarized the information here just in case the referenced post gets taken down for some reason. But that post does a <em>much</em> better, much more thorough and useful job of explaining how this all works.</font></p>]]></content:encoded>
    </item>
    <item>
      <title>Enable/Disable Client Integration using SharePoint 2010 Object Model</title>
      <link>https://docs.microsoft.com/archive/blogs/chrischiaro/enabledisable-client-integration-using-sharepoint-2010-object-model</link>
      <pubDate>Thu, 09 Jan 2014 11:17:16 GMT</pubDate>
      <dc:creator><![CDATA[chrischiaro]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/chrischiaro/2014/01/09/enabledisable-client-integration-using-sharepoint-2010-object-model/</guid>
      <description><![CDATA[Thanks to Dhirendra Yadav for posting how to set the “Enable Client Integration” property using the...]]></description>
      <content:encoded><![CDATA[<p><font size="3">Thanks to </font><a href="https://about.me/dhirendrayadav" target="_blank"><font size="3">Dhirendra Yadav</font></a><font size="3"> for </font><a href="https://www.dhirendrayadav.com/2010/09/enabledisable-client-integration-in.html" target="_blank"><font size="3">posting how to set the “Enable Client Integration” property using the SharePoint 2010 OM</font></a><font size="3">. I’m reposting here because I had a little trouble finding his post initially. And thought it’s not a big deal to convert it, I’ve put the code into something runnable from your PowerShell command window.</font></p><p><font size="3">Here is Mr. Yadav’s original code:</font></p><blockquote><pre><font size="2">using (SPSite siteCollection = new SPSite(</font><font size="2">https://{your site url}</font><font size="2">)) {
   
  //enable client integration 
  siteCollection.WebApplication.IisSettings[SPUrlZone.Default].EnableClientIntegration = true;
   
  //disable client integration 
  siteCollection.WebApplication.IisSettings[SPUrlZone.Default].EnableClientIntegration = false;

  siteCollection.WebApplication.Update();

}</font></pre></blockquote><pre>&nbsp;</pre><pre><font face="Segoe UI" size="3">And here is my version, converted for use via PowerShell:</font></pre><pre><font size="2">  // Initiate a new assignment store so we can clean up our SP objects afterward</font></pre><pre><font size="2">  $gc = Start-SPAssignment</font></pre><pre><font size="2">  // get a specific Site Collection</font></pre><pre><font size="2">  $s = $gc | Get-SPSite https://{your site url}</font></pre><pre><font size="2"></font>&nbsp;</pre><pre><font size="2">  // Use the IisSettings object on the WebApplication to update EnableClientIntegration</font></pre><pre><font size="2">  // enable client integration</font></pre><pre><font size="2">  $s.WebApplication.IisSettings[[Microsoft.SharePoint.Administration.SPUrlZone]::Default].EnableClientIntegration = $true</font></pre><pre><font size="2"></font>&nbsp;</pre><pre><font size="2">  // disable client integration</font></pre><pre><font size="2">  $s.WebApplication.IisSettings[[Microsoft.SharePoint.Administration.SPUrlZone]::Default].EnableClientIntegration = $true</font></pre><pre><font size="2"></font>&nbsp;</pre><pre><font size="2">  // Make sure to call update on the Web Application</font></pre><pre><font size="2">  $s.WebApplication.Update()</font></pre><pre><font size="2"></font>&nbsp;</pre><pre><font size="2">  // And dispose of the SPAssignment (i.e. the Site Collection object)</font></pre><pre><font size="2">  Stop-SPAssignment –Identity $gc</font></pre>]]></content:encoded>
    </item>
    <item>
      <title>“The call to SearchServiceInstance.Provision failed…Resolved!”</title>
      <link>https://docs.microsoft.com/archive/blogs/chrischiaro/the-call-to-searchserviceinstance-provision-failedresolved</link>
      <pubDate>Tue, 16 Aug 2011 18:45:00 GMT</pubDate>
      <dc:creator><![CDATA[chrischiaro]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/chrischiaro/2011/08/16/the-call-to-searchserviceinstance-provision-failedresolved/</guid>
      <description><![CDATA[Ok, credit where it’s due: I stole even the title of this post from Martin Hatch, and thank all that...]]></description>
      <content:encoded><![CDATA[<p><font face="Verdana">Ok, credit where it’s due: I stole even the <em>title</em> of this post from Martin Hatch, and thank all that is holy for him! </font><font face="Verdana">And thank you Interwebs for keeping everything so nicely archived, and <a href="www.bing.com/" target="_blank">Bing</a> for indexing it, and….</font></p>  <p><font face="Verdana">Well, you get the picture. I’m pretty happy about finding an answer to this one, as it was just one more blocker to getting a rush job done for a client. (Isn’t that always the case?)</font></p>  <p><font face="Verdana">Anyways, here’s the link to his original post, from July 6, 2009: <a href="https://www.martinhatch.com/2009/07/call-to-searchserviceinstanceprovision.html">https://www.martinhatch.com/2009/07/call-to-searchserviceinstanceprovision.html</a>. I’m reposting here just in case I forget where to find the original post.</font></p>  <p><font face="Verdana">I don’t know that I ever would have figured this one out, because the error itself it completely useless. But the fix was this:</font></p>  <p><font face="Verdana">For the account credentials, when turning on the Search service, use the <em>fully qualified</em> domain credentials. I.e., rather than <em>myuser</em>, use <em>mydomain\myuser</em>. Apparently, this is one place where SharePoint can’t figure out that—even though the rest of the farm is running on domain accounts—this credential set should be a domain account, too.</font></p>  <p><font face="Verdana">Go figure.</font></p>]]></content:encoded>
    </item>
    <item>
      <title>Error: this template attempted to load component assembly ‘Microsoft.IdentityModel.Tools.VS…”</title>
      <link>https://docs.microsoft.com/archive/blogs/chrischiaro/error-this-template-attempted-to-load-component-assembly-microsoft-identitymodel-tools-vs</link>
      <pubDate>Thu, 14 Jul 2011 14:24:00 GMT</pubDate>
      <dc:creator><![CDATA[chrischiaro]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/chrischiaro/2011/07/14/error-this-template-attempted-to-load-component-assembly-microsoft-identitymodel-tools-vs/</guid>
      <description><![CDATA[Ran into this error while trying to go through the Claims Walkthrough: Creating Trusted Login...]]></description>
      <content:encoded><![CDATA[<p><font face="Calibri"></font></p>  <p><font face="Calibri">Ran into this error while trying to go through the <em><a href="https://msdn.microsoft.com/en-us/library/ff955607.aspx#" target="_blank">Claims Walkthrough: Creating Trusted Login Providers (SAML Sign-in) for SharePoint 2010</a></em> tutorial, and on the first step! I always hate these kinds of “tooling” errors, since they don’t even provide any learning for the task at hand. They are just a hassle that distracts me from actually working on the tutorial. The fix is quite simple, but I couldn’t find an answer using the normal searches on Bing (or Google, for that matter.)</font></p>  <p><font face="Calibri">The full error is as follows:</font></p>  <blockquote>   <p><font face="Calibri">“Error: this template attempted to load component assembly ‘Microsoft.IdentityModel.Tools.VS, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL’. For more information on this problem and how to enable this template, please see documentation on Customizing Project Templates.”</font></p> </blockquote>  <p><font face="Calibri">…Just in case anyone is searching on all or part of the error text. And yes, I even tried searching for the “documentation on Customizing Project Templates.” Not useful at all for resolving this error.</font></p>  <p><font face="Calibri">In any case, when I attempted to complete Step 1, task 5b (“Select the <strong>ASP.NET Security Token Service Web Site</strong> template”) I discovered that the required template wasn’t installed locally. So I clicked the “Online Templates” option, found the “ASP.NET 3.5 STS Template” option, changed the name of my new local project (from the default of “STSWebSite1”), and clicked <strong>OK</strong>. The template attempted to load, and then VS gave me this error.</font></p>  <p><font face="Calibri">I tried a number of things, which I won’t go into here, but finally decided that maybe the issue was <em>related to tooling</em>. So I downloaded the <a href="https://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;id=4451" target="_blank">Windows Identity Foundation SDK 3.5</a> (the template specifies that it’s for v3.5 of the .NET framework, but v4.0 may work just as well—I didn’t try it.) I installed the SDK—making sure to close Visual Studio first (actually, the installer wouldn’t let me continue until I’d done that part)—and <em>voila</em>, the next try at downloading the ASP.NET STS Template worked!</font></p>]]></content:encoded>
    </item>
    <item>
      <title>SharePoint 2007/WCF Services Bug: “Object reference not set to an instance of an object.”</title>
      <link>https://docs.microsoft.com/archive/blogs/chrischiaro/sharepoint-2007wcf-services-bug-object-reference-not-set-to-an-instance-of-an-object</link>
      <pubDate>Mon, 13 Jun 2011 11:50:00 GMT</pubDate>
      <dc:creator><![CDATA[chrischiaro]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/chrischiaro/2011/06/13/sharepoint-2007wcf-services-bug-object-reference-not-set-to-an-instance-of-an-object/</guid>
      <description><![CDATA[Just finished working through an issue with one of my customers. My customer had written a WCF...]]></description>
      <content:encoded><![CDATA[<p><font face="Calibri">Just finished working through an issue with one of my customers. My customer had written a WCF service to kick off some custom actions on remote SharePoint servers, but they kept getting the old, “Object reference not set to an instance of an object” error. Personally, I love this one, because it’s so easy to debug: all you have to do is figure out which object was null. And why.</font></p>  <p><font face="Calibri">Ok, that was sarcasm. And not very well done, at that. Actually, I hate this error because it’s so vague, and because at least half the time I’ve seen it, the faulting method doesn’t actually contain the code that caused the root problem. It just happens to be where everything finally blew up. And in fact, that was the case here.</font></p>  <p><font face="Calibri">So that you don’t have to keep thinking to yourself, “Would you <em>please</em> just get to the point!?”, I’m going to give the solution, then the cause, and then I might go a little into the process of how we got there.</font></p>  <h3><font color="#4f81bd" face="Calibri">The Solution</font></h3>  <p><font face="Calibri">There are a few possibilities (as always): </font></p>  <ol>   <li><font face="Calibri">Try turning <em>off</em> Verbose logging. This one doesn’t seem to always work, but it certain instances it does. Apparently, if Verbose logging is turned on, SharePoint uses one of the utility methods that we found had the bug related to using <em>StackFrame </em>and <em>StackTrace</em>.        <br /></font></li>    <li><font face="Calibri">Don’t do it. Find an alternative. I hate that this is the answer, but we actually tried option number one and initially got it to work. With further testing, however, we hit the same error again, but this time caused by a separate utility method that did basically the same thing with <em>StackTrace</em> and <em>StackFrame</em> as the first method. And that was <em>with </em>Verbose logging turned off.</font></li> </ol>  <p><font face="Calibri">That’s it; really. You may get it to work, and please, please, please: if you did encounter this error and still found a way to make the WCF call work (well, the instantiation, actually; we had no trouble getting the WCF call to go through), please let me know how you did it.</font></p>  <p><font face="Calibri">Here are two alternatives:</font></p>  <ol>   <li><font face="Calibri">Use the <a href="https://msdn.microsoft.com/en-us/library/dd878586(v=office.12).aspx" target="_blank">SharePoint 2007 web service API</a>, which is pretty robust.</font></li>    <li><font face="Calibri">Use a standard web service hosted inside a SharePoint web app. </font></li> </ol>  <p><font face="Calibri">In this customer’s case, they wanted to due some special configuration magic that would have been much more difficult without the special configuration file they’d designed. So, they opted for creating a web service hosted inside one of the SharePoint web apps (I’m not going to give too many specifics about their architecture, but the point is that this option worked.) As I said, however, the SharePoint 2007 web service API is fairly robust. With some planning, you will probably be able to accomplish everything you want just by making use of it. <a href="https://www.bing.com/search?setmkt=en-US&amp;q=sharepoint+2007+web+service+api" target="_blank">A quick search on Bing</a> will locate some really helpful resources for you, but for the really lazy, here are some samples:</font></p>  <ul>   <li><font face="Calibri"><a href="https://msdn.microsoft.com/en-us/magazine/cc507633.aspx" target="_blank"><strong>Automate Web App Deployment with the SharePoint API</strong></a> (MSDN Magazine; Ethan Wilansky, Paul Olszewski, Rick Sneddon)</font></li>    <li>     <h3><a href="https://www.infoq.com/articles/swanson-moss-web-services;jsessionid=E7B7A20E7B7C92BE97EFB270697C0D72"><font size="3" face="Calibri">Getting Started With SharePoint Web Services</font></a><font size="3" face="Calibri">&#160;<font style="font-weight: normal">(InfoQ; Trent Swanson)</font></font></h3>   </li>    <li>     <h3><a href="https://www.tonytestasworld.com/post/2008/02/24/SharePoint-2007-Web-Services.aspx"><font size="3" face="Calibri">SharePoint 2007 Web Services</font></a><font size="3" face="Calibri">&#160;<font style="font-weight: normal">(Tony Testa’s World; Tony Testa)</font></font></h3>   </li>    <li>     <h3><font size="3" face="Calibri"><a href="https://technet.microsoft.com/en-us/magazine/2008.11.insidesharepoint.aspx" target="_blank">Inside SharePoint - Extending Office Applications with Web Services</a>&#160;<font style="font-weight: normal">(TechNet; Pav Cherny)           <br /></font></font></h3>   </li> </ul>  <h3><font color="#4f81bd" face="Calibri">The Cause</font></h3>  <p><font face="Calibri">There is a documented bug in SharePoint 2007 with one of the utility methods. The method itself seem innocuous enough: all it does is list out the stack when asked using the .NET <em>StackTrace </em>and <em>StackFrame</em> objects. Unfortunately, due to various factors—most of which I’m not privy—these .NET objects may not be instantiated. </font></p>  <p><font face="Calibri"><em>I think</em> (and this is just presumption, which is why I italicized those two words) that <em>StackTrace</em> and <em>StackFrame</em> being null may be related to the fact that most SharePoint 2007 .NET code is just a series of wrappers for unmanaged COM code. Thus, <em>I’m guessing</em> (again, notice the italics) that the <em>StackTrace</em> and <em>StackFrame</em> objects are not instantiated in all circumstances. I mean, they’re not as fundamental as, for instance, the <em>Object</em> class. But I digress. Plus, I’m right at the edge of what I know and what I blatantly don’t, and if I tread any further, that will become painfully obvious.</font></p>  <p><font face="Calibri">In any case, due to some strangeness in how the SharePoint classes get instantiated when called by a WCF service, the <em>StackTrace</em> and <em>StackFrame</em> objects don’t get instantiated, but a couple of SharePoint utility methods that use them do get called. And since those utility methods don’t take into account the fact that <em>StackTrace</em> and/or <em>StackFrame</em> might not have been instantiated, they call methods on the null objects, causing the “Object reference…” error to be thrown.</font></p>  <h3><font color="#4f81bd" face="Calibri">Other Things We Tried</font></h3>  <ul>   <li><font face="Calibri">We started by making sure the WCF call was making it to the endpoint. Once we established that, we knew would should be able to rule that piece out. Besides, the error was happening in the SharePoint code, after a considerable amount of other code had already been called and run.</font></li>    <li><font face="Calibri">We noticed that the HttpContext and SPContext objects were null, and thought that might have something to do with it. We created context manually by creating an HttpRequest.</font></li>    <li><font face="Calibri">Since the error was happening inside custom feature-related code, we tried adjusting the settings to not activate any features. We still got the error, but now we could see it actually happening in the SharePoint utility class. This was almost <em>more</em> confusing, since our first thought was, “That doesn’t make any sense—it’s just a method in a utility class that displays StackTrace information. I guess the lesson here is not to overlook what’s right in front of you.</font></li> </ul>  <p><font face="Calibri">One of the oddest things was that we initially didn’t find <em>any</em> mention of this bug on the web. Actually, my customer was the one that found a brief mention of turning off Verbose logging while searching archived forum postings. This led us to search our internal bug database, where we found the SharePoint bug documented.</font></p>  <p><font face="Calibri">And just in case you’re hoping this might be fixed in SharePoint 2007, I’ll let you know that this particular bug was marked, “Postponed”. On the plus side, it is confirmed as fixed in SharePoint 2010.</font></p>  <p><font face="Calibri">HTH,</font></p>  <p><font face="Calibri">Chris</font></p>]]></content:encoded>
    </item>
    <item>
      <title>Could not load file or assembly 'NewWebPart' or one of its dependencies. Access is denied.</title>
      <link>https://docs.microsoft.com/archive/blogs/chrischiaro/could-not-load-file-or-assembly-newwebpart-or-one-of-its-dependencies-access-is-denied</link>
      <pubDate>Wed, 25 May 2011 08:16:40 GMT</pubDate>
      <dc:creator><![CDATA[chrischiaro]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/chrischiaro/2011/05/25/could-not-load-file-or-assembly-newwebpart-or-one-of-its-dependencies-access-is-denied/</guid>
      <description><![CDATA[Ran into this error yesterday, while trying to create a test web part for a client. I tried various...]]></description>
      <content:encoded><![CDATA[<p><font face="Calibri">Ran into this error yesterday, while trying to create a test web part for a client. I tried various fixes, including (but not limited to): </font></p>  <ul>   <li><font face="Calibri">Placing my DLL into the GAC; </font></li>    <li><font face="Calibri"><a href="https://stackoverflow.com/questions/4469929/could-not-load-file-or-assembly-or-one-of-its-dependencies" target="_blank">Checking what else my assembly might be referencing</a>; </font></li>    <li><font face="Calibri">Changing the <a href="https://blogs.msdn.com/b/sayanghosh/archive/2007/04/21/solution-to-could-not-load-file-or-assembly-or-one-of-its-dependencies-access-is-denied.aspx" target="_blank">security rights on the “Temporary ASP.NET Files” folder</a>; </font></li>    <li><font face="Calibri"><a href="https://forums.iis.net/p/1160225/1934985.aspx" target="_blank">Viewing the assembly bindings</a> using <a href="https://technet.microsoft.com/en-us/sysinternals/bb896645.aspx" target="_blank">SysInternals Process Monitor</a> tool; </font></li>    <li><font face="Calibri">Setting the registry to <a href="https://blogs.msdn.com/b/chrischiaro/archive/2011/05/25/showing-assembly-bindings-in-asp-net-and-sharepoint.aspx" target="_blank">display assembly binding information</a>;</font></li>    <li><font face="Calibri">Setting the WSS Trust level to “WSS_Medium”;</font></li> </ul>  <p><font face="Calibri">and several more (including all of the standard SharePoint steps of placing the assemblies in the “bin” folder and adding a <em>SafeControl </em>entry.) None of them worked, and some of them were actually bad ideas (e.g. changing the security rights on the “Temporary ASP.NET Files” folder.)</font></p>  <p><font face="Calibri">Finally, I got in touch with one of my colleagues—a guy who is <em>often</em> able to help me through such problems—and he diagnosed the issue right away.</font></p>  <h4><font color="#4f81bd" face="Calibri">Change the WSS Trust Level to “WSS_Full” or Place DLL in the “app_bin” Folder</font></h4>  <p><font face="Calibri">The fix I actually implemented was placing my DLL into the “app_bin” folder in my web application’s root. The reason this worked is actually related to the other option: changing the WSS Trust level.</font></p>  <p><font face="Calibri">My colleague pointed me to the WSS Trust Policy file. Mine was located in “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\config\wss_mediumtrust.config&quot;; you should be able to confirm the location of your by looking in one of the <em>web.config</em> files in your SharePoint root folder (search for “&lt;trustLevel”.) Reading through that (not an easy read, by the way), I discovered that the trust levels defined in “wss_mediumtrust.config” contain no mention of the “bin” folder.</font></p>  <p><font face="Calibri"><em>This is why putting the assembly in the </em>bin<em> folder doesn’t work, even when setting the </em>trust<em> level to “WSS_Medium”.</em></font></p>  <p><font face="Calibri">The “app_bin” folder, however, <em>is</em> included. This isn’t exactly recommended, however. The actual answer should be to either:</font></p>  <ul>   <li><font face="Calibri">Set the trust level to “WSS_Full”; or</font></li>    <li><font face="Calibri">Modify the “WSS_Medium” policy to include the “bin” folder.</font></li> </ul>  <p><font face="Calibri">Hope that helps someone else.</font></p>  <p><font face="Calibri">- Chris</font></p>]]></content:encoded>
    </item>
    <item>
      <title>Showing Assembly Bindings in ASP.NET (and SharePoint)</title>
      <link>https://docs.microsoft.com/archive/blogs/chrischiaro/showing-assembly-bindings-in-asp-net-and-sharepoint</link>
      <pubDate>Wed, 25 May 2011 07:45:00 GMT</pubDate>
      <dc:creator><![CDATA[chrischiaro]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/chrischiaro/2011/05/25/showing-assembly-bindings-in-asp-net-and-sharepoint/</guid>
      <description><![CDATA[The instructions for this should actually show up as a suggestion when you get an Access Denied...]]></description>
      <content:encoded><![CDATA[<p><font face="Calibri">The instructions for this should actually show up as a suggestion when you get an Access Denied error when trying to load a custom assembly in ASP.NET (and by extension, SharePoint.) But for quick reference, here it is:</font></p>  <ol>   <li><font face="Calibri">Open <em>regedit.exe</em>.</font></li>    <li><font face="Calibri">Navigate to <strong>HKLM\SOFTWARE\Microsoft\Fusion</strong>.</font></li>    <li><font face="Calibri">Add a new DWORD entry named “EnableLog”.</font></li>    <li><font face="Calibri">Set the value of the entry to 1.</font></li>    <li><font face="Calibri">Reset IIS (at a command prompt: “iisreset.exe /restart”.)</font></li> </ol>  <p><font face="Calibri">Recreate the error. The ASP.NET error text should now include assembly binding information.</font></p>]]></content:encoded>
    </item>
    <item>
      <title>Getting DNS Set Up on a Self-Contained MOSS Server</title>
      <link>https://docs.microsoft.com/archive/blogs/chrischiaro/getting-dns-set-up-on-a-self-contained-moss-server</link>
      <pubDate>Fri, 08 Apr 2011 10:43:00 GMT</pubDate>
      <dc:creator><![CDATA[chrischiaro]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/chrischiaro/2011/04/08/getting-dns-set-up-on-a-self-contained-moss-server/</guid>
      <description><![CDATA[&nbsp;
Since I don&rsquo;t do it very often, I can never remember everything I need to do to get...]]></description>
      <content:encoded><![CDATA[<p>&nbsp;</p>
<p><span style="font-family: verdana,geneva; font-size: small;" face="Calibri">Since I don&rsquo;t do it very often, I can never remember everything I need to do to get DNS set up correctly when I create a new MOSS VM for testing or development. It&rsquo;s easier to set the entire thing up to run on a single server to keep it insulated from everything else I might be working on, and it doesn&rsquo;t suck up as many resources on my VM host as a multi-server farm might (i.e. DC/DNS, Web Server, SQL Server.)</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;" face="Calibri">So here are some notes for next time:</span></p>
<ol>
<li><span style="font-family: verdana,geneva; font-size: small;" face="Calibri">Install at least two NICs (physical or virtual adapters) on the box. One can be for external access (i.e. so you can get to the Internet), and the other for local routing (on-box, in this case) only. <br /></span></li>
<ol>
<li><span style="font-family: Calibri;" face="Calibri"><span style="font-family: verdana,geneva; font-size: small;">Set the External NIC up so that it retrieves an IP address from your network DHCP server. For a home network, this would probably be the gateway router that acts as a DHCP server. Generally, you can just select, &ldquo;Obtain an IP address automatically&rdquo; and &ldquo;Obtain DNS server address automatically&rdquo;, as shown below. </span><br /> <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/08/32/metablogapi/5353.AdapterSettings-Default_56529044.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-08-32-metablogapi/5353.AdapterSettings_2D00_Default_5F00_56529044.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="AdapterSettings-Default" border="0" alt="AdapterSettings-Default" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/08/32/metablogapi/3108.AdapterSettings-Default_thumb_6FAA6DB1.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-08-32-metablogapi/3108.AdapterSettings_2D00_Default_5F00_thumb_5F00_6FAA6DB1.png" width="211" height="234" /></a> <br /></span></li>
<li><span style="font-family: verdana,geneva; font-size: small;" face="Calibri">Set the Internal NIC up with a static IP address. Then specify the DNS server address as either 127.0.0.1 (the loopback address) or as the static IP address you&rsquo;re giving to this NIC. <br /> <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/08/32/metablogapi/5684.AdapterSettings-InternalNIC_35BB2AC5.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-08-32-metablogapi/5684.AdapterSettings_2D00_InternalNIC_5F00_35BB2AC5.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="AdapterSettings-InternalNIC" border="0" alt="AdapterSettings-InternalNIC" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/08/32/metablogapi/7416.AdapterSettings-InternalNIC_thumb_6DF9A1DD.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-08-32-metablogapi/7416.AdapterSettings_2D00_InternalNIC_5F00_thumb_5F00_6DF9A1DD.png" width="220" height="244" /></a> <br /></span></li>
</ol>
<li><span style="font-family: verdana,geneva; font-size: small;" face="Calibri">DNS &ndash; must be installed on the server (as well as Active Directory). <br /></span></li>
<ol>
<li><span style="font-family: verdana,geneva; font-size: small;" face="Calibri">Forward Lookup Zone: this server will provide name resolution for computers listed in this zone. <br /></span></li>
<ol>
<li><span style="font-family: verdana,geneva; font-size: small;" face="Calibri">Zone can be authoritative: means that this server is the primary place to get name resolution for the machines listed. <br />For this (assuming the zone doesn&rsquo;t exist already), create a new zone with the name of the domain for which this box will be authoritative. E.g. &ldquo;mydomain.com&rdquo;. </span></li>
<li><span style="font-family: verdana,geneva; font-size: small;" face="Calibri">Or, the zone can be non-authoritative: by creating a &ldquo;stub zone&rdquo;, this server will get its lists of servers from another DNS resource.</span></li>
<li><span style="font-family: verdana,geneva; font-size: small;" face="Calibri">Name-to-IP or IP-to-Name: both types of resolution can be handled with a single entry. <br /></span></li>
<ol>
<li><span style="font-family: verdana,geneva; font-size: small;" face="Calibri">First, right-click your new zone listing under &ldquo;Forward Lookup Zones&rdquo; and select &ldquo;New Host (A)&rdquo;. <br /> <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/08/32/metablogapi/7713.Select-NewHost_582FB980.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-08-32-metablogapi/7713.Select_2D00_NewHost_5F00_582FB980.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="Select-NewHost" border="0" alt="Select-NewHost" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/08/32/metablogapi/7416.Select-NewHost_thumb_13831F3F.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-08-32-metablogapi/7416.Select_2D00_NewHost_5F00_thumb_5F00_13831F3F.png" width="153" height="244" /></a> <br /></span></li>
<li><span style="font-family: verdana,geneva; font-size: small;"><span face="Calibri">This displays the &ldquo;New Host&rdquo; dialogue window. <br /></span><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/08/32/metablogapi/2133.NewDNSEntry-1_4BC19657.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-08-32-metablogapi/2133.NewDNSEntry_2D00_1_5F00_4BC19657.png"> <br /><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="NewDNSEntry-1" border="0" alt="NewDNSEntry-1" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/08/32/metablogapi/1464.NewDNSEntry-1_thumb_71B746AD.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-08-32-metablogapi/1464.NewDNSEntry_2D00_1_5F00_thumb_5F00_71B746AD.png" width="254" height="235" /></a> </span><br /><span style="font-family: verdana,geneva; font-size: small;" face="Calibri"></span></li>
<li><span style="font-family: verdana,geneva; font-size: small;" face="Calibri">The Host Name&mdash;the name of your site (e.g. &ldquo;moss&rdquo; for &ldquo;https://moss/&rdquo; or &ldquo;https://moss.mydomain.com&rdquo;) goes in the first box. You don&rsquo;t need to add the &ldquo;.mydomain.com&rdquo; part; that will get added automatically and entering it here will cause it to double-up (e.g. &ldquo;https://moss.mydomain.com.mydomain.com&rdquo;.)</span></li>
<li><span style="font-family: verdana,geneva; font-size: small;" face="Calibri">The IP address goes in the second box. This can be 127.0.0.1, but it&rsquo;s better if you have an address that isn&rsquo;t the loopback address, as that can cause other issues. Use the address you assigned to the Internal NIC.</span></li>
<li><span style="font-family: verdana,geneva; font-size: small;" face="Calibri">Checking the first checkbox (&ldquo;Create associated pointer record&rdquo;) causes a record to be created that allows reverse-lookup as well. So, typing &ldquo;https://192.168.x.x&rdquo;&mdash;or whatever the actual IP address of the box is&mdash;will cause the site to still be found as &ldquo;https://moss.mydomain.com&rdquo;. <br /></span></li>
</ol>
<li><span style="font-family: verdana,geneva; font-size: small;" face="Calibri">Once you get this far, you <em>should</em> be able to ping the hostname and get a response from the IP address you chose. You <em>should </em>also be able to ping the IP address and get a response. <br /></span></li>
</ol>
<li><span style="font-family: verdana,geneva; font-size: small;" face="Calibri">Reverse Lookup Zone: don&rsquo;t bother with this for now. <br /></span></li>
</ol>
<li><span style="font-family: verdana,geneva; font-size: small;" face="Calibri">IIS Settings: you may need to create a host-header entry for your web application using the properties window in IIS. <br /></span></li>
<ol>
<li><span style="font-family: verdana,geneva; font-size: small;" face="Calibri">Find the node in the tree for your web application, right-click on it, and select &ldquo;Properties&rdquo;. <br /> <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/08/32/metablogapi/8802.IIS-LeftPane_5BED5E50.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-08-32-metablogapi/8802.IIS_2D00_LeftPane_5F00_5BED5E50.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="IIS-LeftPane" border="0" alt="IIS-LeftPane" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/08/32/metablogapi/6242.IIS-LeftPane_thumb_291D57DC.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-08-32-metablogapi/6242.IIS_2D00_LeftPane_5F00_thumb_5F00_291D57DC.png" width="289" height="243" /></a> <br /></span></li>
<li><span style="font-family: verdana,geneva; font-size: small;" face="Calibri">In the Properties dialogue window, select the &ldquo;Advanced&hellip;&rdquo; button on the &ldquo;Web Site&rdquo; tab. <br /> <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/08/32/metablogapi/0385.IIS-WegAppProperties_4F130832.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-08-32-metablogapi/0385.IIS_2D00_WegAppProperties_5F00_4F130832.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="IIS-WegAppProperties" border="0" alt="IIS-WegAppProperties" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/08/32/metablogapi/3122.IIS-WegAppProperties_thumb_59642C92.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-08-32-metablogapi/3122.IIS_2D00_WegAppProperties_5F00_thumb_5F00_59642C92.png" width="244" height="237" /></a> <br /></span></li>
<li><span style="font-family: verdana,geneva; font-size: small;" face="Calibri">Click the &ldquo;Add&rdquo; button&hellip; <br /> <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/08/32/metablogapi/6254.IIS-WegAppProperties-Advanced-2_588BC6A8.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-08-32-metablogapi/6254.IIS_2D00_WegAppProperties_2D00_Advanced_2D00_2_5F00_588BC6A8.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="IIS-WegAppProperties-Advanced-2" border="0" alt="IIS-WegAppProperties-Advanced-2" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/08/32/metablogapi/5353.IIS-WegAppProperties-Advanced-2_thumb_25BBC034.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-08-32-metablogapi/5353.IIS_2D00_WegAppProperties_2D00_Advanced_2D00_2_5F00_thumb_5F00_25BBC034.png" width="247" height="222" /></a>&nbsp; <br /></span></li>
<li><span style="font-family: verdana,geneva; font-size: small;" face="Calibri">And add an entry by specifying:</span></li>
<ol>
<li><span style="font-family: verdana,geneva; font-size: small;" face="Calibri">The IP address (or leaving as &ldquo;All Unassigned&rdquo;); </span></li>
<li><span style="font-family: verdana,geneva; font-size: small;" face="Calibri">The port (&ldquo;80&rdquo; is the default for HTTP traffic; &ldquo;443&rdquo; is the default for SSL traffic); </span></li>
<li><span style="font-family: verdana,geneva; font-size: small;" face="Calibri">And the Host Header value. For the Host Header, enter the name you want to use when going to the website. In the existing entry above, I&rsquo;ll be able to type &ldquo;https://moss.mydomain.com&rdquo; to get to my SharePoint site. <br /> <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/08/32/metablogapi/7725.IIS-WegAppProperties-Advanced-Add_0FF1D7D7.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-08-32-metablogapi/7725.IIS_2D00_WegAppProperties_2D00_Advanced_2D00_Add_5F00_0FF1D7D7.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="IIS-WegAppProperties-Advanced-Add" border="0" alt="IIS-WegAppProperties-Advanced-Add" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/08/32/metablogapi/2548.IIS-WegAppProperties-Advanced-Add_thumb_3653BB22.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-08-32-metablogapi/2548.IIS_2D00_WegAppProperties_2D00_Advanced_2D00_Add_5F00_thumb_5F00_3653BB22.png" width="244" height="148" /></a> <br /></span></li>
<li><span style="font-family: verdana,geneva; font-size: small;" face="Calibri">Multiple Host Header values can be added for a single web application. In addition, each Host Header can be bound to its own static IP address. In order to do this, however, you&rsquo;ll need to add additional IP addresses to one of the box&rsquo;s NICs. That can be done using the following dialogue window: <br /> <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/08/32/metablogapi/1057.AdapterSettings-InternalNIC-AdditionalIPs_6A87E468.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-08-32-metablogapi/1057.AdapterSettings_2D00_InternalNIC_2D00_AdditionalIPs_5F00_6A87E468.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="AdapterSettings-InternalNIC-AdditionalIPs" border="0" alt="AdapterSettings-InternalNIC-AdditionalIPs" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/08/32/metablogapi/0385.AdapterSettings-InternalNIC-AdditionalIPs_thumb_74D908C8.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-08-32-metablogapi/0385.AdapterSettings_2D00_InternalNIC_2D00_AdditionalIPs_5F00_thumb_5F00_74D908C8.png" width="215" height="255" /></a> <br /> <br />This can be opened by clicking the &ldquo;Advanced&rdquo; button on the <em>Internet Protocol (TCP/IP) Properties</em> dialogue window. </span></li>
<ol>
<li><span style="font-family: verdana,geneva; font-size: small;" face="Calibri">Right-click on the Internal NIC'; </span></li>
<li><span style="font-family: verdana,geneva; font-size: small;" face="Calibri">Select &ldquo;Internet Protocol (TCP/IP)&rdquo;; </span></li>
<li><span style="font-family: verdana,geneva; font-size: small;" face="Calibri">Click the &ldquo;Properties&rdquo; button to view <em>Internet Protocol (TCP/IP) Properties</em>; </span></li>
<li><span style="font-family: verdana,geneva; font-size: small;" face="Calibri">Click the &ldquo;Advanced&rdquo; button.</span></li>
<li><span style="font-family: verdana,geneva; font-size: small;" face="Calibri">Select the &ldquo;DNS&rdquo; tab. <br /></span></li>
</ol></ol></ol>
<li><span style="font-family: verdana,geneva; font-size: small;"><span face="Calibri"><strong>hosts</strong> file: If all else fails, or you&rsquo;re still having some odd routing issues, or for some reason one of the host names you&rsquo;re trying to use won&rsquo;t resolve to the right IP address, you can try adding a host-name-to-IP-address matching directly in the <em>host</em> file (c:\windows\system32\drivers\etc\hosts; the file has no extension.) It&rsquo;s a simple text file; open it in a text editor like Notepad.exe and add a line like this: <br /> <br /></span><span face="Courier New">111.111.111.1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; myhostname.com <br /> <br /></span><span face="Calibri">(Note: that&rsquo;s a <em>tab</em> between the IP address and the host name.)</span></span></li>
</ol>
<p><span style="font-family: verdana,geneva; font-size: small;" face="Calibri">Ok, hope that helps next time you&rsquo;re trying to get a new machine set up&mdash;physical, virtual, or otherwise.</span></p>]]></content:encoded>
    </item>
    <item>
      <title>Interesting SharePoint Gotcha</title>
      <link>https://docs.microsoft.com/archive/blogs/chrischiaro/interesting-sharepoint-gotcha</link>
      <pubDate>Thu, 03 Mar 2011 13:49:00 GMT</pubDate>
      <dc:creator><![CDATA[chrischiaro]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/chrischiaro/2011/03/03/interesting-sharepoint-gotcha/</guid>
      <description><![CDATA[&#160;  As noted by Nishand in a blog posting several years ago, SharePoint 2007 had a number of...]]></description>
      <content:encoded><![CDATA[<p>&#160;</p>  <p><font face="Calibri">As noted by <a href="https://blogs.msdn.com/b/nishand/archive/2007/05/20/how-to-set-spfolder-welcomepage-property.aspx" target="_blank">Nishand in a blog posting several years ago</a>, SharePoint 2007 had a number of peculiarities around when a instance of an object was needed versus when it wasn’t. In SharePoint 2010, this has <em>not</em> been changed.</font></p>  <p><font face="Calibri">I just had a client ask me about this specific example: </font></p>  <p><font face="Calibri">In order to change the default page of an <font face="Courier New">SPWeb</font> that is <em>not</em> a <font face="Courier New">PublishingWeb</font>, you have to set the <font face="Courier New">WelcomePage</font> property of the <font face="Courier New">SPFolder</font> class. In this case, that <font face="Courier New">SPFolder</font> class can be obtained via the <font face="Courier New">RootFolder</font> property. </font></p>  <p><font face="Calibri">As with most programming, the quickest route would seem to be the ideal choice to make; thus, the following should work like a champ:</font></p>  <pre class="csharpcode">web.RootFolder.WelcomePage = “NewWelcomePage.aspx”;
web.RootFolder.Update();</pre>


<p><font face="Calibri">And yet while stepping through the code, it was plain to see that this code was <em>not</em> working. It turns out that, due to some peculiarities of the code within the SPWeb and SPFolder classes, it is necessary to actually create and hold an instance of the SPFolder class whose WelcomePage value you want to change. Thus, this code <em>does</em> work:</font></p>

<pre class="csharpcode">SPFolder folder = web.RootFolder;
folder.WelcomePage = “NewWelcomePage.aspx”;
folder.Update();</pre>


<p><font face="Calibri">My guess is that this is due to the way the <font face="Courier New">SPWeb</font> object is getting at the <font face="Courier New">SPFolder</font> object represented by <font face="Courier New">RootFolder</font>. Namely, it isn’t unless that object is specifically requested. Thus, a call to <font face="Courier New">web.RootFolder.WelcomePage</font> would directly access the resource indicated by the <font face="Courier New">WelcomePage</font> property and allow the getter to retrieve the current value. Since, however, the SPFolder class is what actually handles updating this value, however, only after getting an instance of the <font face="Courier New">SPFolder</font> object represented by <font face="Courier New">RootFolder</font> will a process have the necessary means for updating the value of <font face="Courier New">RootFolder</font>.</font></p>

<p><font face="Calibri">And an <font face="Courier New">SPFolder</font> instance of <font face="Courier New">RootFolder</font> isn’t actually retrieved unless it’s specifically requested.</font></p>

<p><font face="Calibri">From a resource standpoint, it makes sense. From a usability standpoint, it leaves a lot to be desired.</font></p>

<p><font face="Calibri">HTH,
    <br /></font><font face="Calibri">Chris</font></p>]]></content:encoded>
    </item>
  </channel>
</rss>