1

I have a web ASP.NET project with the bellow structure:

enter image description here

I copied this solution to my test computer and now I get

The type or namespace name 'BussinessLib' could not be found 

HousingSurvey is the startup project .

Each project get built successfuly but when I try to build the solution I get The type or namespace name 'BussinessLib' could not be found

As you see BussinessLib is a reference for Housingsurvey. The using BussinessLib statement is set correctly in the HousingSurvey .

So I rebuild BussinessLib and add the reference to Housingsurvey. Housing Survey as a project builds successfully. but again when I build the solution I get The type or namespace name 'BussinessLib' could not be found

To make things stranger when I check C:\CSharpTest\HousingSurvey\HousingSurvey\BussinessLib\bin\Debug

BussinessLib.dll is deleted somehow(After I build the solution). I double checked BussinessLib.dll and saw it does get created there whenever I build the BussinessLib project.

I found the most promising answer here: The type or namespace name could not be found

But above answer did not help me since all of 3 projects in my solution are targeted to the .NET Framework 4.5

Any feedback is greatly appreciated.


Update: please note that this whole solution builds "Successfully" in my UAT computer. Then I copy paste it to the test computer and it fails on build. For some weird reason, whenever I build the whole solution, Business.dll gets deleted from the bin folder! and that's why code that references it can not find it.

Community
  • 1
  • 1
S Nash
  • 2,363
  • 3
  • 34
  • 64
  • 1
    did you delete the reference and readd it? – Yatrix Apr 07 '15 at 02:35
  • 2
    Do you see that little warning sign in the references of the `HousingSurvey` project? It is trying to tell you something. Remove this reference, and then add it back. If that does not resolve your problem, check for any post-build steps that move/copy the built assemblies. – Alex Apr 07 '15 at 02:35
  • Make sure everything is targeting the same .NET framework version -- including not targeting "client profile". Also, you spelled *business* wrong. – Daniel Mann Apr 07 '15 at 02:58
  • All tageted to 4.5. As far asI know There is no client profile for .net 4.5 – S Nash Apr 07 '15 at 10:06
  • **TYPO** alert - it should be **business** - not "bussiness" - it has one + two "s" - not two+two .... – marc_s May 10 '19 at 07:30

1 Answers1

2

From the HousingSurvey Project, delete the reference to BusinessLib and re-add it again. It is probably an issue with a file path for the original reference.

Also when you add the reference to the project again, be sure to set the 'Copy Local' property to True

  1. In Solution Explorer, click the Show All Files button to display the References node.
  2. Open the References node for the project.
  3. Right-click a reference in the References list, and click Properties. The properties associated with that reference appear in a list in the Properties window.
  4. Select Copy Local from the left-hand column, and then click the arrow in the right-hand column to change the value to True or False.
Aaron Glover
  • 1,199
  • 2
  • 13
  • 30