Visual Studio Extension: SPDeployer

9. July 2014 22:22 by marco in Visual Studio, SharePoint, SharePoint 2013, Software  //  Tags:   //   Comments (0)

With SharePoint 2013 you can create great solutions not only with a "SharePoint Hosted-App", but with a plain JavaScript file within a Content Editor Web Part. Vesa Juvonen named it app script part pattern.

So development today is like:

  • Open the style library in Explorer and open the javascript file with your favorite editor. Not ideal, because you are not working within a solution in Visual Studio, so no source control integration, etc.
  • Use SharePoint Designer to work with the files –> Not a development environment you want to work with

Solution

Here comes my Visual Studio extension to the rescue. Install it directly from within Visual Studio->Tools->Extensions and Update. Search for SPDeployer or download directly from the Visual Studio gallery.

Open a solution with your web project, then click Tools->"Add SPDeployer to project". This will add a new spdeployer.config file to the currently selected project.

image

Just enter the details to you SharePoint dev site and add a line for each file you want to have SPDeployer automatically upload on save.

Now whenever you make changes in one of the monitored files, it will automatically upload to your SharePoint library.

You can find the sources on GitHub. Feel free to add issues or pull requests.

Simple SharePoint Forms Solution

20. May 2014 17:13 by marco in Javascript, Microsoft, SharePoint, SharePoint 2013, Software, SPForms  //  Tags:   //   Comments (0)

You knew InfoPath? It's dead. So what is your current solution to just create a small/simple form in SharePoint to let users enter some information into a SharePoint list?

The default list forms are not a very good answer if it should be end user friendly or you want to style it.

So I've created a super simple solution and it is open source.

Just create an HTML form with your favorite editor and attach some special "data-" attributes, add a line of JavaScript and put everything into a Content Editor Web Part on your page.

You can find a complete guide at the GitHub project site.

SPSync v0.9 is now available

4. February 2014 12:15 by marco in SPSync, SharePoint 2013, SharePoint, .NET, Software  //  Tags:   //   Comments (0)

Ok, the last version is almost 9 month old, but now I finally had some time to look through all comments on uservoice and now proudly present the new version.

What's new?

The major change is: SPSync now supports Office 365 authentication which means, you can finally use SPSync with SharePoint Online and SkyDrive Pro. Just select "Office365" from the authentication list and enter your username (user@customdomain.com or user@customdomainpart.onmicrosoft.com) and your password. Domain is not required.

image

Also an issue with creating folders is now fixed and it doesn't matter anymore whether the title of a document library is not the same as the URL of the document library.

A reminder: The "Conflict Handling" is a setting just for conflicts. If you select "Overwrite local changes" it does not mean that a full sync is done. A conflict is if a file is modified locally and remotely. All other files are sync'ing independently from this setting.

Download the new version here: http://spsync.net and leave a comment or drop me a line at
support (at) spsync(dot) net

Load Testing SharePoint with Visual Studio Online

19. January 2014 20:03 by marco in Azure, Microsoft, SharePoint, SharePoint 2013, Visual Studio  //  Tags:   //   Comments (2)

I recently discovered that Visual Studio Online includes 15000 "Virtual User Minutes" for load testing each month for free. I've never used the load test feature of Visual Studio before, so I decided to try it to simulate high user loads on our SharePoint farm. Here is a step-by-step guide.

Requirements

  • A Visual Studio Online account
  • Visual Studio 2013 Ultimate (Performance and Load Testing is not included in any other edition)
  • SharePoint Site which is accessible via Internet

Setup

In Visual Studio 2013 go to File->New->Project and select "Web Performance and Load Test Project" in category "Test":

image

This will create an empty "Web Performance Test". To start recording what the test should do, click "Record" and an IE Browser window will open.

image image

Now open your SharePoint site and click around to simulate some browsing. After that click "Stop" to come back to Visual Studio where you will see all requests in your Web Performance Test.

You might not want to record some "SharePoint" noise, so there is a settings page to exclude some stuff. Go to Visual Studio Tools->Options->Web Performance Test Tools->SharePoint:

image

To execute this Web Performance Test as a load test with simulated users, you have to add a "Load Test" to your project:

image

The wizard will guide you through some configuration options. Set the load to 250 users as shown below for a test running one minute will cost you 2500 virtual user minutes. So keep in mind that the free plan of Visual Studio Online gives you 15000 virtual user minutes per month. Be careful with the constant loads settings, because all virtual users will submit the first request as fast as possible, so the result may not reflect real usage scenarios. For more users use the "Step" pattern to start with a few users. They will automatically increase over time.

image

I set the test mix model to "Based on sequential test order" because there is only one test in my project which every virtual user should run. In the next step add the existing test to the load test.

I leave Network Mix, Browser Mix and Counter Sets untouched. In Run Settings I set the "Load test duration" to 10 which means, every virtual user will execute the test in a loop for 10 minutes.

image

With these settings, your "Virtual User Minute" budget of 15000 in Visual Studio Online will decrease by 2500 (250 user * 10 minutes).

Run in the Cloud

Now add a .testsettings file (Local.testsettings already exists) via Add->New Item and search for test:

image

Give it a name like "CloudTestSettings". A wizard will open where you can select "Run tests using Visual Studio Team Foundation Service" (what is now "Visual Studio Online" as of November '13).

image

Make sure, your newly created .testsettings file is the active one by right click on it and select "Active Load and Web Test Settings":

image

Ok, that's basically all you have to do. If you already know some values and want to visualize threshold violations, you can open the load test and add threshold rules to one ore more counters. For example to the average page load time.

image

To run the load test, just click "Run Load Test":

image

After the test is completed the result panel show all the details about the test. You can add counters to graphs and see a summary and details. I'm interested in the page response times, so I switch to only one graph layout. Here you can see all the different pages and there response times.

image

You can download the report to Excel to analyze it even further.

Can't connect to SharePoint on Windows Phone 8

2. December 2013 14:34 by marco in Microsoft, SharePoint, SharePoint 2013, Windows Phone  //  Tags:   //   Comments (0)

I have just installed a new SharePoint 2013 machine and restored an existing (2013) ContentDb to this machine. Everything works fine except: I cannot connect to it on my Windows Phone 8 anymore.

image

However, this worked perfectly well before the move. I tried a lot to figure out, what the problem was. Result: The Certificate Authority (or better the issued certificate) is the reason.

 

 

 

 

The new CA I've also created is on Windows Server 2012 R2. The old CA was on Windows Server 2012. And R2 adds automatically a "CRL Distribution Point" extension to all issued certificates. My CA is private so Windows Phone had no chance to connect to any URL specified within the extension.

Solution

Disabling the CRL Distribution Point extension for all issued certificates (or make the URLs available for your phone). Here are the steps:

Open your CA, edit the properties of the root node, go to the "Extensions" tab and uncheck "Include in the CDP extension of issued certificates:

image

Windows Phone 8 OneNote sync with SharePoint 2013: Error code e4010647

13. October 2013 21:44 by marco in Office, SharePoint, SharePoint 2013, Windows Phone  //  Tags:   //   Comments (0)

It was really frustrating. With Windows Phone 7.8 my OneNote synced perfectly fine with SharePoint 2013. Now I have a new Windows Phone 8, but OneNote synced only the sections and then gives an error (e4010647) and shows "Never synced".

Solution

Ok, I couldn't find any solution on the Internet, but after some testing with authentication settings I got it: My SharePoint WebApp has "Anonymous access" enabled. However the site collection itself does not allow anonymous access. After modifying the "Authentication Provider" and disabled "Anonymous access" everything is back to normal.

Why? I have no idea…

How to fix scrolling (and other) issues in Chrome on SharePoint 2010

31. July 2013 22:05 by marco in Javascript, Microsoft, SharePoint  //  Tags:   //   Comments (1)

Today I looked deeper into the issues our users have with SharePoint 2010 in Chrome. It seems that Chrome does not always (strange…) executes "onload" within the body tag. However, SharePoint needs to execute one important javascript function there to enable scrolling, the ribbon and some other stuff (also the "ExecuteOrDelayUntilScriptLoaded" function)

Solution

We are already using jquery so this one is the best solution:

   1:  jQuery(document).ready(function () {
   2:      if (window.chrome) {
   3:      	jQuery("body").removeAttr("onload");
   4:      	if (typeof (_spBodyOnLoadWrapper) !== 'undefined') {
   5:  		        _spBodyOnLoadWrapper();
   6:      	}
   7:      }
   8:  });

 

Special hint: Do not use "$" in "global" javascript files for jQuery, but instead the explicit "jQuery" object, because in some library types (e.g. Picture Library) the $ has a different meaning in SharePoint.

UPDATE:
Added "if (window.chrome)" to check for Chrome, because InfoPath Workflow Init Forms are not working as expected if the _spBodyOnLoadWrapper is not executed within the real body onload. So they are not working in Chrome.

SPSync v0.8

18. May 2013 16:05 by marco in .NET, SPSync, Software, SharePoint, SharePoint 2013  //  Tags:   //   Comments (0)

SPSync is now available in version 0.8. It has a bunch of bug fixes and a better tested sync engine.
Also it is tested on Windows 7 and Windows 8 against SharePoint 2010 and SharePoint 2013.

With Office 2013 you get SkyDrive Pro for free which is the Microsoft tool to sync a local folder with a SharePoint document library. However, this tool has some disadvantages:

  • Obviously, you need Office 2013. SkyDrive Pro cannot be downloaded independently.
  • You can define only one root folder, where all of your document libraries will show up. With SPSync you can sync any folder you like.
  • With SkyDrivePro you have no control what happens with conflicts. In SPSync you can define whether you would like to see a conflict dialog, always overwrite local changes or always overwrite remote changes.

SPSync now has a new installer and is no longer a "ClickOnce" application. It does not require administrator rights.

Download here: http://spsync.net

To provide feedback use support (at) spsync(dot)net or the FEEDBACK button on http://spsync.net

Access Services 2010: There was an error modifying list schemas

3. May 2013 17:23 by marco in SharePoint, Office 2010, Microsoft  //  Tags:   //   Comments (0)

I have an Access 2010 database published to SharePoint 2010. It is a large database, but it is working fine... as far as Access can be fine. I made a lot of changes and added some more columns to one of the tables. I published the database again and everything worked ok.

To make a backup, I saved the database as a local database. Now if I try to publish the same local database to another site in SharePoint I get the following error message:

There was an error modifying list schemas. Failed to rename the field 'ID' on the SharePoint list 'xxx'

Even though the compatibility checker said everything is ok.

Bing doesn't seem to find a solution, so I tried Fiddler (by the way: great new website) to test what exactly is going on during the publishing process.
And here we have the detailed error message (click to enlarge):

AccessBlog

So what exactly is "_OldID2" and why is there a column I cannot see within the Access Client? And why are there too many columns of some type?

I tried to hide all columns, but modifying the view on the list does not seem to have something to do with it. Then I switched the columns back on and see one column which is not my column and I've never seen it before: "_OldID" Wow, why is Access/SharePoint complaining about _OldID2, but all I can see is "_OldID"?

The Solution


Well, it's really simple: Unhide and then delete the "_OldID" column. That fixed it and it can now be published again. Thank you Access for being such a great tool… not.

SharePoint 2013: SkyDrive Pro couldn't sync this library

25. March 2013 12:56 by marco in SharePoint 2013, Microsoft, SharePoint, Software  //  Tags:   //   Comments (0)

On SharePoint 2013 I have a basic document library with enterprise keywords enabled and one additional "People or Group" column set to "People only" (not as a multi value field).

Now I try to sync the library with SkyDrive Pro. It fails with the following error message:

image

The message details:

The query cannot be completed because the number of lookup columns it contains exceeds the lookup column threshold enforced by the administrator. Error code=0x80070093; Error source=Groove

Ok, if you count the enterprise keywords and the people field as lookup fields I have 2. The default "List View Lookup Threshold" (Central Admin –> Web Application –> Resource Throttling) is 8.

Then I tried to set the value to 16. Bam! Now everything is working again. I have no idea why and how 8 shouldn't be enough with my 2 additional columns (which are of course not even lookup columns).

Bestanden: Core Solutions of Microsoft SharePoint Server 2013

9. February 2013 10:26 by marco in SharePoint 2013, SharePoint, SPC12, Microsoft Zertifizierungen, Microsoft  //  Tags:   //   Comments (0)

Gerade erfahren, dass ich die Beta Prüfung 70-331 (Core Solutions of Microsoft SharePoint Server 2013) die ich auf der SharePoint Conference in Las Vegas gemacht habe, bestanden habe!

Hätte ich nicht gedacht, da doch einigermaßen schwierige Case Studies dabei waren, aber scheint gereicht zu haben.

SPC12: Tag 4

24. November 2012 17:02 by marco in SharePoint 2013, SharePoint, SPC12  //  Tags:   //   Comments (0)

imageHeute ging es zunächst in die Session "Building Search-Driven Windows 8 Apps". Hier gab es wieder ein paar mehr Häppchen Search in SharePoint 2013 und dazu die Connection über die "_api"-Schnittstelle unter der nun das –deutlich ausgebaute– Client Object Model als REST Service zur Verfügung steht.

Aufgrund mangelnder Alternativen war ich anschließend in der Session "Developing Advanced BI Visualizations with Visio & SharePoint in Office 365 with Azure data integration". Klingt kompliziert, aber ich war doch überrascht was Visio alles kann, nachdem ich es bisher vor allem als "Grafik/Chart/Diagramm" Anwendung gesehen habe. Durch Visio Services und der Möglichkeit Diagramme mit Datenquellen zu hinterlegen wird das ganze aber schnell zu einem extrem Mächtigen Werkzeug um (BI-) Dashboards zu erstellen und zu veröffentlichen. Das hat mich doch stark beeindruckt und ich werde jetzt auf jeden fall Visio im Hinterkopf haben, wenn es um das Thema Dashboards geht.

Fazit

CIMG0133Nach dem letzten (kalten) Lunch aus schönen Pappkartons war dann die Konferenz leider auch schon zu Ende. Insgesamt eine wirklich gelunge Woche, insbesondere die Organisation (mal vom WLAN abgesehen). Was das ganze aber etwas trübt ist
a) die Tatsache, dass sich doch recht viele Session im Content ähnelten,
b) es deutlich zu viele "Overview" Sessions (anstatt "Deep-Dive" Sessions) gab
und c) einige der Präsentatoren deutlich merkbar eben keine solchen sind. Die SharePoint Community braucht da dringend mehr Speaker wie z.B. Scott Hanselman ;-)

SPC12: Tag 3

24. November 2012 15:53 by marco in SPC12, SharePoint, SharePoint 2013  //  Tags:   //   Comments (0)

Frisch gestärkt mit Bacon zum Frühstück (wie jeden Tag ;-) ging es direkt zur Session von Spencer Harbar, dem "User Profile Gott". Zu SP2010 gibt es in SP2013 wenige, dafür aber sehr sinnvolle Änderungen. Der Sync Prozess basiert weiterhin auf dem Forefront Identity Manager und auch weiterhin wird man Probleme haben, wenn man nicht an alle Fallen denkt um die User Profile Service zu starten. Aber in SP2013 wurde eine neue Methode zur Synchronisierung eingeführt. Der AD Direct Mode ist ein Modus der ohne den FIM auskommt. Die Einschränkung hier ist, dass nur ein Import AD->SharePoint möglich ist und kein zurückschreiben von SharePoint->AD. Da dies aber sowieso bei nur sehr wenigen Kunden genutzt wird ist dies definitiv der zukünftige Weg. Und wenn man später dann doch einen Full Sync benötigt, ist ein relativ leichter Wechsel vom AD Direct Mode auf den FIM Full Sync Prozess möglich und vor allem auch supported!

Nach dem an Tag 2 bereits klar wurde, dass JavaScript eine entscheiden Rolle spielt/spielen wird, gab es heute eine Session zum Thema TypeScript. Keine Sorge, dabei handelt es sich nicht um eine neue Sprache, sondern nur um eine Abstraktion von JavaScript. TypeScript ergänzt dabei die JavaScript Syntax um ein paar Schlüsselwörter, Konstrukte und Typsicherheit mit denen sich auch große JavaScript Anwendungen "vernünftig"® entwickeln und verwalten lassen (Stichwort Klassen, Namespaces, etc.). Alles was man mit TypeScript schreibt wird in JavaScript übersetzt und funktioniert somit wie alle anderen JavaScript Anwendungen. Dass die Sprache gerade mal einen Monat alt ist, merkt man an der noch verbesserungsfähigen Tool Unterstützung, wobei es im Visual Studio 2012 schon einigermaßen gut funktioniert. Im Zusammenhang mit SP2013 dürfte TypeScript für größere SharePoint Apps aber durchaus die Sprache der Wahl werden.

Nachdem ich ein wenig Fun with SharePoint and Windows 8 hatte, wobei es hauptsächlich um das Client Object Model und REST ging, folgte eine MSIT Session wie Microsoft mit seinen knapp 200.000 Site Collections und 36TB dabei ist zu Office 365 zu migrieren. Dazu nutzen sie u.a. Metalogix und ein paar eigene Tools. Sie waren außerdem erstaunt, wie viele User bereit waren freiwillig ihre Site Collection selbst zu migrieren. Im Umkehrschluss bedeutet das, dass viele Team Sites wohl keine Metadaten verwendet haben, da diese bei so einem Download/Upload Szenario natürlich verloren gehen…

SPC12: Tag 2

23. November 2012 21:42 by marco in SharePoint, SharePoint 2013, SPC12  //  Tags:   //   Comments (0)

Die erste Session "Hybrid Overview: Connecting SharePoint 2013 On-premises to SharePoint Online in Office365" an diesem Tag war leider schon voll als ich ankam. Da gibt es hier schon Räume Hallen, aber die Session war leider falsch geplant. Was an diesem Tag auch nicht ging: Wifi.

Einige der Sessions an diesem Tag waren allerdings wirklich gut. Insbesondere die Session von Scot Hillier über Javascript Best-Practices. Es wurde hier bereits klar was sich durch die gesamte Konferenz zog:

Javascript ist DAS Ding. Jeder "SharePoint Entwickler/Consultant" sollte sich spätestens jetzt mit JavaScript, jQuery, Knockout.js und ähnlichen Frameworks auseinander setzen.

Für SharePoint-Hosted-Apps ist das z.B. die einzige Möglichkeit der App Entwicklung, da dass Ziel ist, keinerlei Code mehr auf den SharePoint Servern auszuführen. An der Stelle wird die Microsoft Strategie sichtbar.. möglichst wenig Anpassungen der SharePoint Installation um so die Cloud attraktiv zu machen und den späteren Umstieg zu erleichtern.

Ich habe außerdem einen Einblick in das Thema Search Driven Apps bekommen. Endlich muss man dazu nicht mehr XSL(T)WP_000272, sondern (wie sollte es anders sein) HTML5/JavaScript nutzen. Dazu passend hier das Kennzeichen unseres Mietwagens nach der Konferenz. Zum Abschluss des Tages vor dem Bon Jovi Konzert dann noch in einer Session erlebt wie man SharePoint in Azure VMs hosted. Insgesamt sehe ich persönlich das aber nicht wirklich als Alternative. Office365 dürfte preislich attraktiver sein und mit On-Prem bin ich flexibler und die Liste der Dinge die man bedenken muss sind ebenfalls geringer (Stichwort User Profiles / Authentication). Einzig für Desaster Recovery ist es natürlich sinnvoll, eine Farm im Cold-Standby (ggf. noch in einem anderen Land) zu haben. Die Kosten sind vernachlässigbar so lange die Farm nicht in Betrieb ist und dank Powershell ist so eine DR Farm dann in kürzester Zeit wieder online.

Bon Jovi war dann erwartungsgemäß GROß mit langen Schlangen am Eingang. WP_000270Der komplette Mandalay Bay Beach war dafür für die Teilnehmer (und die wahrscheinlich nochmal so vielen Service Kräfte) geblockt. Es gab jede Menge zu essen und natürlich zu trinken und es war insgesamt sehr gut, auch wenn um Punkt 10 der Strand geräumt wurde und wir an anderer Stelle weiter feiern mussten…

Show thumbnail image of JPGs within SharePoint search results

6. November 2012 19:22 by marco in Search, SharePoint  //  Tags:   //   Comments (0)

In SharePoint 2010 it is really easy to enable the search center to include a thumbnail of JPG images. The required XSLT is already there and you only have to add the file type "jpg" within the search administration (and a full crawl of course):

 

 

 

 

 

However, it works for images within a picture library only. To enable it also for JPGs in "normal" document libraries (e.g. "PublishingImages" which is is, other than the name would indicate, not a picture library), go to your search center results.aspx, edit the page and then edit the "search core result" web part. Make sure you uncheck "Use Location Visualization" (obviously, isn't it? ;-).

Now click "XSL Editor..." and copy/paste that XSLT to modify it within your favorite editor. Look for <xsl:template match="Result">.

There you can see at the first "xsl:when" that it tests on contentclass "STS_ListItem_PictureLibrary". I've just copied the entire "xsl:when" block and modify it.

The first modification is to test if the result is a jpg. Sadly enough there is no "indexOf" in XSLT, so this one is a little bit dirty:

<xsl:when test="contains(url, '.jpg') and not(contains(url, '.jpg.'))">

The second change is where the thumbnail will be shown. I don't want to load the full big JPG so I decided to go with the really nice built-in feature of SharePoint to get a thumbnail of any image just by modifying the URL.

To get a thumbnail from a JPG stored in any SharePoint library just add "/_t/" between the library and the filename and replace the filename extension with "_jpg.jpg":

http://sp2010/DocLib/_t/Test_jpg.jpg

 

So here is the interesting part before the modification:

<div class="srch-picture2">
    <img class="srch-picture" src="{picturethumbnailurl}" alt="" />
</div>


And after the modification:

<div class="srch-picture2">
    <img class="srch-picture" alt="">
        <xsl:attribute name="src">
            <xsl:value-of select="concat(substring-before(url,title),'_t/',
translate(title,'.jpg','_jpg'),'.jpg')"
/> </xsl:attribute> </img> </div>


At the end your XSL should contain the new "xsl:when" between the existing one and the "xsl:otherwise":

 

 

 

 

 

After saving this and the entire page, you should get a nice looking result: