Can't find System.Web.Abstractions

Last post 05-15-2008 10:04 PM by subdigital. 5 replies.

Sort Posts:

  • Can't find System.Web.Abstractions

    05-15-2008, 11:14 AM
    • Contributor
      3,569 point Contributor
    • shapper
    • Member since 11-28-2004, 9:15 PM
    • Posts 2,947

    Hello,

    I downloaded and installed MVC Preview 2.

    I created a web application but I am getting the following error:

     Warning    1    C:\Documents and Settings\My Documents\Visual Studio\MVC\WebSite\Default.aspx: ASP.NET runtime error: Could not load file or assembly 'System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. (C:\Documents and Settings\My Documents\Visual Studio\MVC\WebSite\web.config line 42)    C:\Documents and Settings\My Documents\Visual Studio\MVC\WebSite\Default.aspx

    I see the reference to this library in my project references.

    Do I need to install something else?

    Thanks,

    Miguel
     

  • Re: Can't find System.Web.Abstractions

    05-15-2008, 1:17 PM
    • Contributor
      2,093 point Contributor
    • subdigital
    • Member since 08-11-2004, 12:02 PM
    • Houston
    • Posts 444
    • ASPInsiders

     While you're at it you might as well download the 4/16 preview 2 update.

     It comes with 3 dlls:

    • System.Web.Abstractions
    • System.Web.Routing
    • System.Web.Mvc

    I place those in a folder in my app call Lib.  I prefer not to depend on files outside my project's root.

    Try copying the relevant files into your solution's directory (under lib or similar) and then re-add the references in your projects.  See if that helps. 

     

    Ben Scheirman
    http://www.flux88.com

    ASP.NET MVP
    Certified ScrumMaster
    ASPInsider
    MCSD
  • Re: Can't find System.Web.Abstractions

    05-15-2008, 3:52 PM
    • Contributor
      3,569 point Contributor
    • shapper
    • Member since 11-28-2004, 9:15 PM
    • Posts 2,947

    Thanks!

    Just one question: I place the DLL's in Bin folder ... I always did that. Any problem? 

    Thanks,

    Miguel 

  • Re: Can't find System.Web.Abstractions

    05-15-2008, 4:02 PM
    • Contributor
      2,093 point Contributor
    • subdigital
    • Member since 08-11-2004, 12:02 PM
    • Houston
    • Posts 444
    • ASPInsiders

    No don't place it there.  The Bin folder is an output directory, so your dlls will get copied there.

    In any project you should be able to delete the bin and obj folders without any ramifications.

     

    My projects generally look like this:

    • Solution
      • config
      • lib
      • tools
      • source
        • project 1
        • project 2
        • project 3

    config holds things like connection strings and log settings

    lib holds libraries that we depend on at runtime (such as asp.net mvc or NHibernate)

    tools holds developer tools that we use (such as NAnt for builds, NUnit/RhinoMocks for testing)

    source contains the vs projects

     

    Does this help? 

    Ben Scheirman
    http://www.flux88.com

    ASP.NET MVP
    Certified ScrumMaster
    ASPInsider
    MCSD
  • Re: Can't find System.Web.Abstractions

    05-15-2008, 8:35 PM
    • Contributor
      3,569 point Contributor
    • shapper
    • Member since 11-28-2004, 9:15 PM
    • Posts 2,947

    I though libraries, i.e., dll's should be inside the project ... ok not inside bin but inside the project folder.

    And connection strings shouldn't be inside Web.Config also under project folder?

    Finally, I usually use the following structure:

    • Solution
      • Project 1
        • External
        • Assets
        • Library
      • Project 2

    So, for example, if I am working on a web site application Project 1 would be the web site and Project 2 would be an SQL database project.

    Then inside web site project I have, besides the normal ASP.NET folder, External where I place all assets (XML files, Images, etc) needed for third party products.

    For example, when using SlideShowPro (Flash) it needs the XML files, images an so on to be all in the same root so I open a folder with the name of the company under External for that.

    Assets is where I place all assets I use. From scripts, css styles, flash, images, videos, documents, ... Usually under a localization folder:

    • Assets
      • EN
        • Images
        • Scripts
        • Styles
        • ...
      • PT
        • Images
        • Scripts
        • Styles
        • ...

    Well this is how I usually do it ... with time I always try to improve things like using your suggestion of creating a Libraries folder ...

    I am not sure if this is the best way but there are two items that I have been trying to improve for a long time:

    1. web site organization (I use the described scheme for 6 months or so)

    2. css styles organization. In big projects this can give huge headaches but I tend to follow the HTML markup and use table of contents for search.

    Thanks,

    Miguel 

  • Re: Can't find System.Web.Abstractions

    05-15-2008, 10:04 PM
    • Contributor
      2,093 point Contributor
    • subdigital
    • Member since 08-11-2004, 12:02 PM
    • Houston
    • Posts 444
    • ASPInsiders

    shapper:
    I though libraries, i.e., dll's should be inside the project ... ok not inside bin but inside the project folder.
     

    More than 1 project will reference these libraries.  Thus, they should reside outside of a project specific folder and into the solution folder.

    shapper:
    And connection strings shouldn't be inside Web.Config also under project folder?

    Again, connection strings and log settings are something that you'd like to define once and use everywhere.  My build process takes an xml file with settings in it and generates connection string config files, database project settings, test connection strings, etc and copies those into their locations.  This way I only define these settings in 1 place.

     

    But this thread is getting off topic, if you want to discuss more, open a new thread :)

    Ben Scheirman
    http://www.flux88.com

    ASP.NET MVP
    Certified ScrumMaster
    ASPInsider
    MCSD
Page 1 of 1 (6 items)