Friday, September 04, 2009

Integrating ASP.NET Applications with SharePoint

Jamil Haddadin has an excellent post on how to perform ASP.NET related development with Visual Studio extensions for Windows SharePoint Services.

However during the development phase and due to the frequent changes we make it’s more efficient to work with the ASP.NET application directly, that will be much easier than the “coding/deploying to SP/testing” cycle you will use if you worked with the VSeWSS.

When you use the method described by Jamil you will find that you will not be able to build the ASP.NET application because of using strongly named class names in “Inhertis” attribute of the Page/Control directives.

To resolve this i don’t add the assembly name part in the “Inherits” attribute i just put the class name like the following

<%@ Page Language="C#" AutoEventWireup="true"

Inherits="MyApp.Portal.Forms.Customers"
MasterPageFile="~masterurl/default.Master" %>



This will allow you to successfully build and run the ASP.NET application, but when it comes to building and deploying to SharePoint, you will have to add the assembly info to the class name as follows


<%@ Page Language="C#" AutoEventWireup="true"

Inherits="MyApp.Portal.Forms.Customers, MyApp.Portal, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9f4da00116c38ec5"
MasterPageFile="~masterurl/default.Master" %>

so i created this simple add-in that will iterate over all the *.aspx and *.ascx files in your project and inserts or removes the assembly info in the “Inherits” attribute of the Page/Control directives1

so before you deploy to SharePoint just run this add-in and it will take care of everything :)

you can download the add-in from below

Tuesday, September 01, 2009

Problem when Combining a Reporting Services Project and a SharePoint (VSeWSS) Project within a Single VS Solution

I ran into this strange problem today,if you have a visual studio solution that contains both a Reporting Services project and a SharePoint (VSeWSS) project you will have problems when you try work with the WSP view you will receive the following error

“Error parsing Solution. Value does not fall within the expected range.”

To resolve this you have to remove the reporting services project from the solution!!!

in my environment i have VS2008 with SP1 and VSeWSS 1.2 (or 1.3).

Anyone has any explanation for this behavior??