I created an ASP.NET Web App project and it builds and works correctly now. However, I am trying to add this project to my website. So what I've done is I create a new Web Site from VS and then I added all of the .CS files from my Web App project to this Web Site.
Even though the Web App project builds successfully, when I use this same code in my Web Site and I build it, I get the error:
The type or namespacae name 'ADONET_namespace' could not be found (are you missing a user directive or an assembly reference?)
Here is the top part of my master.cs file:
using System;
using System.Collections.Generic;
using System.Collections;
namespace AddFileToSQL
{
public partial class _Default : System.Web.UI.Page
{
And the top of my ADONET_methods.cs file:
using System;
using System.Collections;
using System.Data;
namespace ADONET_namespace
{
public class ADONET_methods : System.Web.UI.WebControls
{
Finally the top of my child class:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using ADONET_namespace;
namespace AddFileToSQL
{
public partial class DataMatch : _Default
{
In this child class file, there is a squiggly line under ADONET_namespace and hovering over it returns the error specified above. I have this ADONET_methods.cs file stored in same file structure format on this Web Site as I do on my Web App project. So if it builds successfully in that project, why not in this Web Site?
I have searched Stack Overflow for similar questions and I found one question which was asking the same thing as me, but I tried all of the solutions listed there. I also googled this problem and tried all of the suggestions, but none of them worked either. And I have added this ADONET_methods.cs file to different locations within this Web Site to test out if it was being found or not, like under App_Data folder, References folder, and also in the same level as the other .CS files (like it is in the Web App project).
What else can I try? This code is written in C# by the way in VS 2008, running on an XP Pro with IIS6 Manager.