CipherIS
asked on
C# .NET 2013 can't find Class
I am migrating a website (.NET 2008) to a web application (.NET 2013). I am having an issue where I have a class in the App_Code folder that used all over the place and now it can't find it. I believe it is because of the new structure folder structure.
I created the web app in .NET 2013 then copied the website to the directory in the 2013 directory and included the files per instructions I found on the web.
As an example of the current directory structure in Solution Explorer.
MyNewApp(1)
- MyNewApp
- App_Code
- AppClass.cs
Error I'm receiving now.
The type or namespace name 'AppClass' could not be found (are you missing a using directive or an assembly reference?)
ANy ideas how to resolve?
I created the web app in .NET 2013 then copied the website to the directory in the 2013 directory and included the files per instructions I found on the web.
As an example of the current directory structure in Solution Explorer.
MyNewApp(1)
- MyNewApp
- App_Code
- AppClass.cs
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Collections;
using System.Diagnostics;
using System.Data;
using System.Data.SqlClient;
namespace PremiumAdmin
{
public class AppClass : System.ComponentModel.Component
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
protected string sConnectionString;
protected short iUserID;
protected string sLastError;
using System;
using System.Data;
using System.Data.SqlClient;
using System.Web;
using System.Web.UI.WebControls;
using PremiumAdmin; //Having issues resolving here
public partial class baseFrame : System.Web.UI.MasterPage
{
protected AppClass appClass = (AppClass)HttpContext.Current.Session["appClass"]; //Having issues resolving here
public delegate void attachDocumentDelegate(int iDoc);
public attachDocumentDelegate attachDocument;
protected void Page_Load(object sender, System.EventArgs e)
{
pnlHeaderMenu.Visible = true;
}
Error I'm receiving now.
The type or namespace name 'AppClass' could not be found (are you missing a using directive or an assembly reference?)
ANy ideas how to resolve?
Not really. that is a big jump. most applications if you are using 2013 have to be upgraded to at least 4.0. Its best to create a new application and move over the files one by one. if it was 2010 to 2013 the migration would of been much easier. Sorry.
Try this PremiumAdmin.Appclass
protected AppClass appClass = (PremiumAdmin.AppClass)
protected AppClass appClass = (PremiumAdmin.AppClass)
in the project references add a reference to your class
that was to simple David Johnson. that could be the case but not most classes mostly only a dll not a class.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That was it. Setting it to Compile resolved it. Thanks.