compile errors when converting web site project to web application project

Discussion in 'ASP .Net' started by John Dalberg, Mar 26, 2007.

  1. John Dalberg

    John Dalberg Guest

    I converted a working web site project to a web application project and I
    am getting a bunch of warnings and compile errors.

    All code using .NET's profile class is giving an error.

    example line:
    txtName.Text = Profile.FirstName

    gives an error:
    ... FirstName' is not a member of 'Profile'.

    Even though it worked before migration and I have an attribute for it in
    web.config:

    ...... <properties>
    <add name="FirstName" type="System.String"
    provider="AspNetSqlMembershipProvider"/>

    and then I am getting lots of warnings for the web.config file. See below.
    The warnings might be the cause for the profile errors because it couldn't
    read the attributes for the profile but why is Visual Studio giving
    warnings about the web.config file?



    Message 1 Could not find schema information for the element
    'http://schemas.microsoft.com/.NetConfiguration/v2.0:configuration'.
    C:\Inetpub\wwwroot\insite_test\Web.config 1 4 insite_test
    Message 2 Could not find schema information for the element
    'http://schemas.microsoft.com/.NetConfiguration/v2.0:appSettings'.
    C:\Inetpub\wwwroot\insite_test\Web.config 2 3 insite_test
    Message 3 Could not find schema information for the element
    'http://schemas.microsoft.com/.NetConfiguration/v2.0:add'.
    C:\Inetpub\wwwroot\insite_test\Web.config 3 4 insite_test
    Message 4 Could not find schema information for the attribute 'key'.
    C:\Inetpub\wwwroot\insite_test\Web.config 3 8 insite_test
    Message 5 Could not find schema information for the attribute
    'value'. C:\Inetpub\wwwroot\insite_test\Web.config 3 26
    insite_test Message 6 Could not find schema information for the
    element 'http://schemas.microsoft.com/.NetConfiguration/v2.0:add'.
    C:\Inetpub\wwwroot\insite_test\Web.config 4 4 insite_test
    Message 7 Could not find schema information for the attribute 'key'.
    C:\Inetpub\wwwroot\insite_test\Web.config 4 8 insite_test

    and lots more of 'Could not find schema information.." warnings.


    John Dalberg
     
    John Dalberg, Mar 26, 2007
    #1
    1. Advertising

  2. RE: compile errors when converting web site project to web application

    You need to add a WebProfile class since the provider normally expects an
    APP_CODE folder. Scott Guthrie covers this on his blog and there is even an
    add-in to generate the required class. Sorry, can't remember exactly where it
    is.
    Peter

    --
    Site: http://www.eggheadcafe.com
    UnBlog: http://petesbloggerama.blogspot.com
    Short urls & more: http://ittyurl.net




    "John Dalberg" wrote:

    > I converted a working web site project to a web application project and I
    > am getting a bunch of warnings and compile errors.
    >
    > All code using .NET's profile class is giving an error.
    >
    > example line:
    > txtName.Text = Profile.FirstName
    >
    > gives an error:
    > ... FirstName' is not a member of 'Profile'.
    >
    > Even though it worked before migration and I have an attribute for it in
    > web.config:
    >
    > ...... <properties>
    > <add name="FirstName" type="System.String"
    > provider="AspNetSqlMembershipProvider"/>
    >
    > and then I am getting lots of warnings for the web.config file. See below.
    > The warnings might be the cause for the profile errors because it couldn't
    > read the attributes for the profile but why is Visual Studio giving
    > warnings about the web.config file?
    >
    >
    >
    > Message 1 Could not find schema information for the element
    > 'http://schemas.microsoft.com/.NetConfiguration/v2.0:configuration'.
    > C:\Inetpub\wwwroot\insite_test\Web.config 1 4 insite_test
    > Message 2 Could not find schema information for the element
    > 'http://schemas.microsoft.com/.NetConfiguration/v2.0:appSettings'.
    > C:\Inetpub\wwwroot\insite_test\Web.config 2 3 insite_test
    > Message 3 Could not find schema information for the element
    > 'http://schemas.microsoft.com/.NetConfiguration/v2.0:add'.
    > C:\Inetpub\wwwroot\insite_test\Web.config 3 4 insite_test
    > Message 4 Could not find schema information for the attribute 'key'.
    > C:\Inetpub\wwwroot\insite_test\Web.config 3 8 insite_test
    > Message 5 Could not find schema information for the attribute
    > 'value'. C:\Inetpub\wwwroot\insite_test\Web.config 3 26
    > insite_test Message 6 Could not find schema information for the
    > element 'http://schemas.microsoft.com/.NetConfiguration/v2.0:add'.
    > C:\Inetpub\wwwroot\insite_test\Web.config 4 4 insite_test
    > Message 7 Could not find schema information for the attribute 'key'.
    > C:\Inetpub\wwwroot\insite_test\Web.config 4 8 insite_test
    >
    > and lots more of 'Could not find schema information.." warnings.
    >
    >
    > John Dalberg
    >
     
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=, Mar 28, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ethan V
    Replies:
    2
    Views:
    5,006
    Ethan V
    Jun 25, 2006
  2. ITistic
    Replies:
    2
    Views:
    440
    ITistic
    Aug 21, 2007
  3. Lloyd Sheen
    Replies:
    1
    Views:
    344
    Lloyd Sheen
    Nov 15, 2007
  4. Replies:
    0
    Views:
    503
  5. Howard Pinsley
    Replies:
    2
    Views:
    333
    Howard Pinsley
    Nov 22, 2008
Loading...

Share This Page