Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

not declared. It may be inaccessible due to its protection level

I have 2 WinForm Apps.

A completed, working WinFormApp1 has a reference to CompanyName.BusinessObjects.dll.

A fresh WinForm app with nothinhg in it has a reference to BusinessObjects.dll. when I type "Import CompanyName.BusinessObjects" intellisense recognized it and shows available methods when I reference contained objects.

However,. when I compile it, I get the error "not declared. It may be inaccessible due to its protection level." and it seems to no longer recognize the BusinessObjects project.

I swear this is a bug. This happened once before and I think I was able to clear it by bouncing VS2010, cleaning and recompiling all.

Now, nothing helps.

I'm desperate and ticked off because I think its a bug and I don't know how to resolve it.

Here people talk of the same issue and resolution that previously worked but it isn;t working for me anymore.

like image 733
VJK Avatar asked Nov 19 '10 02:11

VJK


2 Answers

Answer: Look to the Output window for clues.

BusinessObjects.dll" could not be resolved because it has a dependency on "System.Web, Version=4.0.0.0, Culture=neutral

My client app was compiled against the CLIENT framework instead of the full blown one. The solution is to compile against the full, or preferably remove the Web dependency from BO, which is a pain now after the fact.

like image 135
VJK Avatar answered Nov 15 '22 07:11

VJK


This happened to me and I found out that all it was that my .designer file had a Namespace included in the top. Deleting this fixed the projection issues.

like image 41
Off The Gold Avatar answered Nov 15 '22 06:11

Off The Gold