Just bumping this, no solution as yet...
I have a CRUD web app built in C# that updates a SQL Db. When I test it on my local machine it works fine, but when I upload to our intranet server it breaks, throwing up the error:
CS0246: The type or namespace name 'userName' could not be found (are you missing a using directive or an assembly reference?)
I have the namespace referenced in my backend file:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using userName;
using System.Data;
This is how I'm calling it:
//get user name from uName.cs
uName obj = new uName();
string var = obj.ShowName();
uName.cs code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.DirectoryServices;
using System.Web.Hosting;
/// <summary>
/// Summary description for uName
/// </summary>
namespace userName
{
public class uName
{
public uName()
{
} //constructor end
public string ShowName()
{
.......
}
There are a number of methods following the constructor...
The userName namespace is held in the uName.cs file which is inside the App_Code folder.
I know this is a pretty common problem and I've done extensive research before posting the question...
I've tried the lots of solutions from SO but they don't fix the problem including: