tag:blogger.com,1999:blog-51335737657071587182024-03-05T13:16:24.339-08:00Daniel's SharePoint Tips & TricksThis blog shares some of the issues / experiences I have passed through related to development in SharePoint.Anonymoushttp://www.blogger.com/profile/14005626964198835169noreply@blogger.comBlogger18125tag:blogger.com,1999:blog-5133573765707158718.post-53925767994970803612013-08-22T09:07:00.000-07:002013-08-22T09:07:59.884-07:00Now a Part of the Software AG Family<br />
<div class="separator" style="clear: both; text-align: right;">
<a href="http://jackbe.com/" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;" target="_blank"><span style="background-color: white;"><span style="color: white;"><img border="0" src="http://jackbe.com/images/logo/logo.png" /></span></span></a><a href="http://www.softwareag.com/" imageanchor="1" style="background-color: white; margin-left: 1em; margin-right: 1em;" target="_blank"><span style="color: white;"><img border="0" src="http://www.softwareag.com/images/ND/fw_logo_sag.gif" /></span></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div style="text-align: left;">
After three and a half years at <a href="http://jackbe.com/" target="_blank">JackBe</a> I begin a new stage in my career at <a href="http://www.softwareag.com/corporate/default.asp" target="_blank">Software AG</a> as a senior software engineer continuing to enhance JackBe's <a href="http://jackbe.com/company/jackbe-blog/entry/there-s-no-place-like-sharepoint" target="_blank">real-time operational intelligence offering for SharePoint</a>. The <a href="http://www.softwareag.com/corporate/Press/pressreleases/20130822_RealTime_Analytics_Platform_Acquisition_Jackbe_page.asp" target="_blank">public announcement</a> just went out that we have been acquired by Software AG and I am very excited to be a part of the Software AG family. </div>
<br />
<div>
<a class="pw-button-twitter pw-look-native" href="http://www.blogger.com/blogger.g?blogID=5133573765707158718"></a>
<a class="pw-button-facebook pw-look-native" href="http://www.blogger.com/blogger.g?blogID=5133573765707158718"></a>
<a class="pw-button-googleplus pw-look-native" href="http://www.blogger.com/blogger.g?blogID=5133573765707158718"></a>
<a class="pw-button-linkedin pw-look-native" href="http://www.blogger.com/blogger.g?blogID=5133573765707158718"></a>
<a class="pw-button-post-share" href="http://www.blogger.com/blogger.g?blogID=5133573765707158718"></a>
</div>
Anonymoushttp://www.blogger.com/profile/14005626964198835169noreply@blogger.com0tag:blogger.com,1999:blog-5133573765707158718.post-34154833898405604092013-03-13T08:19:00.001-07:002013-08-20T13:04:50.727-07:00Fixed: Debugger Unable to Attach to Working Process in Visual Studio 2010 for SharePointAfter years of working on SharePoint you think I would have learned certain things by now such as, don't rename a solution and deploy it to a SharePoint farm as the same solution with the original name. Nooooo.<br />
<div>
<br /></div>
<div>
In case you're wondering what happened after accomplishing such a brilliant feat my debugger was not able to attach to the infamous w3sp.exe worker process. Instead I received the following error:</div>
<blockquote class="tr_bq">
"Unable to start debugging on the web server. The debugger is not properly installed..."</blockquote>
After defaulting to blaming SharePoint (as most us are guilty of) I then did the obvious and searched online for a possible solution. Coming up empty handed I noticed that I had two solutions in the farm that were from the same code base but with different names (hand slaps forehead). Removing both solutions manually and re-deploying the renamed solution fixed the problem.<br />
<div class="pw-widget pw-counter-horizontal" style="padding-top: 10px">
<a class="pw-button-twitter pw-look-native"></a>
<a class="pw-button-facebook pw-look-native"></a>
<a class="pw-button-googleplus pw-look-native"></a>
<a class="pw-button-linkedin pw-look-native"></a>
<a class="pw-button-post-share"></a>
</div>Anonymoushttp://www.blogger.com/profile/14005626964198835169noreply@blogger.com0tag:blogger.com,1999:blog-5133573765707158718.post-56395066431830320262012-08-02T08:15:00.000-07:002013-08-20T13:05:04.739-07:00Lessons Learned Using the SharePoint Service Locator PatternHaving wrestled with maintaining separate code bases for both SharePoint 2007 and 2010 I finally got to the point where I had some time to rethink strategy and that's when I came across <a href="http://ranaictiu-technicalblog.blogspot.com/2012/03/managing-single-codebase-for-both.html" target="_blank">Sohel's blog</a> which explained a solution using the <a href="http://msdn.microsoft.com/en-us/library/ff798484.aspx" target="_blank">SharePoint Service Locator Pattern</a>. Having just finished implementing this pattern I now can see some of the *huge* benefits, this approach provides. Here are a few:<br />
<br />
<ul>
<li>Creating loose decoupling of code that is modular which enables a developer to make changes to dependencies without needing to recompile the existing code base. </li>
<li>Easy write mocks and stubs for unit tests due to the dependency injection provided by the Service Locator </li>
<li>Consolidation of repetitive code into a single code base </li>
</ul>
<br />
After implementing this solution I wanted to list out some issues (work in progress) that I came across and how I fixed them:<br />
<br />
<b>Issue #1</b><br />
SharePointServiceLocator.GetCurrent() threw a null reference exception<br />
<br />
<b>Solution to Issue #1</b><br />
I was making calls to SharePointServiceLocator.GetCurrent() within the constructor of my application pages in SharePoint. For example, if I have a class named: MyClass, the constructor would look like:<br />
<br />
public MyClass()<br />
{<br />
SharePointServiceLocator.GetCurrent();<br />
}<br />
<br />
Moving the call, SharePointServiceLocator.GetCurrent(), to another location outside the constructor fixed the problem. Apparently the ServiceLocator instance is not instantiated until later in the page load cycle.<br />
<br />
<b>Issue #2</b><br />
"Access Denied" error when registering mappings<br />
<br />
<b>Solution to Issue #2</b><br />
This can happen when adding mappings at the Farm level (default setting for SP 2010 and the only option for SP 2007) in the SPWeb context. The solution is to create a Farm scoped feature and add register the mappings within the 'FeatureInstalled" event handler.<br />
<br />
<b>Issue #3</b><br />
Type mappings are cleared from cache at the site collection level but not at the Farm level<br />
<br />
<b>Solution to Issue #3</b><br />
Chris Keyser discussed this issue and a work around here: <a href="http://blogs.msdn.com/b/chriskeyser/archive/2011/01/20/handling-sharepointservicelocator-failures-due-to-caching.aspx">http://blogs.msdn.com/b/chriskeyser/archive/2011/01/20/handling-sharepointservicelocator-failures-due-to-caching.aspx</a>
<div class="pw-widget pw-counter-horizontal">
<a class="pw-button-twitter pw-look-native"></a>
<a class="pw-button-facebook pw-look-native"></a>
<a class="pw-button-googleplus pw-look-native"></a>
<a class="pw-button-linkedin pw-look-native"></a>
<a class="pw-button-post-share"></a>
</div>Anonymoushttp://www.blogger.com/profile/14005626964198835169noreply@blogger.com4tag:blogger.com,1999:blog-5133573765707158718.post-60762203317006595612012-07-17T08:52:00.000-07:002013-08-20T13:05:16.079-07:00Managing Exceptions Using DelegatesNow that you have perfect code that follows Microsoft's <a href="http://msdn.microsoft.com/en-us/library/ff647598.aspx" target="_blank">Exception Management Practices for SharePoint</a> ;) you may be wondering..."Is there a way I can get rid of all the *extra* try / catch / finally blocks?" Well this post is to help provide an option that I recently implemented (as a side note if you have other options please feel free to comment below). <br />
<br />
<b>Don't let this example steer you toward catching general exceptions as the norm. This example is mainly to help provide some guidance on abstracting exception handling but not at the risk of generalizing exception management.</b><br />
<div>
<br /></div>
<div>
-The first step is to become familiar with <a href="http://msdn.microsoft.com/en-us/library/ms173171(v=vs.80).aspx" target="_blank">Delegates </a>in C# (if you are not already familiar). </div>
<div>
<br /></div>
<div>
-Next you will need to create a class with at least two methods that will serve as the Exception Manager. Each method will receive a Delegate, as a parameter, that points to the Routine that is being wrapped. The first method will only handle exceptions for Actions (nothing is returned by the Routine). The second method will handle exceptions for Functions (something is returned by the Routine)</div>
<div>
<br /></div>
<div>
-Finally you will need to wrap a Routine call using a Delegate pointer to that routine and pass it to either method in the Exception Manager class.</div>
<div>
<br /></div>
<div>
You can see the result in the following example. You can also download a code sample from my <a href="http://sdrv.ms/Q2ioom" target="_blank">SkyDrive</a>.</div>
<div>
<br /></div>
<div>
Before:</div>
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGCBvHUeCn931j8txqLkRJe3iRsgwNdSm25cH7tGo7CjZInO-hUBkBbCyVrscNbpsMPBHk-G14wZnecHBW5vtR7_wF5jM8FMMZwsD5op17nyoBIUFh9qytq6kON6tiG_hwbQCLaVsdcxtP/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> try
{
DoSomething();
}
catch(Exception ex)
{
//Handle Exception
}
finally
{
//Continue...
}
</code></pre>
<div>
<br />
After:</div>
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGCBvHUeCn931j8txqLkRJe3iRsgwNdSm25cH7tGo7CjZInO-hUBkBbCyVrscNbpsMPBHk-G14wZnecHBW5vtR7_wF5jM8FMMZwsD5op17nyoBIUFh9qytq6kON6tiG_hwbQCLaVsdcxtP/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> ExceptionManager.ProcessFunc(() => DoSomething());
</code></pre>
<div class="pw-widget pw-counter-horizontal">
<a class="pw-button-twitter pw-look-native"></a>
<a class="pw-button-facebook pw-look-native"></a>
<a class="pw-button-googleplus pw-look-native"></a>
<a class="pw-button-linkedin pw-look-native"></a>
<a class="pw-button-post-share"></a>
</div>Anonymoushttp://www.blogger.com/profile/14005626964198835169noreply@blogger.com2tag:blogger.com,1999:blog-5133573765707158718.post-20858693102353010422012-05-21T08:36:00.000-07:002013-08-20T13:05:25.556-07:00SharePoint 2010 Web Part Feature Clean UpReading through <a href="http://www.amazon.com/Inside-Microsoft-SharePoint-2010-Pattison/dp/0735627460" target="_blank">"Inside Microsoft SharePoint 2010"</a> I came across a section on page 192 titled, "Deleting Web Part Template Files at Feature Deactivation". I thought the suggestion to remove the .webpart template file from the Web Part gallery was worth writing about. In case you never tried this use case, attaching a SharePoint Web Part to a feature in SharePoint only supports adding a .webpart template file to the Web Part gallery upon feature activation. Deactivating the feature doesn't remove the .webpart template file which is why I recommend adding a feature event handler that removes this file from the gallery when deactivating your Web Part feature. Here is the sample code segment taken from the book referenced above to remove the template file:<br />
<br />
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGCBvHUeCn931j8txqLkRJe3iRsgwNdSm25cH7tGo7CjZInO-hUBkBbCyVrscNbpsMPBHk-G14wZnecHBW5vtR7_wF5jM8FMMZwsD5op17nyoBIUFh9qytq6kON6tiG_hwbQCLaVsdcxtP/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;">
public override void FeatureDeactivating(SPFeatureReceiverProperties properties) {<br />
<br />
SPSite siteCollection = (SPSite)properties.Feature.Parent;<br />
SPWeb site = siteCollection.RootWeb;<br />
<br />
List<SPFile> FilesToDelete = new List<SPFile>();<br />
// figure out which Web Part template files need to be deleted<br />
SPList WebPartGallery = site.Lists["Web Part Gallery"];<br />
foreach (SPListItem WebPartTemplateFile in WebPartGallery.Items) {<br />
if (WebPartTemplateFile.File.Name.Contains("put your .webpart file title here")) {<br />
FilesToDelete.Add(WebPartTemplateFile.File);<br />
}<br />
}<br />
<br />
// delete Web Part template files <br />
foreach (SPFile file in FilesToDelete) {<br />
file.Delete();<br />
}<br />
<br />
}
<br />
</code></pre>
As a developer in training I welcome any constructive feedback. Please feel free to comment below. Thanks.
<div class="pw-widget pw-counter-horizontal">
<a class="pw-button-twitter pw-look-native"></a>
<a class="pw-button-facebook pw-look-native"></a>
<a class="pw-button-googleplus pw-look-native"></a>
<a class="pw-button-linkedin pw-look-native"></a>
<a class="pw-button-post-share"></a>
</div>Anonymoushttp://www.blogger.com/profile/14005626964198835169noreply@blogger.com3tag:blogger.com,1999:blog-5133573765707158718.post-6571646606568712482012-04-20T14:25:00.001-07:002013-08-20T13:06:31.022-07:00Expanding VMWare Hard Disk with VMWare Player 4.0 Installed<div style="font-family: inherit;">
<span style="font-size: small;">After I finished setting up my VMWare hard disk using VMWare Player <b>4.0</b> I was down to less than 1 GB of hard disk space left on the player. The <a href="http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1004047" target="_blank">instructions </a>to expand the disk only went up to version 3.x and I was unable to locate </span><span style="font-size: small;">vmware-vdiskmanager to perform the operation. Here are the steps you need to take to expand your hard disk with VMWare Player 4.0:</span></div>
<div style="font-family: inherit;">
<span style="font-size: small;"><br /></span></div>
<div style="font-family: inherit;">
<span style="font-size: small;">1) Download and install <a href="http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CDUQFjAA&url=http%3A%2F%2Fwww.vmware.com%2Fsupport%2Fdeveloper%2Fvddk%2F&ei=7tKRT4GYDKbA6AHM2My5BA&usg=AFQjCNEId_L6-vaStNK8JblJEKu7mcFHlg" target="_blank">VMware Virtual Disk Development Kit</a> </span></div>
<div style="font-family: inherit;">
<span style="font-size: small;"><br /></span></div>
<div style="font-family: inherit;">
<span style="font-size: small;">2) Browse to the VVDDK bin directory and run: </span><span style="font-size: small;">vmware-vdiskmanager -x 60Gb vm.vmdk</span></div>
<div style="font-family: inherit;">
<span style="font-size: small;"> - Adjust the size of the disk from 60 Gb to whatever suits you</span></div>
<div style="font-family: inherit;">
<span style="font-size: small;"> - Be sure to update the path of your VMDK file</span></div>
<div style="font-family: inherit;">
<span style="font-size: small;"><br /></span></div>
<div style="font-family: inherit;">
<span style="font-size: small;">3) Go <a href="http://kb.vmware.com/kb/1004071" target="_blank">here</a> to update the guest operating system so it knows the new disk size if it is partitioned</span></div>
<div class="pw-widget pw-counter-horizontal">
<a class="pw-button-twitter pw-look-native"></a>
<a class="pw-button-facebook pw-look-native"></a>
<a class="pw-button-googleplus pw-look-native"></a>
<a class="pw-button-linkedin pw-look-native"></a>
<a class="pw-button-post-share"></a>
</div>Anonymoushttp://www.blogger.com/profile/14005626964198835169noreply@blogger.com0tag:blogger.com,1999:blog-5133573765707158718.post-85060056358916797072011-11-21T05:44:00.000-08:002013-08-20T13:06:57.514-07:00Including Mapped Folders External to the SharePoint SolutionRecently I was refactoring a SharePoint project and wanted to be able to move the Resources mapped folder to a location external to my SharePoint project. In case you're wondering the reason, I'm working with both SharePoint 2007 and 2010 and I'd like to be able to consolidate as much code as possible.<br /><br />Here are the steps I took:<br /><br />1) Add the mapped folder to the SharePoint solution<br />2) Move the folder to the new, external, location<br />3) Create a symbolic link to the mapped folder and point it at the original location of the mapped folder using mklink (<a href="http://technet.microsoft.com/en-us/library/cc753194%28WS.10%29.aspx">http://technet.microsoft.com/en-us/library/cc753194%28WS.10%29.aspx</a>)<br /><br />After these steps the Resources folder should still show up in your SharePoint solution package even though it's actually located outside the solution.
<div class="pw-widget pw-counter-horizontal">
<a class="pw-button-twitter pw-look-native"></a>
<a class="pw-button-facebook pw-look-native"></a>
<a class="pw-button-googleplus pw-look-native"></a>
<a class="pw-button-linkedin pw-look-native"></a>
<a class="pw-button-post-share"></a>
</div>Anonymoushttp://www.blogger.com/profile/14005626964198835169noreply@blogger.com0tag:blogger.com,1999:blog-5133573765707158718.post-45072265593456609712011-10-19T09:13:00.000-07:002013-08-20T13:07:04.456-07:00"Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges"..."Request failed"When I tried running some code within the "Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges" block I received this exception message:<br /><br /><span style="color: rgb(255, 0, 0);">System.Security.SecurityException was unhandled by user code</span><br /><span style="color: rgb(255, 0, 0);"> Message="Request failed."</span><br /><span style="color: rgb(255, 0, 0);"> Source="Microsoft.SharePoint"</span><br /><span style="color: rgb(255, 0, 0);"> StackTrace:</span><br /><span style="color: rgb(255, 0, 0);"> at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode)</span><br /><span style="color: rgb(255, 0, 0);"> at JackBe.SharePoint.Core.Logging.SPLogger.Log(String message, CategoryID categoryID, TraceSeverity severity)</span><br /><span style="color: rgb(255, 0, 0);"> at JackBe.SharePoint.Core.Logging.SPLogger.Log(String message, CategoryID categoryID)</span><br /><span style="color: rgb(255, 0, 0);"> at JackBe.SharePoint.WebParts.MashletWebPart..ctor()</span><br /><span style="color: rgb(255, 0, 0);"> at T_27cf1440_c8a3_45ef_b04a_bcf1032711ed.CreateInstance()</span><br /><span style="color: rgb(255, 0, 0);"> at System.Web.HttpRuntime.FastCreatePublicInstance(Type type)</span><br /><span style="color: rgb(255, 0, 0);"> at System.Web.UI.WebControls.WebParts.WebPartManager.ImportWebPart(XmlReader reader, String& errorMessage)</span><br /><span style="color: rgb(255, 0, 0);"> InnerException:</span><br /><br />It turns out the problem was I was executing this code too early in the page life cycle. I moved the block to "CreateChildControls" and the problem went away.
<div class="pw-widget pw-counter-horizontal">
<a class="pw-button-twitter pw-look-native"></a>
<a class="pw-button-facebook pw-look-native"></a>
<a class="pw-button-googleplus pw-look-native"></a>
<a class="pw-button-linkedin pw-look-native"></a>
<a class="pw-button-post-share"></a>
</div>Anonymoushttp://www.blogger.com/profile/14005626964198835169noreply@blogger.com0tag:blogger.com,1999:blog-5133573765707158718.post-51599231537536572462011-10-03T08:29:00.001-07:002013-08-20T13:07:11.088-07:00Recap from Tally Code Camp TalkFirst of all I wanted to thank everyone who helped put together the code camp for this year. I had a blast and look forward to the next one. For those who wanted a copy of my slides and demo code on 'Building Robust SharePoint Applications' you can get it from my <a href="http://bit.ly/qHPElg" target="_blank">skydrive</a>. <br /><br />If you in or around the Tallahassee area I would like to encourage you to attend our next SharePoint user group meeting on Tuesday Oct. 18. Please visit our <a href="http://www.meetup.com/tally-sharepoint" target="_blank">site</a> to register.
<div class="pw-widget pw-counter-horizontal">
<a class="pw-button-twitter pw-look-native"></a>
<a class="pw-button-facebook pw-look-native"></a>
<a class="pw-button-googleplus pw-look-native"></a>
<a class="pw-button-linkedin pw-look-native"></a>
<a class="pw-button-post-share"></a>
</div>Anonymoushttp://www.blogger.com/profile/14005626964198835169noreply@blogger.com0tag:blogger.com,1999:blog-5133573765707158718.post-64399121607831545892011-06-14T10:06:00.000-07:002013-08-20T13:07:20.259-07:00Enable SSL on TomcatAs a little background, my current occupation involves connecting SharePoint 2007 / 2010 to an external enterprise mashup platform created by <a href="http://www.jackbe.com/" target="_blank">JackBe</a> called <a href="http://www.jackbe.com/products/" target="_blank">Presto</a>. Part of my testing recently included enabling SSL on Presto which is currently running on <a href="http://tomcat.apache.org/" target="_blank">Apache Tomcat</a> 6.0.xxx. Although simple to enable I still wanted to share my experience.<br /><br /><span style="font-size:85%;"><span style="font-style: italic;">Granted these steps do not cover every scenario they are mainly geared toward setting up a test environment (not production).</span></span><br /><br /><span style="font-weight:bold;">Generate self-signed certificate on Tomcat</span><br />Run the following command:<br /><p class="code">%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA</p><br /><span style="font-weight:bold;">Configure server.xml</span><br />Navigate to {apache home}/conf and update the following section by removing the comment<br /> <p>from:<br /><p class="code"><connector port="8443" protocol="HTTP/1.1" sslenabled="true" maxthreads="150" scheme="https" secure="true" clientauth="false" sslprotocol="TLS"></p><br /> to:<br /><p class="code"><connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" sslenabled="true" maxthreads="150" scheme="https" secure="true" keystorefile="<.keystore location>" keystorepass="<change pw="">" clientauth="false" sslprotocol="TLS"></p></p><br /><span style="font-weight:bold;">Export / Import certificate</span><br />Once you have completed configuration of Tomcat, start the server. You will then need to export the certificate and import it into your browser for testing.<br /><p>export:<br /><p class="code">%Java_Home\bin\keytool -keystore "{keystore location=""}" -alias tomcat -export -file c:\presto.cert</p></p><br />Once the certificate has been exported, import the certificate into your browser of choice and you're done!
<div class="pw-widget pw-counter-horizontal">
<a class="pw-button-twitter pw-look-native"></a>
<a class="pw-button-facebook pw-look-native"></a>
<a class="pw-button-googleplus pw-look-native"></a>
<a class="pw-button-linkedin pw-look-native"></a>
<a class="pw-button-post-share"></a>
</div>Anonymoushttp://www.blogger.com/profile/14005626964198835169noreply@blogger.com0tag:blogger.com,1999:blog-5133573765707158718.post-67281830376165988612011-04-29T17:32:00.000-07:002011-04-29T17:37:47.223-07:00Error Generating Unit TestsAfter trying to build my unit test project I noticed that some of the private accessors in my unit tests were no longer referenced properly. I tried to regenerate a unit test and came across the following error:<br /><br />"The following error was encountered while reading module 'Microsoft.SharePoint': Assembly reference not resolved: Microsoft.Internal.Mime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35."<br /><br />When I copied the dll of the project throwing the error to the GAC the build error disappeared. I removed the dll and the error was back. I then tried to remove the Microsoft.SharePoint reference from my project and add it back. Still no luck. <br /><br />My final step was to delete the project file from the solution and re-create the project with a fresh project file. Problem solved.Anonymoushttp://www.blogger.com/profile/14005626964198835169noreply@blogger.com0tag:blogger.com,1999:blog-5133573765707158718.post-86351841064728914422011-03-23T13:13:00.000-07:002011-03-23T15:17:16.125-07:00Create External Content Type Using SP Designer 2010 with Remote Database<div>With the release of SharePoint 2010 came many significant improvements to the SharePoint platform. Among them was the release of SharePoint Designer 2010. After working with the new release of SharePoint Designer I have been *very* impressed with the improvements that have been made.<br /><br />It wasn't until today that I was problem free with SharePoint Designer. It started off with beginning to work more closely with External Content Types using the Secure Store Service. Due to the amount of time spent trying to come up with a solution alone, was reason enough for me to write something about it.<br /><br />Scenario: Connect to remote SharePoint site collection in SharePoint Designer 2010 to create an External Content Type from a SQL database that isn't on the same server as SharePoint.<br /><br />Problem: Because I'm using NTLM authentication I am unable to connect to the database through SharePoint using Pass Through Authentication. The limitation with NTLM is that it doesn't support multiple server hops.<br /><br />Procedure: First step is to create a Secure Store Application for my connection to the remote MS SQL database. The reason for this is it acts as a bypass to the multiple server hop limitation with NTLM by authenticating against the Secure Store Service using my NTLM credentials to retrieve the credentials needed to authenticate against SQL server and then having SharePoint use those credentials and authenticating against SQL server.<br /><br />Because SQL server is on a different domain than my local box I decided to use SQL authentication not Windows authentication to login against SQL server. I created a SQL account that I could use for the external content type and mapped that user to my SharePoint account in the Secure Store Application.<br /><br />Everything was setup to work properly...the problem was when I tried to connect to the database I was getting back an error message: </div><div><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVYMkXSea_jUzOwvLnpnf5kI2vRCJJb9tD2KNuFuPCNsG78Cs63Oy3_yjerC7oMxQrcQLZ9ZrxKvPtIo_FzuLkSemFUher27sppXVtmvnRH_0SC_jGeqWVVXOMmtBAcYgT_XfA_4wstow/s1600/ECTError.jpg"><img style="width: 309px; height: 320px; cursor: pointer;" id="BLOGGER_PHOTO_ID_5587382005148648674" border="0" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVYMkXSea_jUzOwvLnpnf5kI2vRCJJb9tD2KNuFuPCNsG78Cs63Oy3_yjerC7oMxQrcQLZ9ZrxKvPtIo_FzuLkSemFUher27sppXVtmvnRH_0SC_jGeqWVVXOMmtBAcYgT_XfA_4wstow/s320/ECTError.jpg" /></a></div><br /><br />I then looked in the Secure Store Audit table in the SQL database and noticed that nothing was being logged for the requests from Designer. My next step was to close down SharePoint Designer due to a possible issue with caching. After reopening I selected the Impersonate Custom Identity option and entered the Secure Store Application ID which would return the windows identity credentials I had stored in the application. When I was prompted with a Windows login, I entered the SQL DB user credentials which worked!! When I opened the connection properties I noticed that the Secure Store Application ID wasn't what I had first entered...wierd. The secure store application ID was what I had configured to return the SQL server credentials. Bottom line...try and try again. <br /><br />So, looks like there are still some kinks with SharePoint Designer 2010. If I discover any further oddities I'll be sure to update this blog.Anonymoushttp://www.blogger.com/profile/14005626964198835169noreply@blogger.com0tag:blogger.com,1999:blog-5133573765707158718.post-82594925391360112902011-03-09T13:54:00.000-08:002011-03-09T14:28:36.452-08:00Installing Language Pack on Microsoft Office SharePoint Server 2007 (64 bit)This post will help you setup language translation for your SharePoint deployment. The links below are for 64 bit systems only. You will need to download / run all of the following, in order. <b>Before downloading each file, select the language for the service pack.</b><div><br /></div><div>1. <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyId=45FA2637-EFC0-4ED6-8F47-8A013E9CE9D9&displaylang=en" target="_blank">WSS 3.0 Language Pack</a> </div><div>2. <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=2c2b6caf-b46d-45eb-ac4d-deaaa48c3a2c&displaylang=en" target="_blank">WSS 3.0 SP 2 Language Pack</a></div><div>3. <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=2447426B-8689-4768-BFF0-CBB511599A45" target="_blank">MOSS 2007 Language Pack</a></div><div>4. <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=66c5026f-9f47-4642-8378-2526918009fa&displaylang=en" target="_blank">MOSS 2007 SP 2 Language Pack</a></div><div>5. Run SharePoint Product and Technologies Configuration Wizard</div><div>6. Create a new site in SP and select the language you just installed</div>Anonymoushttp://www.blogger.com/profile/14005626964198835169noreply@blogger.com0tag:blogger.com,1999:blog-5133573765707158718.post-66503065671366849642011-02-17T09:44:00.000-08:002011-02-17T13:03:15.548-08:00Recap from Houston SharePoint User GroupFirst I wanted to thank everyone for coming out to the <a href="http://www.sharepointusergroup.com/hou/default.aspx">user group</a> last night in Houston. It was great to meet many of you all and I thoroughly enjoyed my time. Discussing integration of SharePoint with an enterprise infrastructure can be quite daunting but I feel like the message got across based on some questions during and after the presentation. I would appreciate any constructive feedback related to my presentation by commenting below.<br /><br />As a side note, one of the attendees asked a very good question around authorization of multiple SharePoint lists from different SharePoint farms. I wanted to highlight this at the beginning and provide a more complete answer. Because of the nature of mashing SharePoint lists in a different environment such as Presto the security context in SharePoint no longer applies. <div><br /></div><div>Therefore we have security built around the SharePoint lists registered in mashup server which then carry over to mashups created using the SharePoint lists. In doing such the creator of the mashup can setup custom authorization to that SharePoint list. I didn't want the audience to think that we were compromising security in order to simplify access to external SharePoint data. I hope this is clear.<br /><br />In brief there are three challenges organizations will have to face related to integration when deploying SharePoint as part of their information infrastructure. We have titled them as the "Inside-Inside", "Outside-Inside" and "Inside-Outside" problems.<br /><br />"Inside-Inside" Problem<br />With the exponential growth of data within a SharePoint deployment comes the question of how to manage the data as well as consolidating the data in a rapid, yet concise fashion. One example that an individual asked me about last night was being able to bring a contact list from one SharePoint site over to another SharePoint site and allowing users to update the data in the new location. This is a classic example of the types of issues many organizations are facing today. At JackBe we like to use the phrase "Rapid Intelligence"; being able to harvest data, quickly, within SharePoint in order to help the end user make fast, intelligent decisions. Out of the box it is very difficult and tedious to manage SharePoint data stored in lists across multiple site collections. At JackBe we have developed a <a href="http://www.jackbe.com/products/presto_mashup_sites_for_sharepoint.php">product</a> that can quickly and easily "mash" SharePoint lists in a manner that can help minimize the SharePoint crawl problem.<br /><br />"Outside-In" Problem<br />Within organizations is the challenge of collecting data external to SharePoint and brining it into SharePoint with as little development cost as possible. SharePoint 2007 and 2010 answers this type of problem using the "Composites" piece of the <a href="http://markbower.wordpress.com/2009/07/31/making-sense-of-the-sharepoint-2010-pie/">SharePoint pie</a>. More specifically the Business Data Catalog (BDC) in Moss 2007 and Business Connectivity Services (BCS) in SharePoint Foundation 4.0 and SharePoint Server 2010. In my demonstration list night I showed the audience how it is possible to gather data external to SharePoint such as a MS SQL table or a WCF web service and display that data within a SharePoint list using External Content Types; and do this without any code, all within SharePoint designer. I also pointed out that while the SharePoint Designer is capable of such tasks it is still quite limited in the types of LOB systems it can connect to. We are currently working on expanding the ability for the end user to be able to connect to most of the popular data sources and bring them into SharePoint as External Content Types without any custom development involved.<br /><br />"Inside-Out" Problem<br />Once data begins to grow within SharePoint, organizations are also looking for ways to pull this data into other external portals or data centers. Currently the only way to accomplish such a task is to custom develop a SOAP client that is able to connect to SharePoint's web services and pull the list data out. At JackBe we have already included this capability within Presto by allowing users to register SharePoint lists and then Mash them together and publish them as Apps to just about any type of portal using simple scripting or even to other SharePoint farms.</div>Anonymoushttp://www.blogger.com/profile/14005626964198835169noreply@blogger.com0tag:blogger.com,1999:blog-5133573765707158718.post-10851674190523342142010-08-27T07:20:00.000-07:002010-08-27T07:51:12.376-07:00MSTest "System.ArgumentException: [class.method] The member specified could not be found"Came across this error writing unit tests using MSTest in Visual Studio 2008. The source of the problem was I had two versions of the same dll in the GAC. Removing the older version fixed the problem. The reason why I was only seeing this error during runtime and not during compilation is the test project referenced the assembly it was testing in the bin directory of the project which is why the build succeeded. However, during runtime the tests referenced the assembly in the GAC before the assembly in the bin of the project which is expected.Anonymoushttp://www.blogger.com/profile/14005626964198835169noreply@blogger.com0tag:blogger.com,1999:blog-5133573765707158718.post-62840664680809342192010-06-14T07:05:00.000-07:002010-06-14T07:10:45.426-07:00Access Denied using SetPersonalizationDirtyJust recently I ran across a test case I was testing on a web part in SharePoint. I was opening the page with a user that had read only access to the page and I was getting an "Access Denied" message. After several hours of hunting I discovered that it was related to calling SetPersonalizationDirty() for the current web part. Obviously a user with read only access shouldn't be allowed to update the web parts properties. So here's what I used to resolve the issue:<br /><br />if(SPContext.Current.Web.DoesUserHavePermissions(SPBasePermissions.UpdatePersonalWebParts))<br />{<br /> this.SetPersonalizationDirty();<br />}Anonymoushttp://www.blogger.com/profile/14005626964198835169noreply@blogger.com0tag:blogger.com,1999:blog-5133573765707158718.post-70806228976385412062010-01-19T18:58:00.000-08:002010-01-19T19:29:01.485-08:00How to Resize a Fixed VHDI just set up a bootable virtual machine in Windows 7 running Windows Server 2008 R2. I realized after creating the VM that I didn't need as much capacity as I allocated for the VHD file. After several hours of failed attempts I finally came up with a solution and wanted to share.<div><br /></div><div>1) I first attached the VHD using Disk Management in Windows 7.</div><div>2) Using DiskPart I shrank the VHD volume down to a manageable size running the following commands. Note I had 100 GB of free space.</div><div> -<i>diskpart</i></div><div> -<i>select disk 1</i> (varies depending on the number assigned to the attached VHD)</div><div> -<i>select volume 0</i> (also varies depending on the number assigned to the VHD volume in the disk)</div><div> -<i>shrink ( </i>If you would not like to shrink the volume to the absolute minimum capacity I would recommend using the [desired=<size>] [minimum=<size>] parameters. I repeated this command until I shrank the volume to the desired size. You can use <i>detail disk </i>command to check the actual amount of space needed for the disk).</size></size></div><div><i> </i></div><div>3) After shrinking the VHD volume down you'll notice in Disk Management that there is a certain amount of unallocated space in the VHD. To remove that unallocated space use<a href="http://vmtoolkit.com/files/default.aspx"> VHDResizer</a> to actually resize the VHD to the size of the volume you just shrank.</div><div><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0hyxdPlOx5OXqf3OmzifSq2C0OBL4AKLtu91-E3mLZWfu0JP3mfy0UqcI4Ej_yZCcKgtxiuLwzXSocHihWL-aIYVS0FTS_wui70Ih7g64P0kbGWBpLfezvQZUZcHPhpcBJppQO99lx2U/s1600-h/VHD.jpg"><img style="margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 320px; height: 270px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0hyxdPlOx5OXqf3OmzifSq2C0OBL4AKLtu91-E3mLZWfu0JP3mfy0UqcI4Ej_yZCcKgtxiuLwzXSocHihWL-aIYVS0FTS_wui70Ih7g64P0kbGWBpLfezvQZUZcHPhpcBJppQO99lx2U/s320/VHD.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5428658401572777986" /></a><br /></div>Anonymoushttp://www.blogger.com/profile/14005626964198835169noreply@blogger.com0tag:blogger.com,1999:blog-5133573765707158718.post-6240352549621662082009-11-05T20:16:00.000-08:002013-08-20T13:07:35.522-07:00SharePoint Designer and Workflows...bewareIt seems that no matter how many times I'm disappointed using <span id="SPELLING_ERROR_0" class="blsp-spelling-error">SharePoint</span> Designer 2007 I still find myself using it. The ability to quickly browse content on my <span id="SPELLING_ERROR_1" class="blsp-spelling-error">SharePoint</span> site, copy content into my Visual Studio project and quickly create <span id="SPELLING_ERROR_2" class="blsp-spelling-error">Workflows</span> that are attached to lists...**halt**... That's what I thought about 2 weeks ago until it came time to migrate the site I was currently working to another web application. Little did I know that <span id="SPELLING_ERROR_3" class="blsp-spelling-error">workflows</span>, created in <span id="SPELLING_ERROR_4" class="blsp-spelling-error">SharePoint</span> Designer, are assigned to lists using the <span id="SPELLING_ERROR_5" class="blsp-spelling-error">lists's</span> <span id="SPELLING_ERROR_6" class="blsp-spelling-error">GUID</span> (which makes perfect sense).<br /><br />Okay, enough of the background. If you're like me and you get into something where you end up getting stuck (classic tar-baby) you won't give up without a fight. Well, fight hard I did. It turns out that it <strong>IS</strong> possible to reattach the <span id="SPELLING_ERROR_7" class="blsp-spelling-error">workflow</span> to its list after exporting your <span id="SPELLING_ERROR_8" class="blsp-spelling-error">SharePoint</span> site to a new site collection...the answer in a nutshell... make a call to <span id="SPELLING_ERROR_9" class="blsp-spelling-error">SharePoint's</span> web part service (duh...obviously...not). <br /><br />Here's what I did, in a nutshell.<br /><br />1) Create a feature event receiver to attach the <span id="SPELLING_ERROR_10" class="blsp-spelling-error">workflow</span> to the new list.<br />2) Open the <span id="SPELLING_ERROR_11" class="blsp-spelling-error">workflow</span> configuration files (usually stored in the "<span id="SPELLING_ERROR_12" class="blsp-spelling-error">Workflows</span>" list in your site) and replace all the list <span id="SPELLING_ERROR_13" class="blsp-spelling-error">GUIDs</span> from the old site with the <span id="SPELLING_ERROR_14" class="blsp-spelling-error">GUIDs</span> from the new site.<br />3) Call the <span id="SPELLING_ERROR_15" class="blsp-spelling-error">SharePoint</span> web part service to <span id="SPELLING_ERROR_16" class="blsp-spelling-error">reassociate</span> the <span id="SPELLING_ERROR_17" class="blsp-spelling-error">workflow</span> with the list. Here is a code sample for this step.<br /><br /><span id="SPELLING_ERROR_18" class="blsp-spelling-error">WebPartPagesWebService</span> service = new <span id="SPELLING_ERROR_19" class="blsp-spelling-error">WebPartPagesWebService</span>();<br />service.<span id="SPELLING_ERROR_20" class="blsp-spelling-error">Url</span> = String.Format("{0}/{1}", <span id="SPELLING_ERROR_21" class="blsp-spelling-error">SPWeb</span>.<span id="SPELLING_ERROR_22" class="blsp-spelling-error">Url</span>, "_<span id="SPELLING_ERROR_23" class="blsp-spelling-error">vti</span>_bin/<span id="SPELLING_ERROR_24" class="blsp-spelling-error">webpartpages</span>.<span id="SPELLING_ERROR_25" class="blsp-spelling-error">asmx</span>");<br />service.<span id="SPELLING_ERROR_26" class="blsp-spelling-error">UseDefaultCredentials</span> = true;<br />service.<span id="SPELLING_ERROR_27" class="blsp-spelling-error">ValidateWorkflowMarkupAndCreateSupportObjects</span>(<xomlfilecontent>, null, <cfgfilecontent>, "2");<br />service.AssociateWorkflowMarkup(cfgFile.Url, "V" + <span id="SPELLING_ERROR_28" class="blsp-spelling-error">cfgFile</span>.<span id="SPELLING_ERROR_29" class="blsp-spelling-error">UIVersionLabel</span>);<br /><br />**Important thing to note is the service will not associate the <span id="SPELLING_ERROR_30" class="blsp-spelling-error">workflow</span> with the list unless the version number of the <span id="SPELLING_ERROR_31" class="blsp-spelling-error">config</span>. file is greater than what is there currently. In other words you need to make sure the version of the <span id="SPELLING_ERROR_32" class="blsp-spelling-error">workflow</span> configuration file increases before calling the service to associate the <span id="SPELLING_ERROR_33" class="blsp-spelling-error">workflow</span> with the list.
<div class="pw-widget pw-counter-horizontal">
<a class="pw-button-twitter pw-look-native"></a>
<a class="pw-button-facebook pw-look-native"></a>
<a class="pw-button-googleplus pw-look-native"></a>
<a class="pw-button-linkedin pw-look-native"></a>
<a class="pw-button-post-share"></a>
</div>Anonymoushttp://www.blogger.com/profile/14005626964198835169noreply@blogger.com2