简体   繁体   中英

The type or namespace name does not exist in the namespace ''are you missing an assembly reference ?"

I have a solution that worked fine until the last couple of days which contains around 15 projects that are DLLs or Webforms applications. I also use ReSharper which is another peculiarity related to this solution.

There are naturally projects referencing other ones within the solution and all but one compile independently and run OK except one Webforms app (A) that refers to namespaces within another Webforms app(B) DLL.

(A) has 7 exceptions when I try to debug this all along the lines of "the type or namespace name [MyClass] does not exist in the namespace '[(B) namespace]' (are you missing an assembly reference?)"

All the projects target the same .net version 3.5 all target the same processor CPU architecture, I have cleaned the solution, recreated the reference to (B) from (A), can see the namespace in the object explorer when looking at it from (A)\\bin so it's there... but still (A) at build has these errors above and for over a day now I cannot for the life of me work out why... can anyone help?

If I run the Webform app (B), it builds and runs without a problem...

The mention of ReSharper is due to it also not working with this solution anymore (but does work with others solutions), the behaviour of ReSharper with this solution is that I cannot type characters into VS anymore unless ReSharper is suspended. Also when searching for types the list does not filter down at all - so there is some sort of corruption there although I have cleared caches related to ReSharper.

问题可能是您在IIS中的虚拟目录,它没有指向正确的文件夹,因此该页面找不到DLL。

Brad McA, have you unblocked that namespace? In REFERENCES folder, right click on the particular reference, and see if there is an option "Unblock", If u can see it, kindly unblock it. Thanx

Seems to be building now, reason for failure was a dependency on Newtonsoft.Json.dll which was built to target .net 4 (strange as this reference in (B) has been there for ages! why it would suddenly cause build issues).

Thanks to those who posted, have a lovely day.

the dll reference were origionally built in framework 4.7.1. when trying to add the reference in lower framework project say 4.5.2. It gives such errors. try to update your project framework from 4.5 (lower version) to the version of your reference.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

Related Question The type or namespace name does not exist in the namespace (are you missing an assembly reference?) The type or namespace name does not exist in the namespace (are you missing an assembly reference?) - Can't reference a class CS0234: The type or namespace name '<namespace2>' does not exist in the namespace '<namespace1>.' (are you missing an assembly reference?) error CS0234: The type or namespace name 'Azure' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) Kentico The type or namespace name 'Smo' does not exist in the namespace 'Microsoft.SqlServer' (are you missing an assembly reference?) the type or namespace name 'Management' does not exist in the namespace 'MicrosoftSqlServer' are you missing an assembly reference CS0234 C# The type or namespace name 'Slydeextender' does not exist in the namespace (are you missing an assembly reference?) The type or namespace name 'TaskStackBuilder' does not exist in the namespace 'Android.Support.V4.App' (are you missing an assembly reference?) The type or namespace name 'Mvc' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM