SharePoint/MOSS & .NET (C#/VB.NET) Blog

How to extract a DLL from GAC in a minute

Simply map a network drive to: \\YourMachineName\c$\windows\assembly

You must be an Admin for that.

LINQ in upgraded VB.NET project

If you want to use LINQ in VB.NET and if the project was upgraded from .NET 2.0 to a newer version please make sure to set "Option infer" on under compile options. Otherwise you might no be able to use the methods of System.Linq.Enumerable methods like count, average etc.

You might also need the following namespaces depending on your current task:

Imports System.Linq
Imports System.Data.Linq
Imports System.Xml.Linq

The rest of the configuration tasks can be found here: http://msdn.microsoft.com/de-de/library/bb546156.aspx

Load DataSet Error: Cannot add a DataRelation or Constraint

If you work in an international team there may occur problems with the Locale property of datasets.

The error may also occur when running the application: "Cannot add a DataRelation or constraint that has different Locale..."

Often you can not fix this within visual studio but there is a simple way to fix it with notepad:

Search and replace the string "msdata:Locale="de-CH" (example for German-Switzerland) with an empty string using notepad. Simply open the xsd file with notepad.

Make sure to create a backup before. If you have a versioning tool this should be no problem anyway.

Strong Name an existing assembly (dll)

Today I needed to strong name an existing third party assembly in order to use it for SharePoint (GAC). I found a great solution from "DoubleJ" at http://sadeveloper.net/forums/p/1195/5115.aspx

I copied it here in order to make sure I does not get lost:

"From a VS.NET command prompt, enter the following:

1. Generate a KeyFile
sn -k keyPair.snk

2. Obtain the MSIL for the provided assembly
ildasm providedAssembly.dll /out:providedAssembly.il

3. Rename/move the original assembly
ren providedAssembly.dll providedAssembly.dll.orig

4. Create a new assembly from the MSIL output and your assembly KeyFile
ilasm providedAssembly.il /dll /key= keyPair.snk

Viola! You now have a strong named assembly."

WebPart button event fires only once

In order to make sure a button in a WebPart (for example to export data to excel) can be clicked more than once add the following to the OnClientClick event:

buttonExportToExcel.OnClientClick = "_spFormOnSubmitCalled = false;_spSuppressFormOnSubmitWrapper=true;";

Virtual PC: Performance Issues on Notebook, Mini-PC etc.

Power management may slow down virtual PC. I found a solution that works perfectly on my Notebook:
http://svengillis.blogspot.com/2008/01/performance-issues-with-virtual-pc-on.html

Essentialy I had to change the enable_idle_thread setting in the options file located at
C:\Users\[My User Name]\AppData\Local\Microsoft\Windows Virtual PC in my windows machine.







The secrets of SQL Syntax Queries for Relevant Results in MOSS 2007 Enterprise Search

I just found a very helpful post from Lars Fastrup containing a nice overview and samples for SQL syntax queries in MOSS 2007 Enterprise Search:
http://blog.sharepointproducts.com/archive/2009/03/31/repost-the-secrets-of-sql-syntax-queries-for-relevant-results-in-moss-2007-enterprise-search.aspx

Wildcards in the CONTAINS Predicate in Windows SharePoint Services Search SQL Syntax - no results

If you get no results with CONTAINS and wildcard search in MOSS make sure you don't forget the " in the query. The MSDN documentation does not include them.

wrong: select title, author, rank from scope() where CONTAINS (defaultproperties, 'sharep*') order by rank desc

correct: select title, author, rank from scope() where CONTAINS (defaultproperties, '"sharep*"') order by rank desc

I recommend http://www.codeplex.com/SPSearchBench for testing.

Content for this URL is excluded by the server because a no-index attribute

In SharePoint/MOSS server search crawl log you may see "Content for this URL is excluded by the server because a no-index attribute" apear for pages that you would like to be indexed.

What to check in this case:
  • Rules
  • Robots.txt file
  • Page Source (robots meta)
  • Page library advanced settings
  • 'Site Settings' - 'Search Visibility' under 'Site Administration'
  • and last but not least: Make sure you can access the page with the user that you definied as robots/crawler user. See central administration:
    /ssp/admin/_layouts/contentaccessaccount.aspx
    (log on to your site with this user)

Hint fot German users: The error message in German is "Der Inhalt für diese URL wird wegen eines Nichtindexattributs vom Server ausgeschlossen".

How to copy a MS SQL database from one server to another without server admin rights on source machine

Step 1: Generate a SQL script including data by using SQL Server Database Publishing Wizard:
The wizard is integrated in Visual Studio Server Manager. Alternate download for older versions: http://www.microsoft.com/Downloads/details.aspx?displaylang=en&FamilyID=56e5b1c5-bf17-42e0-a410-371a838e570a

Step 2: Use SQLCMD.exe to execute the file.
Normally you can't use the query analyzer because it would throw an exception of type System.OutOfMemoryException:

sqlcmd -S servername -d TargetDBName -i C:\SQLFileGeneratedByDBPubWizard.sql -o C:\DBImportLog.txt

Have a look at the log file to see what's going on.

If you can not execute sqlcmd on the target machine you might for example want to write a command line tool that executes the sql commands in smaller blocks.

SharePoint Search Queries Test Utility

Found a new very helpful windows utility today to test SharePoint Search Queries. Also displays scopes and managed properties.
http://www.codeplex.com/SPSearchBench

Export MOSS (SharePoint) page library (or any other List) to file system

Exporting a page library in MOSS can be quite tricky. One great alternative ist to use SPIEFolder (http://www.codeplex.com/SPIEFolder) that can export the files quite fast to a file system folder of your choice as follows.

Example command:
SPIEFolder.exe http://win2003-moss1/DE/MediaMessageImport Seiten C:\OutputTest export

The files can then easily be reimported for instance via web browser (upload files).

Save/export MOSS (SharePoint) Page Library as STP

Unfortunately there is no "save list as template" option in MOSS for page libraries. A simple work around is to use the /_layouts/savetmpl.aspx page and add the query string value for list manually. This might finally look something like this:

http://win2003-moss1/DE/MMImport/_layouts/savetmpl.aspx?List=%7B19216C57%2D1B09%2D4CDB%2DB766%2DF0289E3D28F5%7D

Explorer.exe high CPU on Windows Server 2008

I had very high CPU usage for explorer.exe today on a web server running Windows Server 2008. Task manager showed that it was running under the Administrator Account.

I did not log off the last time I worked on this machine and it seams that explorer.exe bug out meanwhile. Thus the solution for now is logging of and log on again. If I find out more or if the problem reoccurs I will post that here.

SharePoint Workflows: Delay Activity not working/firing after GAC update

I recently had an issue with a Delay Activity not firing after I updated the GAC from Visual Studio 2008.

I finally found a MS KB that helped me:
"A workflow does not resume automatically when a delay activity is triggered in Windows SharePoint Services 3.0"
http://support.microsoft.com/kb/953630/en-us

Solution for my project: Restart the Service "Windows SharePoint Services Timer" after an update.

P.S. The same trick also helps to solve the "System.IO.FileNotFoundException" issue that can occur when installing a wsp with a feature receiver.

News-Ticker

Juli 12: HTML5 Validator für SiteAnalyzer
Tipp: Beim Umstieg auf HTML 5 hilft Ihnen der SiteAnalyzer gerne weiter. Laden Sie dazu die aktuelle Version herunter um die ganze Website auf Fehler und Probleme zu prüfen.
Mehr Infos und Download
Jan 12: Brandneues SiteAnalyzer Video online
Lernen Sie den SiteAnalyzer (noch) besser kennen:
zum neuen Qualidator® SiteAnalyzer Video
Jan 12: Neues Forum auf XING
Neu gibt es zusätzlich zur Facebook Page auch ein Qualidator Forum auf XING. Wir freuen uns auf Ihr Feedback und spannende Kontakte.
https://www.xing.com/net/qualidator-projekt-forum
Nov 11: Entwickler gesucht
seven49.net/ Qualidator sucht laufend Software Engineer ASP.NET / Sharepoint wie auch Partnerfirmen, die solche Dienste anbieten.
Zum Stelleninserat
Sommer 2011: Umfragen
Mach mit bei unseren Umfragen und gewinne ein iPad 2 und andere tolle Preise:
http://myrating.polls.qualidator.com
http://siteanalyzer.polls.qualidator.com
Nov 10: Facebook Page
Bist Du bereits ein Qualidator® -Fan?
Besuch uns auf Facebook!
Okt 10: HTTP Komprimierung testen
Die HTTP Komprimierung kann neu direkt im SiteAnalyzer getestet werden. Dies auch mit verschiedenen Browsern resp. User Agents. Mehr Infos und einen Screenshot finden Sie unter Know-how - HTTP Komprimierung Gzip/Deflate testen
Sep 10: Kantonsranking
Schweizer-Kantonsranking der Fachzeitschrift "Computerworld" mit Hilfe von Qualidator.
Zum Artikel
Zum Kantonsranking
Jun 10: Qualidator für SmartPhones
Die Website wurde in den letzten Monaten stetig weiter fürs iPhone und andere SmartPhones optimiert. Probieren Sie es aus. Feedback willkommen.
Feb 10: Generators
Weltweite Qualidator® Generator-Studie: Welche Generators (Content Management Systeme, Editoren und Wikis) führen zu erfolgreichen Webauftritten?
Zur Studie
Sep 09: Websites der öffentlichen Hand

Pressemeldung:
2. Qualidator-Studie: Websites der öffentlichen Hand überzeugen mit Top-Qualität
Graubünden sticht im DACH-Vergleich Wien und Nordrhein-Westfalen aus
Zur Pressemeldung
Sep 09
Zweite Qualidator®-Studie: Die Webauftritte der eidgenössischen Departemente, der Kantone und der grössten Schweizerstädte im Vergleich zum deutschsprachigen Ausland
Download der Studie
Juli 2009

Das erste Qualidator® SiteAnalyzer Video ist online!
April 2009

Follow us on Twitter
März 2009

Neu: Qualidator-Ranking der Firmenwebsites der registrierten "Swiss Made Software"- Mitglieder. Swiss Made Software ist ein Label für schweizerische Software-Unternehmen, initiiert von Luc Haldimann.
März 2009

Neue kostenlose Tools für Sie!
März 2009

Schon gesehen? Neu gibt es auf Qualidator.com Branchen- und Gruppenratings. Diese werden nun laufend ausgebaut.
Februar 2009

Exklusiv und kostenlos - Kennen Sie den neuen Qualidator HTML Optimizer bereits?
Ein weiteres hilfreiches Tool für Sie!

Empfehlung: Vertiefte Website-Qualitätsanalyse

Empfehlung: Uptime Monitoring

Partner

  • SwissMadeSoftware
  • ZTPrentner IT
Copyright © 2009 seven49.net GmbH
Quelle: http://www.qualidator.com/Web/de/Know-how/SharePointMOSS_NET_CVBNET_Blog.htm