Last post May 12, 2015 06:58 PM by Paul Linton
May 11, 2015 06:23 AM|billcrawley|LINK
In an interface that I have declared I want to pass a 'Caching' object. So I make a reference to System.Web.Caching but in the IDE it red lines. When I right click on it, it states that Type Name was expected but namespacename found.
In my references I have a reference to System.Web (only 1), but when I right click to take me to this library in the object browser It goes to System.Web[220.127.116.11], but there is also a System.Web[18.104.22.168], So I'm guessing in my code it doesn't know which
version to use.
May 11, 2015 06:44 AM|Rajneesh Verma|LINK
Try to Clean the solution and rebuild again,
Also you can delete Temporay ASP.NET Files from below location
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files
Check you System.Web dll reference, it should be as below
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Web.dll
May 11, 2015 11:36 AM|gerrylowry|LINK
FWIW, it would be much more helpful to your peers here at forums.asp.net if you were also to show us the relevant code snippets from your application as well as the corresponding error and warning messages.
"Type Name was expected but namespacename found" suggests a coding error on your part.
for hints, search msdn c# Type Name was expected but namespacename found
May 11, 2015 06:39 PM|Paul Linton|LINK
So I'm guessing
Don't guess, read the error message. "Type name was expected but namespace found"
System.Web.Caching is a namespace and a parameter to a method needs to have a specified type. So the error makes sense.
Which type within that namespace do you wish to have passed as a parameter? All the types declared in that namespace are listed at
May 12, 2015 04:48 AM|billcrawley|LINK
Basically I have been given an old piece of code and I have been tasked with rewriting it in a more OO way. One of the functions has the following signature:
public string post(NameValueCollection settings, NameValueCollection dataBinding, bool isExtranet, Caching cache, out string errorText)
As you can see a Caching object is being passed, and the only reference to this is the System.Web. I thought that it might be an internal object to the existing code and that it was just badly named, but I have not been able to find one.
May 12, 2015 09:31 AM|gerrylowry|LINK
Bill, it appears that you are showing us your legacy code.
However, i'm guessing that the legacy code compiles clean.
you need to show us your new code snippets and the corresponding error/warning message(s).
May 12, 2015 06:58 PM|Paul Linton|LINK
Right-click on the type name 'Caching' and choose 'Go To Definition' (alternatively press F12). That will take you to where this Caching type is defined.