Friday, July 30, 2010 ..:: Blog ::.. Register  Login
 Blog Minimize
Jun 27

Written by: Paul Rony
6/27/2007 1:38 AM 

We had a customer that was having trouble with the prerequisites to load and debug the SplendidCRM project.  First you start with Visual Studio 2005 Professional, then you add the Web Application Projects add-in, which incidentally requires a patch before it will install.  It seems simple enough but this person was still unable to load the project without the pesky Convert dialog appearing.  If configured properly, the SplendidCRM project should load with just a warning about being unable to attach to our version control system, so the presence of the Convert dialog suggests that the Web Application Projects add-in was not functioning.
 
Instead of wasting countless hours trying to get VS 2005 Pro to work, we though we would research what it would take to migrate SplendidCRM to the Web Site style of projects.  The big advantage to being a Web Site Project is that our customers can use the free Visual Studio Express Editions http://msdn.microsoft.com/vstudio/express/downloads/.  
 
At first, the conversion seemed daunting with the compiler generating 1000+ plus errors, but we quickly found out that we could solve these problems by following a few simple steps.  I'm going to document those steps here even though some of you reading this blog will have no clue what any it means.
 
Step 1) Move the registration of the SplendidCRM namespace from the top of almost all of the user controls to the Web.config file.  This is one of those features that .NET 2.0 added and that we are just now taking advantage of.  Most user controls reference our custom SplendidGrid control and therefore we must register the namespace and assembly so that the compiler will now where to find it.  We simply removed <%@ Register TagPrefix="SplendidCRM" Namespace="SplendidCRM" Assembly="SplendidCRM" %> from the top of most of our user controls and instead added a controls entry to the Web.config.  We also had to move references to the AjaxControlToolkit as the compiler complained about it as well.
<pages enableEventValidation="false">
    <
controls
>
        <
add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
/>
        <
add tagPrefix="SplendidCRM" namespace="SplendidCRM"
/>
        <
add tagPrefix="ajaxToolkit" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"
/>
    </
controls
>
</
pages>
 
Step 2) Import the SplendidCRM namespace into any file that references our CustomValidators class.  I'm not sure why we could not move this to the Web.config file as well as it clearly has a section for this, but if we did not have an Import at the top of our user controls, then the compiler would complain about any tags like <SplendidCRM:DateValidator ID="" ...
 
Step 3) Move all CS files under the App_Code folder.  By moving all our existing code to this folder, we were able to continue to use the old Codebehind attribute instead of the new CodeFile attribute, that uses the new partial class syntax.  The big benefit here is that we did not have to edit all of our files to use the new partial class syntax.  The partial class is good stuff, but by keeping the old style, we are able to continue to develop the core application using the original Web Application Project while allowing us to also create a tree for the Web Site Project and have maximum code sharing.
 
Step 4) Copy all referenced DLLs to the bin folder of the new project.  Just make sure not to include the SplendidCRM DLL from the Web Applications Project.
 
Step 5) Create a batch file to copy any changes to the new Web Site Project.  At some point we will configure SourceGear's Vault with a shared project that will have all the code behind fines in the App_Code folder, but for now, the batch file works fine.  Here it is:
    attrib -r /s C:\Web.net\SplendidCRM4\*.*
    md C:\Web.net\SplendidCRM4\App_Code
    xcopy /s /y C:\Web.net\SplendidCRM3\*.cs     C:\Web.net\SplendidCRM4\App_Code
    xcopy /s /y C:\Web.net\SplendidCRM3\*.asax   C:\Web.net\SplendidCRM4
    xcopy /s /y C:\Web.net\SplendidCRM3\*.ascx   C:\Web.net\SplendidCRM4
    xcopy /s /y C:\Web.net\SplendidCRM3\*.aspx   C:\Web.net\SplendidCRM4
    xcopy /s /y C:\Web.net\SplendidCRM3\*.asmx   C:\Web.net\SplendidCRM4
    xcopy /s /y C:\Web.net\SplendidCRM3\*.htm    C:\Web.net\SplendidCRM4
 
    xcopy /s /y C:\Web.net\SplendidCRM3\*.js     C:\Web.net\SplendidCRM4
    xcopy /s /y C:\Web.net\SplendidCRM3\*.xml    C:\Web.net\SplendidCRM4
    xcopy /s /y C:\Web.net\SplendidCRM3\*.ico    C:\Web.net\SplendidCRM4
    xcopy /s /y C:\Web.net\SplendidCRM3\*.master C:\Web.net\SplendidCRM4
    xcopy /s /y C:\Web.net\SplendidCRM3\*.skin   C:\Web.net\SplendidCRM4
 
    xcopy /s /y C:\Web.net\SplendidCRM3\*.css    C:\Web.net\SplendidCRM4
    xcopy /s /y C:\Web.net\SplendidCRM3\*.gif    C:\Web.net\SplendidCRM4
    xcopy /s /y C:\Web.net\SplendidCRM3\*.jpg    C:\Web.net\SplendidCRM4
    xcopy /s /y C:\Web.net\SplendidCRM3\*.swf    C:\Web.net\SplendidCRM4
 
    xcopy /s /y C:\Web.net\SplendidCRM3\*.config C:\Web.net\SplendidCRM4
    xcopy /s /y C:\Web.net\SplendidCRM3\*.dll    C:\Web.net\SplendidCRM4
    xcopy /s /y C:\Web.net\SplendidCRM3\*.pdb    C:\Web.net\SplendidCRM4
    del C:\Web.net\SplendidCRM4\bin\SplendidCRM.dll
    del C:\Web.net\SplendidCRM4\bin\SplendidCRM.pdb
 

Tags:

  
Copyright (c) 2006-2010 SplendidCRM Software, Inc. All Rights Reserved.   Terms Of Use  Privacy Statement
DotNetNuke® is copyright 2002-2010 by DotNetNuke Corporation