Derik Whittaker

Syndication

News


Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
Trust your tools, but only if you know what they are doing.

Yesterday we were trying to change the session state properties of one of our sharepoint web sites and what resulted was really odd.

After we made the changes, we started getting the following  in our event log error:
Error: Failure in loading assembly: Microsoft.SharePoint.Portal,
Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c

Here is what we did

  1. opened up IIS
  2. right clicked on the site
  3. choose properties. 
  4. clicked to the ASP.Net tab
  5. clicked edit configuration
  6. clicked to the state management tab
  7. changed the Session State Mode from inProc to StateServer. 
  8. clicked ok, and thought everything was good to go.

But wait, now NOTHING worked.  Sure, we could still surf to the home page of the sharepoint site, but trying to do anything caused errors.  So, we set everything back to the original values thinking this would solve our problem.  NOPE.

After trying a bunch of different things and checking on google we finally found the issue (here).   The problem is we trusted the ASP.net configuration tool would do its job correctly, bad assumption.

Turns out that when you use the configuration tool, it will add an xmlns attribute (xmlns=http://schemas.microsoft.com/.NetConfiguration/v2.0) to the <configuration> node.  For what ever reason, sharepoint does NOT like this node and will not parse the web.config file correctly.

To resolve this issue, we simply removed the xmlns attribute and everything worked fine.

I am not sure why the config editor would add this, if anyone knows please share.  Hope this post can help the next poor sap that has this issue.

Till next time,


Posted 12-05-2007 1:42 PM by Derik Whittaker
Filed under: ,

[Advertisement]

Comments

JC wrote re: Trust your tools, but only if you know what they are doing.
on 12-06-2007 2:54 AM

The ASP.NET Config tool in Visual Studio does the same thing.

It's very annoying, since it's a good tool to quickly set up user accounts and roles for a new site, but once this xmlns attribute gets added to web.config, it breaks all the intellisense (and *nobody* memorises all the valid options for web.config :)

Anyway, your post got me thinking - it's probably safe to set the config file to read only for a live site, once it's running correctly. Then nothing can modify it outside of your control!

Derik Whittaker wrote re: Trust your tools, but only if you know what they are doing.
on 12-06-2007 5:53 AM

@JC

I like your thought of making the file read only.  Although this will not truly stop anyone from making change, but it should at least force them to think about why they are making them when they have to make the file writable.

Tomas Tintera wrote re: Trust your tools, but only if you know what they are doing.
on 12-06-2007 12:27 PM

Dear Derik,

a coleague had simmilar issue, when adding new node by DOM of MS XML parser. So the problem can be deep in this component.

We couldn't find a way to add node without XMLNS.

About The CodeBetter.Com Blog Network
CodeBetter.Com FAQ

Our Mission

Advertisers should contact Brendan

Subscribe
Google Reader or Homepage

del.icio.us CodeBetter.com Latest Items
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Subscribe with myFeedster
Add to My AOL
Furl CodeBetter.com Latest Items
Subscribe in Rojo

Member Projects
DimeCasts.Net - Derik Whittaker

Friends of Devlicio.us
Red-Gate Tools For SQL and .NET

NDepend

SlickEdit
 
SmartInspect .NET Logging
NGEDIT: ViEmu and Codekana
LiteAccounting.Com
DevExpress
Fixx
NHibernate Profiler
Unfuddle
Balsamiq Mockups
Scrumy
JetBrains - ReSharper
Umbraco
NServiceBus
RavenDb
Web Sequence Diagrams
Ducksboard<-- NEW Friend!

 



Site Copyright © 2007 CodeBetter.Com
Content Copyright Individual Bloggers

 

Community Server (Commercial Edition)