+1-888-365-2779
Try Now
More in this section

Forums / Set-up & Installation / Installing Sitefinity as a Web Application in Visual Studio

Installing Sitefinity as a Web Application in Visual Studio

32 posts, 0 answered
  1. Chris
    Chris avatar
    57 posts
    Registered:
    12 Nov 2008
    08 Jan 2009
    Link to this post
    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.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    09 Jan 2009
    Link to this post
    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.
  3. Chris
    Chris avatar
    57 posts
    Registered:
    12 Nov 2008
    09 Jan 2009
    Link to this post
    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
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    10 Jan 2009
    Link to this post
    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.
  5. Chris
    Chris avatar
    57 posts
    Registered:
    12 Nov 2008
    17 Feb 2009
    Link to this post
    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.
  6. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    06 May 2009
    Link to this post
    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!
  7. Chris
    Chris avatar
    57 posts
    Registered:
    12 Nov 2008
    06 May 2009
    Link to this post
    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
  8. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    06 May 2009
    Link to this post
    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!
  9. Chris
    Chris avatar
    57 posts
    Registered:
    12 Nov 2008
    06 May 2009
    Link to this post
    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
  10. Dave Ranck
    Dave Ranck avatar
    14 posts
    Registered:
    30 Oct 2003
    02 Oct 2009
    Link to this post
    Do you know if this will work with SiteFinity 3.7?
    Thanks.

    EDIT: I just tried it - it does :)
  11. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    04 Oct 2009
    Link to this post
    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.
  12. Tys
    Tys avatar
    15 posts
    Registered:
    17 Feb 2009
    23 Feb 2010
    Link to this post
    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!
  13. ColdCold
    ColdCold avatar
    9 posts
    Registered:
    14 Mar 2010
    15 Mar 2010
    Link to this post
    Tys,

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

    thanks.
  14. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    15 Mar 2010
    Link to this post
    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.
  15. Chris
    Chris avatar
    57 posts
    Registered:
    12 Nov 2008
    15 Mar 2010
    Link to this post
    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
  16. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    22 Mar 2010
    Link to this post
    Can someone explain why webapp instead of website project?

    Is there some pros to using a webapp?
  17. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    22 Mar 2010
    Link to this post
    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.
  18. Chris
    Chris avatar
    57 posts
    Registered:
    12 Nov 2008
    22 Mar 2010
    Link to this post
    *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
  19. Neil
    Neil avatar
    82 posts
    Registered:
    21 Oct 2006
    23 Mar 2010
    Link to this post
    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
  20. Chris
    Chris avatar
    57 posts
    Registered:
    12 Nov 2008
    23 Mar 2010
    Link to this post
    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
  21. Michael Raynal
    Michael Raynal avatar
    9 posts
    Registered:
    18 Nov 2008
    15 Apr 2010
    Link to this post
    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

  22. Chris
    Chris avatar
    57 posts
    Registered:
    12 Nov 2008
    16 Apr 2010
    Link to this post
    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
  23. Michael Raynal
    Michael Raynal avatar
    9 posts
    Registered:
    18 Nov 2008
    16 Apr 2010
    Link to this post
    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.
  24. Chris
    Chris avatar
    57 posts
    Registered:
    12 Nov 2008
    16 Apr 2010
    Link to this post
    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
  25. Michael Raynal
    Michael Raynal avatar
    9 posts
    Registered:
    18 Nov 2008
    16 Apr 2010
    Link to this post
    Thank You Chris...You re right the convert to Web App failed. I did it again and it worked perfectly...Great instructions.
  26. Yang Qu
    Yang Qu avatar
    1 posts
    Registered:
    12 Oct 2009
    22 Apr 2010
    Link to this post
    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?


  27. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    22 Apr 2010
    Link to this post
    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.
  28. Aaron
    Aaron avatar
    24 posts
    Registered:
    15 Feb 2008
    27 Jul 2010
    Link to this post
    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";



  29. Ravishankar Baranwal
    Ravishankar Baranwal avatar
    19 posts
    Registered:
    18 Mar 2009
    09 Aug 2010
    Link to this post
    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.
  30. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    09 Aug 2010
    Link to this post
    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
Register for webinar
32 posts, 0 answered
1 2