1

After I build a few of my references, which are present in the project and accessible through intellisense before the build is performed.

Unfortunately none of my projects are set to target Client Profile, as answered in this thread. The type or namespace name could not be found

This seems to be the most common cause, does anyone know what else other than this can cause the same issue?


Edit: The Types that aren't found are all from the referenced DLLs. I have the correct using directives for these and they are present in the resource folder, however they become underlined red after a build (I did try cleaning to). My initial thought was the framework (the project is on v3.5), but I checked all my resources working or otherwise all where on v2 bar a few (working ones) on v4 which I removed temporarily to make sure we're causing issues.

Unable to access the project from my current location but will post any requested specifics as soon as I can.


edit: Resolved the issue by deleting all of the custom class libraries... found and rebuilt each of their projects then added the new DLLs back into the project. Stored libraries weren't very organised, so I probably have some confliction between old/new versions.

3
  • 3
    Do you have appropriate using directives as well? What types aren't found? You need to give us more information.
    – Jon Skeet
    Feb 28, 2012 at 17:35
  • Please update post with error you are getting since reasons depends on what types can't be found. Feb 28, 2012 at 17:37
  • The Types that aren't found are all from the referenced DLLs. I have the correct using directives for these and they are present in the resource folder, however they become underlined red after a build (I did try cleaning to). My initial thought was framework the project is on v3.5, but I checked all my resources working or otherwise all where on v2 bar a few (working ones) on v4 which I removed temporarily to make sure we're causing issues. Unable to access the project from my current location but will post any requested specifics as soon as I can.
    – Amicable
    Feb 28, 2012 at 19:33

5 Answers 5

1

Have you read the warning in the error list? You might need to install nuget package used by the referenced projects

for me the error warning was

All projects referencing "project file" must install nuget package Microsoft.Bcl.Build.

0

Are the projects being built correctly ? Sometimes, you need to manually generate them (right click on them, generate), before being able to run a full build.

I dont exactly know why, but this might be the way to go for you.

0

~A few simple things to try before getting into more complicated water...

Try clicking:

  1. Build->Clean Solution
  2. Build->Build Solution

If this doesn't work, check your using statements are all there and correct, check your references all still exist.

0

I had a similar issue today, and I thought I would mention it here in case it helps someone else out. In my case, I have a VB.net Class Library which is referenced by a C# class library. The solution would build fine, but in the IDE, as soon as I started editing a file in the C# project, I would get errors about not finding a reference to the VB.Net library. It turns out that the VB.Net class library had a reference to System.web (lowercase w). I'm not sure how that came about -- but the solution was to delete that reference and replace it with a reference to System.Web (uppercase W).

0

Make sure all the projects in your solution have the same "Target framework" value

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.