Archives
-
Links 2009-02-28
NB! This blog is moved to gunnarpeipman.com
-
Refactoring: extract interface
Extract interface is one of the most common refactoring techniques. Motivation behind extract interface refactoring method is to avoid direct dependencies between classes. Instead of using classes in method calls we use interfaces so we can also use subclasses of those classes we used before. Also we can create brand new classes that use follow these interfaces and we can use these classes instead of current ones.
-
SharePoint: creating SharePoint accounts for Live ID users
Couple of weeks ago I started adding Windows Live ID authentication support to SharePoint. I used Community Kit for SharePoint and I also made here some notes about it. There was one problem – although user is authenticated there is no SharePoint user and it is not possible assign it to any roles. Here is some advices how to create SharePoint user account when new user is registered after logging in using Live ID.
-
ASP.NET MVC: Ignore requests to favicon.ico
One problem I faced when writing my example pet portal on ASP.NET MVC was Google Chrome’s request to favicon.ico that doesn’t exist. IE8 that I use (8.0.7000.0) doesn’t make these blind requests to discover that favicon.ico is not there. Solution to my problem was very simple. Just add the ignore rule for favicon.ico to Global.asax file, in the beginning of RegisterRoutes method:
-
SharePoint: Writing messages to ULS (Unified Logging System)
If you want to make your SharePoint solution more SharePoint way you can write your tracing, debug and error messages to SharePoint log. Easiest way to do it is to write logger by yourself. Btw, SharePoint has class called ULS to write messages to logs but this class is internal and we cannot use it. But it is there.
-
SharePoint: Access denied error when adding new page to page library
On one of my servers I detected very weird error. There are authenticated users who can add content to some page libraries and modify pages they have made. One day suddenly they were not able to add pages to page library anymore because of Access Denied error. Well, thanks Google, God and Clinton Cherry for saving my ass this time.
-
Links 2009-02-24
NB! This blog is moved to gunnarpeipman.com
-
Starting with ASP.NET MVC
About a week ago I started learning ASP.NET MVC framework. It is pretty cool entertainment for cold winter nights as I found out. Here are the steps I made to get started:
-
Show your Twitter log in SharePoint
About year ago I wrote how to display blog feeds in SharePoint sites using XML Web Part. Today is Twitter very popular and we can use XML Web Part to render Twitter feeds. To see how to configure XML Web Part check out blog feeds entry referred above. This time you have to insert user Twitter feed as XML link, by example http://twitter.com/statuses/user_timeline/12358522.rss. Click XSL Editor button and insert the following XSL to dialog window.
-
Please help - Visual Studio SharePoint development environment is very slow
I run SharePoint development environment on virtual machine. Virtual machine has 2GB RAM and 30GB disk space. Also I have no complaints over processor (I can run here two usual ASP.NET development virtual machines parallel). All other Visual Studio projects are working well except those that use VSeWSS 1.2. Hard performance problems occur usually at these moments:
-
Links 2009-02-19
NB! This blog is moved to gunnarpeipman.com
-
Debugging SharePoint solutions using Visual Studio
Debugging SharePoint solutions with Visual Studio on local machine is pretty easy. Although you can find articles about how to deploy your PDB files to global assembly cache etc it is more simpler than that. Just follow the steps below. Btw you can click on images if you want to see them on original size.
-
SPListItemCollection.GetDataTable() – be careful
Seems like I am stuck in ADODB days a little bit and I still expect that query with no results returns at least some meta data. Or at least my code gets no bombed by null references. SPListItemCollection has GetDataTable() method that returns items collection as ADO.NET DataTable objects. Be careful when using this method – if your items collection is empty then this method returns null.
-
Windows Mobile 6.5 screenshots
Guys from wmpoweruser.com have posted some nice Windows Mobile 6.5 screenshots. Feel free to follow these links to see what is waiting for us.
-
Creating cross-site lookup field in SharePoint
Cross-site lookup field is something we need almost every project that is not very small. There is no good OOTB solution but we can use field by Toby Bierman. This kind of field is easy to create because SPFieldLookup is cross-site by its nature. Basically you ave to perform the following steps.
-
SharePoint and Windows Live Authentication
In one of my SharePoint projects I had to implement authentication using Windows Live ID. I’m too lazy to code all this stuff from zero if it is possible to find already working solutions. I found out that Community Kit for SharePoint has something for me – Windows Live Authentication 1.0. After some hacking everything started to work.
-
UserProfileManager.UserExists and “Operation is not valid due to the current state of the object”
I have clean install of MOSS 2007 and I have one .aspx page that makes some request to SSP. All the code in this page is running in elevated permissions and I decide programmatically what kind of content this page shows to visitor. When I check if user profile exists I get the following error message: Operation is not valid due to the current state of the object.
-
Visual Studio add-in: CopySourceAsHTML
When I started with this blog I needed some tool to copy code snippets from Visual Studio to Windows Live Writer so I get formatted code. There is cool online code highlighter called GeSHi, but I wanted my code to look like in Visual Studio editor. After some searching I found Visual Studio add-in CopySourceAsHTML.
-
Some notes about custom C# application and Exchange Server 2003 integration
Custom C# application and Exchange Server 2003 integration over WebDAV was one of the tasks I lately worked on. I made posting about how to log on to Outlook Web Access when FBA is used but I didn’t mentioned that I had to read data from Exchange public folders. There are some stuff that may drive you nuts but there are also some tricks to use to get everything work as expected.
-
Refactoring: rename method
One of the simplest refactoring methods is called Rename method. There are many reasons why one may want to change the name of some method. I think that main reason to rename a method is to give it a name that describes better what method is supposed to do.
-
Links 2009-02-07
SharePoint
- Installing a Language Pack for MOSS
Mauro Cardarelli writes about how to install language packs to MOSS 2007. It is good guide to follow if you have clean MOSS 2007 install without any language packs.
- Building multi-lingual SharePoint sites - introducing the Language Store
Chris O’Brien writes about how to use SPLanguageStore to create multi-lingual SharePoint sites where you can easily manage the translations through SharePoint user interface.
- ServerTemplate Numbers
Evan Grimmett offers us a table of SharePoint list template numeric codes. It is handsome list to use when you have to create lists and templates through code.
.Net
- Debugging Slides
Zain Naboulsi offers some slides from his Visual Studio 2008 debugging tips and tricks presentation.
- .NET Memory Leak: To dispose or not to dispose, that’s the 1 GB question
Tess Ferrandez writes about importance of disposing objects. Through the use of debugging tools we can see how Tess analyzes problems with code and finds the reason of memory leaks. Suggested reading for all developers.
- When is a Type not a Type?
Brad Wilson gives us overview of .Net Type class and the types itself and describes some interesting facts related to types in .Net.
- Installing a Language Pack for MOSS
-
Apache, IIS and 502 proxy error
I have some servers in my network. There is one public Apache server that proxies requests to these servers. These servers are not directly visible from internet. Some of these servers run IIS and ASP.NET web applications. When accessing these servers through internet then sometimes Apache reports a problem: 502 proxy error.
-
SharePoint: temporary solution for GetCustomProperty and SetCustomProperty errors
Another day, another kinky problem with SharePoint. This time I struggled with custom properties of my custom field. I tried out different code samples to make GetCustomProperty and SetCustomProperty to work but no luck at all – nothing worked for me. There was no errors when adding field to list or changing field properties but custom properties were never saved. I don’t like solutions like my version comments solution but some (not only some, sorry) parts of SharePoint need brutality and violence to work like expected. But I have solution.