Aktuelle Posts

ASP.NET MVC 4 auf der dotnet Cologne 2013


by Marc André Zhou May 13, 2013 07:26

Vortrag auf der dotnet Cologne 2013 zum Thema: ASP.NET MVC 4

Anbei die Unterlagen

Folien (PDF)

ASPNET_MVC_4_devsky_v1.pdf (1,22 mb)

Projekdatei (VS 2012 Solution)

ContactManager.zip (4,14 mb)

Tags:

SharePoint 2013 - Apps (Videos)


by Marc André Zhou February 28, 2013 06:08

Ich habe meinem YouTube Kanal einige Videos zum Thema SharePoint 2013 Apps hinzugefügt. Leider konnte ich auf der letzten BASTA! die Beispiele nicht live zeigen. Daher hier nun die u. a. versprochenen und weitere Videos:

zum YouTube Kanal ...

Tags: , ,

Sharepoint | SharePoint 2013

SharePoint 2010 auf Windows Server 2012 installieren


by Marc André Zhou November 09, 2012 08:24

Leider wird die Installation von SharePoint 2010 auf Windows Server 2012 nicht unterstützt. Bei dem Versuch den sog. Prerequisite Installer aufzurufen, erscheint zunächst folgender Hinweis:

 

Wird dann dennoch das Programm weiter ausgeführt bricht die Installation mit folgender Meldung ab:

Weitere Informationen zu den aktuellen Problemen sind auch auf der Support Seite SharePoint 2010-Unterstützung für Windows Server 2012 zu finden.

Tags: , ,

Windows Server 2012

SharePoint Server 2013 Installieren


by Marc André Zhou November 08, 2012 12:54

Der folgende Screencast zeigt die Installation eines SharePoint Server 2013 auf Windows Server 2012.

Tags: , ,

SharePoint 2013

This page is not using a valid page layout. File not found. System.IO.FileNotFoundException: The file /_catalogs/xxx/xxx.aspx does not exist


by Marc André Zhou September 13, 2012 10:13

After export a publishing site from Farm A to Farm B you encounter sometimes a strange problem. If you try to open the page you see - depending on the web-config configuration settings - errors like this:

File not Found

This page is not using a valid page layout

 

If you open the SharePoint error log you will find the following error message:

System.IO.FileNotFoundException: The file /_catalogs/masterpage/BodyOnly.aspx does not exist. at Microsoft.SharePoint.ApplicationRuntime.SPRequestModuleData.GetWebPartPageData(HttpContext context, String path, Boolean throwIfFileNotFound) ...

This happens because the absolute URL to the Page Layout from Farm A is saved inside the page configuration. The only way to solve the problem is to change the Page Layout. If you have a bunch of pages that is not an easy task. To relieve this process I have implemented a powershell command. You can download the new command here. You can use it fror free but without any warranty. With this PowerShell extension you will become two new commands:

  • Get-PageLayouts
  • Set-CorrectPageLayouts

How to install:

  • Download the DLL here
  • Unzip the DLL from the archive
  • Open a SharePoint PowerShell command prompt
  • Import the new Command
    PS c:\ import-module [x]:\[PATH TO DLL]\devsky.PowerShell.PageLayout.dll
  • Ready

Use the Commands

Get-PageLayouts

To use this command you have to enter the target Site URL only.

Set-CorrectPageLayouts 

Parameters:

  • SiteURL
    Target portal site like http://myportal/sitecoll2
  • WrongURL
    "Old" domain name from the source Farm
  • NewPageLayoutTitle
    Desired new Page Layout to use

devsky.PowerShell.PageLayout.zip (4,27 kb)

Tags: ,

PowerShell | Sharepoint | SharePoint (SPS) 2010

Quick Tip: Disable mobile view in SharePoint 2010


by Marc André Zhou September 03, 2012 14:47

Sometimes it is necessary to disable the SharePoint default mobile view. There are two options to achieve that:

  • Change the web.config
  • Change the compat.browser

Option 1: web.config

To disable the mobile view via web.config add the following lines to the configuration/system.web node:

<browserCaps>
  <result type="System.Web.Mobile.MobileCapabilities, System.Web.Mobile, Version=2.0.0.0, 
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> <filter>isMobileDevice=false</filter> </browserCaps>

Please keep in mind: The above setting will disable the mobile view for all pages!

Option 2: compat.browser

The file is stored under C:\inetpub\wwwroot\wss\VirtualDirectories\[WEB-APP]\App_Browsers. Open the file in Visual Studio or Notepad. Then search for the entry isMobileDevice and change the value as you want. This way you can control the behaviour depending on the device or browser.

 

Tags:

SharePoint (SPS) 2010

Quick Tip: Visual Studio 2012 and Performance Analysis (SharePoint)


by Marc André Zhou August 30, 2012 10:16

Since Visual Studio 2010 you can use the built-in Performance Analyzer to examine and debug applications. I demonstrated the Analyzer last year at the BASTA! conference for multithreaded /  parallel applications. Visual Studio 2012 is shipped with a new redesigned and optimized Analyzer. The prior version was very slow and it took a long time to generate the report. The new Analyzer in VS 2012 is optimized and very fast. Also with the new version it is very simple to use the Analyzer to examine SharePoint Solutions. Implement your SharePoint Solution in VS 2012 and start the Performance Analysis. After that the solution will be deployed and the analyzer starts to collect the necessary runtime information. Now call all important custom solution functions in SharePoint. To stop the analyzer switch back to Visual Studio and click the stop analysis link. After a few seconds the dashboard is displayed and you can see all collected events inside graphs and tables. There is one very important register on the first screen called Functions Doing Most Individual Work

Here you can see the slowest methods. When you click on the method listed above you will see the corresponding implementation. As you can see it is very easy to find possible bottlenecks in your SharePoint solution.

Tags: ,

SharePoint (SPS) 2010 | Visual Studio 2012

Generated JPG/JPEG Images with .NET and Interner Explorer


by Marc André Zhou August 30, 2012 09:20

I had to implement a custom Image Resizer for SharePoint. The image resizer is able to scale any images to a requested dimension and the new image is automatically stored in the source SharePoint image library. For subsequent requests the produced image will be used from the library. Due to the fact that the resizer is used for an internet facing sharepoint web site, it was important to manage the anonymous access, the moderation and version control settings of the image library. After the implementation I noticed that all image types (jpg,gif,png...) were generated without any problem. But if I tried to open a generated jpg Image in Internet Explorer I saw only a red cross. I tried the same in FireFox and the image was displayed correctly. I analyzed the network traffic with fiddler and everything looks good.

Long story short: The problem: missing proper Image Codec Information. Without these explicit settings the generated jpg is encoded using CMYK. But the Internet Explorer has issues displaying JPG/JPEG images that have been encoded with CMYK. To solve this issue I had to change the encoding:

ImageCodecInfo codec = GetEncoderInfo(string.Format("image/{0}",fileType));
if (codec != null)
{
   int quality = 100;
   EncoderParameter qualityParam = new EncoderParameter
(System.Drawing.Imaging.Encoder.Quality, quality); encoderParameters = new EncoderParameters(1); encoderParameters.Param[0] = qualityParam; }
And the GetEncoderInfo:
private static ImageCodecInfo GetEncoderInfo(string mimeType)
{
  ImageCodecInfo[] codecs = ImageCodecInfo.GetImageEncoders();
  foreach (ImageCodecInfo codec in codecs)
    if (string.Compare(codec.MimeType, mimeType, true, CultureInfo.InvariantCulture) == 0)
      return codec;
  return null;
}
That's all.

Tags: , ,

.NET | C#

System.InvalidOperationException: Namespace prefix 'xsd' is not defined


by Marc André Zhou August 30, 2012 08:57

This error can occur if you try to edit and save a list item entry in SharePoint. On non-development environments you see only this error message dialog (debug mode disabled):

 

To solve this problem switch your browser to IE8 mode within the Internet Explorer Developer Tools: 

 

Now you should be able to edit and save the changes.

Tags: ,

SharePoint (SPS) 2010

Install SharePoint 2013 Preview in Farm Mode without Active Directory (Accounts)


by Marc André Zhou August 19, 2012 10:32

It is not possible to do a Full Farm SharePoint Installation without an Active Directory Controller. But in some cases you wish to install SharePoint in Farm Mode on a developer machine. Only in this installation mode it is possible to leverage an existing MS SQL Server for the new SharePoint Farm. Otherwise you have to do a complete installation with the Built-In DataBase. This means that you cannot use an existing MS SQL Server. 

At first you can try to setup an AD on your local machine, but it is not recommended to install SharePoint directly on a Domain Controller. The second option is to setup a second machine as AD-Controller. But in this scenario you have to manage two servers :-(

The problem with the Farm Installation without an Active Directory occurred during the creation of the Sharepoint Configuration Database. If you try to do a SharePoint Farm installation without an AD User Account you will receive the following error message:

The specified user XXX is a local account. Local accounts should only be used in stand alone mode. 

But in stand alone mode you cannot use an existing MS SQL Server

Workaround for this Issue (Please notice: This installation mode is only applicable for development environments!)

The setup Wizard is not able to create the SharePoint Configuration Database, but it is possible to create the necessary Database manually:

    1. Open a SharePoint Powershell Command prompt (run as admin)
    2. Type the command New-SPConfigurationDatabase
    3. Enter the necessary information

    4. After the SharePoint Configuration Database is created, start the SharePoint Installation Wizard (SharePoint 2013 Products Configuration Wizard)
    5. The Wizard detects now the new SharePoint Configuration Database:

    6. Click Next to start the setup ...

Issue: Some Ribbon Commands are disabled

It is not possible to create a new Web-Application or some other Ribbon Commands are disabled after the Installation, try to disable the User Access Control (UAC) and restart the server. More Information about UAC and how to disable UAC ...

Tags: