0

I have a VS 2017 Web Application project.

When the project is copied to my local C drive and I debug it using IIS Express, it runs fine and everything is all well. When I publish the site, it also works fine.

However when I copy the project to a shared drive on the network, it fails to debug with an error in the webconfig which references my AccountProfile class which I have used to replace the Profile as it isn't available in Web Application projects.

<profile inherits="AccountProfile">
   <providers>
      <clear />
      <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="LocalSqlServer" />
   </providers>
</profile>

Here is my AccountProfile class in the AppCode folder

using System;
using System.Web;
using System.Web.Profile;

public class AccountProfile : ProfileBase
{
    static public AccountProfile CurrentUser
    {
        get
        {
            return (AccountProfile)Create(HttpContext.Current.User.Identity.Name);
        }
    }

    [SettingsAllowAnonymous(false)]
    public string MyStaffCode
    {
        get { return (string)base["MyStaffCode"]; }
        set { base["MyStaffCode"] = value; Save(); }
    }
    
}

The error I get is: Compiler Error Message: CS0246: The type or namespace name 'AccountProfile' could not be found (are you missing a using directive or an assembly reference?)

Any ideas?

user1431743
  • 87
  • 1
  • 12

0 Answers0