I want to have one project that is linked to and uses another project.
I'm using ASP.NET. I have a solution file. It has many files and projects in it.
Recently, I made a new file called Testing that has two projects: Testing.Web (WebForms) and Testing.Core (Class library). Ignore ServiceA for the moment.
I added a reference to Testing.Core in Testing.Web.
Both projects target .NET Framework 4.
Everything builds. I can locally run the code until I try to invoke a .aspx pop-up that uses Testing.Core.
I made sure that the Testing.Core.dll referenced in Testing.Web (above) is in the correct location: TestingTesting.CoreinDebugTesting.Core.dll.
The pop-up works if I remove references to the Testing.Core project. When I add it back, the Server Error message appears again.
I figured maybe there was a namespace issue, so I made the ServiceA project (first screen shot). It just has one class with a HelloWorld() method.
I added a ServiceA reference to Testing.Web. I use ServiceA.dll by instantiating its one class and invoking its one method--same Server Error.
I checked the configuration manager. It all looks good there too.
I looked at Testing.Web and Testing.Core's Properties > Build setup and made sure it was in line with what other Stack Overflow posts advised:
- Define DEBUG constant checked
- Define TRACE constant checked
- Advanced > Debug Info: full selected
Testing.Web can reference other projects in the solution file (e.g., my Utilities project, which also targets .NET Framework 4).
It just doesn't seem to like any new class library that I make and try and link Testing.Web to.
I'm using Visual Studio Professional 2015.
I'm stuck. Any help would be hugely appreciated!
question from:
https://stackoverflow.com/questions/66053574/asp-net-type-or-namespace-does-not-exist 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…