This is driving me nuts. In the Visual Web Developer 2010 Express development environment, I occasionally get this error under one or many tags for a number of my custom controls. It is ONLY a dev env problem, as the site will run just fine. I've googled
and tried many different suggestions. Some conbimation will usually fix the problem after awhile, but I haven't figured out the right steps or the right order yet. I've even seen the problem go away on its own at times.
Among the things I've tried, both alone and in combination: deleting caches in 4 different location (Temporary ASP.NET Files; ReflectedSchemas; WebsiteCache; and VWDWebCache) after I've exited VWD; restarting Windows; re-saving Web.Config; making a minor
edit and then undoing it and saving the control in question; putting a space in the tag name, waiting a few seconds for Intellisense to generate a different error, removing the space, and hoping that the error goes away; and there might be other things I've
tried, too (the list of tricks I've found on google is is so long, I might've forgotten a few).
The point I'd like to reinforce is that there really is no compilation error in the web site, nor is the web.config file missing. This is simply a spurious error that crops up to annoy me, occupy a few minutes to a few hours of my time, and distract me
from getting actual work on the site done.
The application in question is a Web Site project, NOT a Web Application, in case that makes a difference (and no, I have no plans or desires to convert it).
Has anyone else encountered this (what is obviously a) BUG, and successfully resolved the issue? (In case anyone from Microsoft is reading this post, I would especially like to hear from you.)
Oh, I should also mention that this will sometimes progress to other spurious error messages, too, and the same steps may or may not make those go away.
Here's another one of the error messages (just received, but site still runs fine):
Reference required to assembly 'App_Code.7e2wcf6x, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' containing the type 'Common'. Add one to your project.
('Common' is one of the classes that I have in the App_Code folder.)
All my custom controls are in a folder structure like this:
(root)/Controls/NameOfControl
for example: ~/Controls/ItemContainer (which contains the ItemContainer.ascx file and the code file to go along with it)
this full resolve-to-root path is how they appear in web.config, too
Again, I have to stress that the site works just fine (from the server). IIS is able to find and resolve all these controls without error. This is a development environment (my own PC) issue ONLY.
You only receive the error if you have all the following things:
A Class Library project in Visual Basic .NET.
A Class Library project in Visual C# .NET that refers to the Visual Basic .NET Class Library project.
A method in Visual C# .NET that returns an instance of a Visual Basic .NET class.
The article at that link says that it refers to a Windows Application project. Mine is a Web Site project. Furthermore, I don't think that VWD is even capable of producing Class Library projects, and I'm also certainly not mixing VB and VC#. Thanks for
the tip, but I'm still looking for a solution.
joel6653_2
0 Points
5 Posts
Element 'yournamehere' is not a known element. This can occur if there is a compilation error in ...
Apr 04, 2012 06:06 PM|LINK
This is driving me nuts. In the Visual Web Developer 2010 Express development environment, I occasionally get this error under one or many tags for a number of my custom controls. It is ONLY a dev env problem, as the site will run just fine. I've googled and tried many different suggestions. Some conbimation will usually fix the problem after awhile, but I haven't figured out the right steps or the right order yet. I've even seen the problem go away on its own at times.
Among the things I've tried, both alone and in combination: deleting caches in 4 different location (Temporary ASP.NET Files; ReflectedSchemas; WebsiteCache; and VWDWebCache) after I've exited VWD; restarting Windows; re-saving Web.Config; making a minor edit and then undoing it and saving the control in question; putting a space in the tag name, waiting a few seconds for Intellisense to generate a different error, removing the space, and hoping that the error goes away; and there might be other things I've tried, too (the list of tricks I've found on google is is so long, I might've forgotten a few).
The point I'd like to reinforce is that there really is no compilation error in the web site, nor is the web.config file missing. This is simply a spurious error that crops up to annoy me, occupy a few minutes to a few hours of my time, and distract me from getting actual work on the site done.
The application in question is a Web Site project, NOT a Web Application, in case that makes a difference (and no, I have no plans or desires to convert it).
Has anyone else encountered this (what is obviously a) BUG, and successfully resolved the issue? (In case anyone from Microsoft is reading this post, I would especially like to hear from you.)
Oh, I should also mention that this will sometimes progress to other spurious error messages, too, and the same steps may or may not make those go away.
robwscott
Star
8079 Points
1491 Posts
Re: Element 'yournamehere' is not a known element. This can occur if there is a compilation error...
Apr 04, 2012 06:08 PM|LINK
are these custom (user) controls?
put in your web.config
http://weblogs.asp.net/scottgu/archive/2006/11/26/tip-trick-how-to-register-user-controls-and-custom-controls-in-web-config.aspx
Mark Answered if it helps - Good luck!
Cheers!
Design And Align
- Rob
joel6653_2
0 Points
5 Posts
Re: Element 'yournamehere' is not a known element. This can occur if there is a compilation error...
Apr 04, 2012 06:12 PM|LINK
Yes, custom controls (as stated in OP). Already have them registered the way you suggest.
joel6653_2
0 Points
5 Posts
Re: Element 'yournamehere' is not a known element. This can occur if there is a compilation error...
Apr 04, 2012 07:06 PM|LINK
Here's another one of the error messages (just received, but site still runs fine):
Reference required to assembly 'App_Code.7e2wcf6x, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' containing the type 'Common'. Add one to your project.
('Common' is one of the classes that I have in the App_Code folder.)
robwscott
Star
8079 Points
1491 Posts
Re: Element 'yournamehere' is not a known element. This can occur if there is a compilation error...
Apr 04, 2012 07:49 PM|LINK
try making another folder, and putting your classes in there, then reference the folder in your page(s) that you need.
Mark Answered if it helps - Good luck!
Cheers!
Design And Align
- Rob
joel6653_2
0 Points
5 Posts
Re: Element 'yournamehere' is not a known element. This can occur if there is a compilation error...
Apr 04, 2012 07:58 PM|LINK
All my custom controls are in a folder structure like this:
(root)/Controls/NameOfControl
for example: ~/Controls/ItemContainer (which contains the ItemContainer.ascx file and the code file to go along with it)
this full resolve-to-root path is how they appear in web.config, too
Again, I have to stress that the site works just fine (from the server). IIS is able to find and resolve all these controls without error. This is a development environment (my own PC) issue ONLY.
Dino He - MS...
Star
8068 Points
1023 Posts
Microsoft
Re: Element 'yournamehere' is not a known element. This can occur if there is a compilation error...
Apr 06, 2012 01:46 AM|LINK
Hi
You only receive the error if you have all the following things:
A Class Library project in Visual Basic .NET.
A Class Library project in Visual C# .NET that refers to the Visual Basic .NET Class Library project.
A method in Visual C# .NET that returns an instance of a Visual Basic .NET class.
Please refer to MS support:
BUG: You receive a "Reference required to assembly" error message when you run a Visual Basic .NET application
Hope it helpful.
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework
joel6653_2
0 Points
5 Posts
Re: Element 'yournamehere' is not a known element. This can occur if there is a compilation error...
Apr 06, 2012 02:17 PM|LINK
The article at that link says that it refers to a Windows Application project. Mine is a Web Site project. Furthermore, I don't think that VWD is even capable of producing Class Library projects, and I'm also certainly not mixing VB and VC#. Thanks for the tip, but I'm still looking for a solution.