Wednesday, September 29, 2010
Integrating ReSharper into Visual Studio 2010
Sunday, September 05, 2010
Error accessing Business Data Connectivity Services in Windows 7
While I was doing some research on BCS , wanted to import a BDC model from Central Administration > Manage service applications > Business Data Connectivity Services.
As I hit the link, following error message prompted.
As usual did a search on the Google and found out the following entries.
http://sensoft2000-sharepoint.blogspot.com/2010/08/error-access-services-is-unable-to.html
https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=23806
Downloaded the above fix and installed.
problem solved. :)
More references on the issue :
http://support.microsoft.com/kb/976462
http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=976462&kbln=en-us
Tuesday, September 15, 2009
Internal names should be used in SPQuery
I wanted to change the display names of my fields and after doing that I renamed all the usages of that field name in my web part code.
After deploying the solution I got the error message "One or more field types are not installed properly. Go to the list settings page to delete these fields"
I had no clue what so ever when you read that error message.This is not the only error message that share point generates which we cannot figure out by looking at this.
I spent considerable amount of time debugging the solution until I decided to Google the error message.
Then found that in one of the msdn forums that the internal names of the fields should be used in the CAML queries.
And that was indeed the trick.
Tuesday, August 18, 2009
How to avoid recursive calls in list item event receivers in SharePoint
I wanted to insert a value into a column in a list when adding and updating items in the same list.
First I registered the item event receiver into the list.
SPList list = web.Lists[listName];
list.EventReceivers.Add(eventType, assemblyName, className);
Then in the actual event receiver class I override the “ItemAdded” and “ItemUpdated” methods.
public override void ItemAdded(SPItemEventProperties properties)
{
SPListItem item = properties.ListItem;
string itemStatusValue = string.Format("Item added @ {0} by {1}", DateTime.Now.ToLocalTime(),
properties.UserLoginName);
item["columnName"] = itemStatusValue;
item.Update();
}
public override void ItemUpdated(SPItemEventProperties properties)
{
SPListItem item = properties.ListItem;
string itemStatusValue = string.Format("Item updated @ {0} by {1}", DateTime.Now.ToLocalTime(),
properties.UserLoginName);
item["columnName"] = itemStatusValue;
item.Update();
}
But when I debug this in VS2008 I noticed that, as the item get updated or added it always calling to the “ItemUpdated” method.Of course that is understandable since I am updating a column in the same list. But I didn’t want that to happen.Then I found out that you can enable/disable event firing.
So the solution for that is ,
DisableEventFiring();
item.Update();
EnableEventFiring();
It is pretty straight forward once you get to know it.
More references on this : Visit BinaryJam
Friday, August 07, 2009
List content type troubleshoot
Recently I had a problem with the default content types that are bind with a custom list.
I created an Announcement list and I have bind my own content type into it.Then I wanted to hide the default content type which is the “Announcement”.Initially I used the name to get the content type from the list but later I had to re factor it simply because, if we are to support multilingual we should not use names but id’s.
Then I thought this should be a piece of cake and I re factored it like bellow.
SPList list = web.Lists[listName];
SPContentType item = list.ContentTypes[SPBuiltInContentTypeId.Announcement];
item.Hidden = true;
item.Update();
list.Update();
To my amazement , as I activated the updated feature I got the error “Object reference not set to an instance of an object”.
And then I open this list from the SharePoint Manager and checked the ID of the content type “Announcement” and it is totally different one to the default content type id which is the “0x0104”.
Then I got some expert help on this and got to know that this is because what ever the bind content types in lists are a copy of the site content type.Thank you Bjorn for letting me know about it.
So here is the new code of doing it.
SPContentType item = list.ContentTypes[list.ContentTypes.BestMatch(contentTypeId)];
It was that simple once you got to know it.
So what you need to understand here is that adding a content type to a list means that you actually adding a copy of the content type.
Friday, April 03, 2009
Fiddler to capture request from Firefox
Fiddler to capture requests from Firefox you need to do a small configuration in Firefox.
In Firefox 3.0.8 (one I am using) follow the steps bellow
- Go to Tools > Options > Advanced > Settings
- Set the “Automatic proxy configuration URL” to “C:\Users\<user name>\Documents\Fiddler2\Scripts\BrowserPAC.js”.(NOTE : change the BrowserPAC.js path accordingly)
- Click Ok
- Close the Fiddler and open if you have already opened the fiddler.
Reference : http://www.fiddlertool.com/Fiddler/help/hookup.asp
Behind the scene :
What happens here is that , when you open the fiddler, the function “FindProxyForURL” in the “BrowserPAC.js” will change to this
function FindProxyForURL(url, host){
return 'PROXY 127.0.0.1:8888';
}
When you closes the fiddler it will change to
function FindProxyForURL(url, host){
return 'DIRECT';
}
Since you have configured the Firefox to look at this file, it will pick the proxy configuration automatically.
Problems I encountered :
After closing the Fiddler I wanted to browse some sites in Firefox but it didn’t work.It says “Connection Interrupted”.
Then I changed the proxy configuration to “No proxy” and it works.
Conclusion :
After using the fiddler make sure to revert the proxy settings back to the original in Firefox.
Worth looking at how IE handled this scenario.
Thursday, March 12, 2009
Enabling anonymous access in MOSS
Recently I wanted to enable anonymous access to one of my sites in Share Point.I enabled the anonymous access to the web application from the IIS 7.Unfortunately it didn't work.
Then only I started googling on this and found out this wonderful blog post by Sven Gillis.
It indeed save my time and sharing with you all too.
Monday, February 16, 2009
Visual Studio 2008 extensions for SharePoint
"This product can be installed if Windows SharePoint Services 3.0 has been installed first."
As usual searched in Google and found this blog entry on how to resolve the issue.
It was indeed save lots of time for me. Thanks goes to who ever contributed to this thread.
Thursday, January 15, 2009
Ajax with Share Point
Recently I had to integrate Ajax with Share Point in order to provide much needed user experience in my current project.One of the main concern was when ever a user submit a request in a page the page get refreshed.For some users it is indeed a frustrating experience.
As every one of you do ,tell me if not, I searched in Google with the term "Integrating ASP.NET AJAX with SharePoint". Bingo.... here comes the results and I read the preview of the first search result and opened the entry.
It was from the "Mike Ammerlaan's Blog " and I started reading the post and realized that this is exactly what I wanted and no need to look for a better post for the job at my hand.
I followed all the steps for the "Adding Microsoft ASP.NET AJAX Technology to SharePoint Pages" and after about hour and so I managed to integrate Ajax to my sharepoint installation.
So I thought of blogging this wonderful post for those who are reading my blog.
Link : Integrate ASP.NET Ajax with SharePoint
Then I modified one of my web part used in the project with an update panel which takes care of your asynchronous postbacks.And then I deployed the web part in the integration server , to my embarrassment the web part was not working.Actually nothing got displayed.Started scratching my head and figuring out what went wrong.
Going back to drawing board and started every web.config entry for Ajax integration and that was fine.Then suddenly I saw in the top of the ascx page the version of the "System.Web.Extensions" assembly is 1.0.61025.0 which is the version I have installed in my development environment.Then I checked the version in the sharepoint environment.That is 3.5.0.0 which comes with the .Net Framework 3.5.And that was that. I changed the version and here comes the details.
In this page I have a list of items in a one list box and you can add selected items to another list.So started to check whether it was working.I selected an item from the source list and click on the button to move and it worked like a charm.ie the item get moved to the destination list without page getting refreshed. I was really happy with it.
But then I wanted to move another item from the list and nothing happened.Mission failed. :(
So I started looking back at the post I mentioned above and it stated that, there is a hack you need to do because of the way windows sharepoint services works.
So that was the trick and I managed to do that trick with the help of the following blog entry.
Link : Easy ASP.NET 2.0 AJAX Extensions 1.0 and Office SharePoint Server 2007
Finally I managed to integrate Ajax with sharepoint and used an update panel in my web parts.
Credit goes to those two blogs.
Friday, October 24, 2008
Infragistics 2006 vol 3 CLR 2 installation failed in Vista
I have successfully installed the Infragistics 2007 Vol 1 CLR 2 in Vista.But I wanted to install the previous version of Infragistcs.
First I removed the latest version and then started installing the previous version.Then I got the following error message "Error 1606. Could not access network location %SystemDrive%\inetpub\wwwroot\"
After searching the web, found the following entry from Infragistics.
http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=9983
But I did only the registry entry change value of the key "PathWWWRoot" from "%SystemDrive%\inetpub\wwwroot" to "C:\inetpub\wwwroot".
Not needed to disable the UAC as suggested in the above article.
After installing I reverted the registry entry value back to the original value.
Thursday, October 16, 2008
Windows media player 11 cannot play the movie - codec missing ??
Since I was busy with the project work I thought of watching it after the release.
Just after the release I got my new laptop with Windows Vista installed and was working with setting up my development environment in it.So further delays of watching the movie.
After that I wanted to watch that movie and I opened it with the Windows Media Player in my new laptop.
To my amazement I could only hear the sounds but no visuals. I was scratching my hair and thinking what could be the reason for it.
Then I realized that one of the codec is missing and needed to install the codec.Then I start Googling and search for codecs for Media player in Vista.Non found which relates to Windows Vista in Microsfot sites.
Then I forget about searching for codecs and installed Real Audio player 10 Gold and tried to play the movie(.avi) file.
Bad to worst, got the same error and luckily it mentioned about the component that could be missing in order to play this file which is "ICM.XVID".
Then I Googled with that name and found the following link http://www.divxmovies.com/software/
Then I downloaded the XviD codec v1.1.3 and installed it.
Official site : http://www.divx.com/
Bingo here we go , at last I can see visuals and sooner than later I am going to watch the movie.
But my worry is why Microsoft cannot ship Windows Vista with all the codecs OR at least make avilable those codecs in their support sites.
This is rediculous.......
Saturday, October 11, 2008
Microsoft Visio 2007 Trouble shoots
When I was closing the Visio application a message popup saying that the "Visio is not responding" and having a problem with COM add-in.
After doing some googling, find out that the problem could be on of the add-ins you have installed in Visio.
Then I opened the add-in manager in Visio and disabled the only add-in I had which is the "Sent to Bluetooth".I hadn't install this adding but it is coming with the default installation.
I have already disabled the blue tooth in my box, so that could be the reason to this issue.
But I havent tried out the other way round which is enabling the blue tooth and then closing the visio before disabling the add-in.