开发者

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

开发者 https://www.devze.com 2023-01-26 08:34 出处:网络
I have 2 WinForm Apps. A completed, working WinFormApp1 has a reference to CompanyName.BusinessObjects.dll.

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 开发者_如何学JAVAclear 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.


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.


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.


Is there anything in BusinessObjects that is declared as internal?

I think it might be a namespaces problem. Make sure everything is in the same Namespace then try again.


Have you tried running your IDE i guess is Visual Studio as an Administrator?

0

精彩评论

暂无评论...
验证码 换一张
取 消