Forums

Skip Navigation LinksHome / Developer Network / Forums / Sitefinity 3.x: Set-up & Installation > Installing Sitefinity as a Web Application in Visual Studio

Installing Sitefinity as a Web Application in Visual Studio

  • Chris avatar

    Posted on Jan 8, 2009 (permalink)

    Hi,

    After it took me quite a while to install Sitefinity as a web application project in Visual Studio (which I generally prefer over the website projects), I thought I'd share my experience on how I accomplished that.
    I will not go into detail about why I chose the web application, this is perfectly covered here :

    http://reddnet.net/code/asp-net-web-site-vs-web-application-project-part-2/

    The most important part for me is the more detailed compiler output and the possibility to create XML documentations.

    Installing Sitefinity as a web application

     

    Note: This guide has been created for and tested with a blank project of Sitefinity 3.5SP1 (Community edition so far).

    -          Download the web profile builder from http://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=WebProfileBuilder&ReleaseId=980 – This is because Sitefinity uses user profiles, which are not available at compile time in a web application. For more information look here: http://weblogs.asp.net/joewrobel/archive/2008/02/03/web-profile-builder-for-web-application-projects.aspx

    -          Install the web profile Builder on your machine.

    -          Create a new web application in Visual Studio. Because Sitefinity uses C# in its files, you can only create a C# project at this point. Mixing languages is not supported in web applications.

    -          Close Visual Studio and navigate to the directory with the new application.

    -          Delete the default.aspx file and all associated *.cs files.

    -          Edit the *.csproj file and add the following line under the other <Import…> statements:
    <Import Project="$(MSBuildExtensionsPath)\WebProfileBuilder\WebProfileBuilder.targets" />
    This enables the web profile builder in the current project.

    -          Extract all files in the Sitefinity blank project into the web application directory.

    -          Re-open Visual Studio, load the project and click on “Load project normally”, as described in the web profile builder documentation. This dialog will appear only once.

    -          Click on the “Show All Files” button in the solution explorer.

    -          Select all files except for the “bin” and “obj” folders, right-click and select “Include in Project”.

    -          Right-click on the “References” folder, and add all files from the “bin” directory to your solution.

    -          Right-click on the root item in the solution explorer and select “Convert to web application”.

    -          Build the project. There will be a couple of errors, this is expected. The reason is that Sitefinity builds their product as a website, whereas we want to use a web application.

    -          In the compile errors, go through all occurrences that are like “Profile not found” or “ProfileCommon not found”. Replace these classes with “WebProfile”. This should only affect the file “ManageRecepients.cs” (yes, there is a typo in the file name).

    -          There are also 2 errors that a method in the “_Default” class cannot be re-defined in “ManageRecepients.cs” and “ChangeRecepients.cs”. Just rename these 2 classes into “Admin_ManageRecepients” and “Admin_CmsAdmin_ChangeRecepients” respectively.

    -          A new file called “WebProfile.cs” should have appeared in the solution. Right-click and import the file.

    -          Now the compile process should work without errors, and only leave lots of warnings about missing XML comments, a couple of unused variables and deprecated functions, and a few occasions where the “new” keyword should be used when overriding inherited functions. This only shows the more rigid compiler that is used in web applications. The application should run fine though.

     

    Note: When the project is run for the first time, an installer starts that leads through the creation of a database and an admin user. Occasionally it happened to me that the database creation (Oracle in my case) failed the first time with a server error. I could not find a reason for that, but so far it always worked by going back in the browser and just trying again. I never had 2 server errors in a row, and once installed the software worked as expected.

     

    Maybe this helps some of you.

    Cheers, Chris


    Update for Sitefinity version 3.6:
    This version already comes with proper namespaces for the classes in "ManageRecepients.cs" and "ChangeRecepients.cs", which takes care of the error described previously (a method in the “_Default” class cannot be re-defined). There is no need to rename these classes anymore.

    Reply

  • Ivan Dimitrov Ivan Dimitrov admin's avatar

    Posted on Jan 9, 2009 (permalink)

    Hi Chris,

    Thank you for this article.

    Here is an useful link that I found a time ago when I try to convert my Sitefinity website to Sitefinity web application.
    Upgrading VS 2005 Web Site Projects to be VS 2005 Web Application Projects

    We have not tested how the website will be running after converting it to webapp and I cannot be sure whether everything works fine.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.

    Reply

  • Chris avatar

    Posted on Jan 9, 2009 (permalink)

    I'm working with Sitefinity as a web application for a while now, and haven't noticed any issues that would trace back to the fact that this is a web application.

    Should Telerik decide to release a future version of Sitefinity as a web application, there are 2 things that should be addressed:
    • Add all those missing XML comments. After all, this provides a very useful documentation.
    • Add appropriate namespaces to all your classes. This is more of a style thing and allows more clearly structured code.

    For now, these issues only result in compiler warnings and don't affect the functionality of the site.

    Cheers, Chris

    Reply

  • Ivan Dimitrov Ivan Dimitrov admin's avatar

    Posted on Jan 10, 2009 (permalink)

    Hello Chris,

    We are also not aware of any problems when working with Sitefinity as a web app. We are considering distributing Sitefinity as a web app, but it will not happen before the release of 4.0.

    Thank you for your post about your experience with Sitefinity as a web application.

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.

    Reply

  • Chris avatar

    Posted on Feb 16, 2009 (permalink)

    Update for Sitefinity version 3.6:
    This version already comes with proper namespaces for the classes in "ManageRecepients.cs" and "ChangeRecepients.cs", which takes care of the error described previously (a method in the “_Default” class cannot be re-defined). There is no need to rename these classes anymore.

    Reply

  • Posted on May 6, 2009 (permalink)

    we are looking to getting source control, and would like to use it to manage sitefinity. However, we are currently just doing a mirror of our live site to our dev site, uploading as things are completed. As a result, we have thousands of user documents like pdfs, docs, images, etc that do not need to be in source control

    I think converting this to a web application instead of a web site would be the best way to do this, since I can exclude folders that don't need to be versioned. however, I've never done this before, and I'm unclear as to whether sitefinity supports this, and how difficult it is to do...

    is there a definitive procedure or KB item that details how to convert the site to an app?

    does running it as an app instead of a website mean I have to run (F5) the site in order to view it, or can I still use the built in IIS that I'm currently using?

    thanks for your help!

    Reply

  • Chris avatar

    Posted on May 6, 2009 (permalink)

    There is no official procedure or KB article that I am aware of, which is why I opened this thread. In IIS, the web application behaves similar to the website version, except that all the code resides in a dll instead of hundreds of *.cs-files. This speeds things up a little once the dll is cached. It still works with any IIS or the Visual Studio development server. The only difference is that you will have to compile the application (CTRL+F5 or CTRL+SHIFT+B) before you can see any changes that you did to your source code.

    You can follow my first post to convert your installation to a web application, however I don't think that this would change anything regarding source control.

    Why don't you just exclude these files and directories in your current website installation?

    Cheers, Chris

    Reply

  • Posted on May 6, 2009 (permalink)

    thank you for your quick reply!

    unfortunately you can't exclude files from web sites like you can with applications, at least I don't know of any way to do so.

    I think I might give it a shot, anyone from the sitefinity team have any additional pointers or suggestions that hasn't already been mentioned above?

    I'm running 3.6 sp1 hotfix by the way

    thanks!

    Reply

  • Chris avatar

    Posted on May 6, 2009 (permalink)

    OK, I wasn't aware of that limitation in Source Control. We are using Subversion here, which is not integrated in VS as tightly and has no problems with excluding any files or directories independent of type or content.

    I am going the web application way since version 3.5 and haven't had any problems so far.

    Cheers, Chris

    Reply

  • Terry Rooks avatar

    Posted on Oct 2, 2009 (permalink)

    Do you know if this will work with SiteFinity 3.7?
    Thanks.

    EDIT: I just tried it - it does :)

    Reply

  • Ivan Dimitrov Ivan Dimitrov admin's avatar

    Posted on Oct 4, 2009 (permalink)

    Hello Mike Brady,

    You should be able to convert website project to web application using the link provided in one of the previous posts.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.

    Reply

  • Tys avatar

    Posted on Feb 23, 2010 (permalink)

    For SiteFinity 3.7, if you follow Chris's posts everything works fine. 
    I only had to add trust level info to the web.config. 

    I'm quite happy i did this, because build times have improved a lot. 
    Thanks for the info!

    Reply

  • ColdCold avatar

    Posted on Mar 15, 2010 (permalink)

    Tys,

    Can you elaborate on the trust-level info you had to add to web.config?

    thanks.

    Reply

  • Ivan Dimitrov Ivan Dimitrov admin's avatar

    Posted on Mar 15, 2010 (permalink)

    Hello ColdCold,

    You can gather more information about application trust level at MSDN - trust Element

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

    Reply

  • Chris avatar

    Posted on Mar 15, 2010 (permalink)

    There is already a thread about Sitefinity installations in medium trust environments, which should cover most of your questions:
    http://www.sitefinity.com/support/forums/sitefinity-3-x/deployment/simulate-in-development-environment-medium-trust.aspx

    Cheers,
    Chris

    Reply

  • Posted on Mar 22, 2010 (permalink)

    Can someone explain why webapp instead of website project?

    Is there some pros to using a webapp?

    Reply

  • Ivan Dimitrov Ivan Dimitrov admin's avatar

    Posted on Mar 22, 2010 (permalink)

    Hi Steve,

    You can take a look at this post - ASP.NET: Web Site versus Web Application Project

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

    Reply

  • Chris avatar

    Posted on Mar 22, 2010 (permalink)

    *Ahem* ... First post, first link: http://reddnet.net/code/asp-net-web-site-vs-web-application-project-part-2/ ;)

    For my part, I very much like the more rigid compiler. For example, if Sitefinity was distributed as a web app, Telerik might have caught the following warnings:

    Warning    'Telerik.IControlPanelCommand' is obsolete: 'Use Telerik.Web.ICommandPanel instead. There is also base implementation for this interface Telerik.Web.CommandPanelBase'    \Sitefinity\Admin\Modules.aspx.cs

    Warning    'Telerik.IWebModule.CreateToolBoxControls(System.Web.UI.TemplateControl)' is obsolete: 'The method should return empty array'    \Sitefinity\Admin\Modules.aspx.cs

    Warning    'Telerik.IControlPanel' is obsolete: 'Use Telerik.Web.IControlPanel instead. There is also base implementation for this interface Telerik.Web.ControlPanelBase'    \Sitefinity\Admin\Modules.aspx.cs

    Warning    'Telerik.IControlPanel' is obsolete: 'Use Telerik.Web.IControlPanel instead. There is also base implementation for this interface Telerik.Web.ControlPanelBase'    \Sitefinity\Admin\Modules.aspx.cs

    Warning    'Telerik.IControlPanel' is obsolete: 'Use Telerik.Web.IControlPanel instead. There is also base implementation for this interface Telerik.Web.ControlPanelBase'    \Sitefinity\Admin\Modules.aspx.cs

    It also makes deployment faster & easier, as well as allowing additional development scenarios (several projects in a solution with automatic cross-project references, ...).

    Cheers, Chris

    Reply

  • Posted on Mar 23, 2010 (permalink)

    Thanks Chris 12 months on and still the answer Sitefinty doesn't support web applications and will have to wait until Sitefinity 4.0. Lets hope this post isn't relevant in 2011 and version 4 delivers more than expected rather than alot of the same.

    Regards,
    Neil

    Reply

  • Chris avatar

    Posted on Mar 23, 2010 (permalink)

    Sitefinity 4.0 was supposed to be released 10 months ago (http://www.sitefinity.com/support/forums/sitefinity-3-x/general-discussions/4-0-eta.aspx) - Quote: "We think that 4.0 will be released in the end of May.", written on Jan 14, 2009.

    Instead, there were multiple minor releases (which brought a great deal of new features nevertheless) and service packs. I've tested the web application procedure with every release from 3.5SP1 (including the brand new 3.7SP3), with both Community and Standard Edition. So far, there were no problems or hickups whatsoever. The original guide is still accurate.
    The only change I noticed is the addition of namespaces in a couple of classes. This prevents the error with the ambiguous "_Default" class in "ManageRecepients.cs" and "ChangeRecepients.cs", so no change is needed there anymore.

    Still, looking forward to SF4.0.

    Cheers,
    Chris

    Reply

  • Michael Raynal avatar

    Posted on Apr 15, 2010 (permalink)

    I have need to create a Web Application Project as I want to integrate SF with our corporate ASP.Net applications including master pages which use a different version of Telerik dll.s So...I've followed the instructions Chris developed to the 'T'. Thank you Chris! However when I compile teh Blank proejct teh build returns 425 compile error such as: 

    'CreateUserWizardControl' does not contain a definition for 'CreateUserWizard1' and no extension method 'CreateUserWizard1' accepting a first argument of type 'CreateUserWizardControl' could be found (are you missing a using directive or an assembly reference?) 

    and

    'Sitefinity_Admin_ControlTemplates_Libraries_Dialogs_ItemSelector' does not contain a definition for 'tabStripItems' and no extension method 'tabStripItems' accepting a first argument of type 'Sitefinity_Admin_ControlTemplates_Libraries_Dialogs_ItemSelector' could be found (are you missing a using directive or an assembly reference?) 

    My SF version is 3.7 and Visual Studio 2008.

    Any help is appreciated

    Attached files

    Reply

  • Chris avatar

    Posted on Apr 15, 2010 (permalink)

    You cannot use Sitefinity with a different set of Telerik dlls, since the code-behind functionality of these controls is compiled into the ones that come with Sitefinity (which is why you're getting the errors).

    So, you will either have to use the version of Sitefinity that matches your existing dlls, or you will have to update your Master pages.

    Cheers,
    Chris

    Reply

  • Michael Raynal avatar

    Posted on Apr 16, 2010 (permalink)

    Thank you Chris for the quick response. At this time I am unable compile the blank database as a Web_Application. My comment about the multiple projects using different versions of Telerik is down the road. I simply need to comile the Blank db as a web app and I must be doing something wrong.

    Reply

  • Chris avatar

    Posted on Apr 16, 2010 (permalink)

    I can only see two things that would result in type and amount of errors:
    - You need to add the references to all Telerik and Sitefinity ddls in the /bin folder
    - The "Compile to Web Application" failed for some reason. Just try that again and watch the output to see if anything goes wrong there.

    Cheers,
    Chris

    Reply

  • Michael Raynal avatar

    Posted on Apr 16, 2010 (permalink)

    Thank You Chris...You re right the convert to Web App failed. I did it again and it worked perfectly...Great instructions.

    Reply

  • Yang Qu avatar

    Posted on Apr 22, 2010 (permalink)

    Hello,

    I converted Sitefintiy 3.7 to web application in visual studio 2008 by following steps provided in previous posts.
    Every time I make some change and start debugging this web app, it gives me this error:

    [HttpException (0x80004005): There were errors during services initialization, check the error log for details.]
       Telerik.Framework.ServiceHost.Initialize() +617
       Telerik.Cms.Web.CmsHttpModule.Init(HttpApplication context) +140
       System.Web.HttpApplication.InitModulesCommon() +65
       System.Web.HttpApplication.InitModules() +43
       System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) +729
       System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +298
       System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +107
       System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +289
    
    
    
    but then I refresh page, everything works fine.

    Anyone know how to fix this?


    Reply

  • Ivan Dimitrov Ivan Dimitrov admin's avatar

    Posted on Apr 22, 2010 (permalink)

    Hi Yang Qu,

    This is no the actual error. Please check the error log and the stack trace of the error that had been thrown before the Initialization error. You get Initialization error because another problem prevents the service for running properly.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

    Reply

  • Posted on Jul 27, 2010 (permalink)

    If I replace ProfileCommon class with WebProfile it gives the error namespace cannot be found.

    *fixed
    needed to add to ManageRecepients.aspx.cs
    using "MyAppName";



    Reply

  • Ravishankar Baranwal avatar

    Posted on Aug 9, 2010 (permalink)

    Is it possible to do the coding in c# as well in the sitefinity. inspite of the visual studio. Also one more question is there any restriction for using sql server 2008 edition. Please let me know. If the coding is possible how can we do this. Thanks in advcance.

    Reply

  • Ivan Dimitrov Ivan Dimitrov admin's avatar

    Posted on Aug 9, 2010 (permalink)

    Hello Ravishankar Baranwal,

    Sitefinity is ASP.NET website application. It is not IDE. There are no restrictions anout using SQL Server 2008.

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

    Reply

  • Ravishankar Baranwal avatar

    Posted on Aug 9, 2010 (permalink)

    I am evaluating the SiteFinity for one of my project and am eager to know how flexible it is.
    My requirement is to create aspx web pages in Sitefinity and customize few pages business logic using C#, framework 3.5. To do so, I was looking in SiteFinity where I can add my custom code but didn’t found any place. Most of the CMS provide this flexibility to add the custom modules. Please help me to locate the same.

    Reply

  • Posted on Aug 9, 2010 (permalink)

    Ravishankar,
      Sitefinity is the CMS, it's really just a plain asp.net website project (C#)...you can add new usercontrols by just putting in ascx control in the webroot somewhere and add a node to the toolbox in the webconfig.

    So you have two options
    1) Make you page in the CMS, and drag-drop the functional components you build onto it
    2) Create the page yourself in visual studio, and in the CMS mark it as "external"...downside here is that you cant change page data IN the CMS.

    You wont find a more flexible CMS...

    Reply

  • Register for webinar
Skip Navigation LinksHome / Developer Network / Forums / Sitefinity 3.x: Set-up & Installation > Installing Sitefinity as a Web Application in Visual Studio