c# - The type or namespace <blah> does not exist -


ok, have had 1 million times before , it's been answered 1 million +1 times before.

and yet, once again. have 3 projects, a, b, , c, each dll. each project .net 4.0 (not client build, full 4.0). project c references , b. referenced projects, , output set copy locally.

in c, have 2 using statements in .cs file:

using a; using b; 

when compile, complaint cannot find b. fine. b depends on a.

what heck should do? i've removed , re-added, closed vs2010, re-opened it, looked @ .csproj file. , cannot it. again, millionth time.

someone please slap enough sense me learn source of once , all!

and yes, answered somewhere in stackoverflow, not in of top answers i've checked far. terms generic of use, many questions answer "duh, add reference". i'm past point.

here errors get. there 3 kinds, past experience, last 1 true one.

error   130 'awi.wwg.expmri.mriupload.data.mriupload' not contain definition 'database' , no extension method 'database' accepting first argument of type 'awi.wwg.expmri.mriupload.data.mriupload' found (are missing using directive or assembly reference?)   error   114 'object' not contain definition <blah>  error   59  type or namespace name '<blah>' not found (are missing using directive or assembly reference?)     

aha looked @ warnings, not errors, , here see:

warning 69  referenced project '..\..\..\..\..\..\..\partners\integration\framework\connectors\partners.connectors.base\partners.connectors.base\partners.connectors.base.2010.csproj' not exist.  awi.wwg.expmri.mriupload.objects 

that .csproj file "b" in case. though remove , re-add project reference this. feels i'm getting closer!

hmm, found dll, call "d", "a" references. when add project, start complaint:

----------------  add reference dialog not shown due error:  specified path, file name, or both long.  qualified file name must less 260 characters, , directory name must less 248 characters. ---------------- 

could related, or distraction?


ok, found issue, though not understand it.

when add reference through ide, adds csproj file of "c":

<projectreference include="..\..\..\..\..\..\..\partners\integration\framework\connectors\partners.connectors.base\partners.connectors.base\partners.connectors.base.2010.csproj"> 

this not compile, warns cannot find referenced project, errors happen. change projectreference following:

<projectreference include="c:\...\partners.connectors.base.2010.csproj"> 

... , works fine. note neither of paths close 256 characters. qualified 1 135 characters. perhaps ide doing silly decoration of path.

the solution has file path limits in windows, , way ide translates relative paths full ones, explained in this blog.

the immediate solution edit csproj file manually use absolute path. until reference re-added, absolute path valid. 1 day may shorten folders, it's not top priority @ moment.

if suspect have issue, @ warning messages compiler. have these turned off myself, looking @ errors. warning "the referenced project not exist" clue solved me.

in case other link disappears, here link ms article. http://support.microsoft.com/kb/2516078

it worth noting same error manifests variety of issues such client-framework-targeting issues, , logged warning when reference fails load. presumably reference error warning because if reference not needed doesn't matter.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -