Home Dashboard Directory Help
Search

Problems with IntelliSense when mixing usercontrols and controls in the same tagPrefix by GertjanVH


Status: 

Closed
 as Fixed Help for as Fixed


18
0
Sign in
to vote
Type: Bug
ID: 758383
Opened: 8/16/2012 12:55:12 PM
Access Restriction: Public
2
Workaround(s)
view
12
User(s) can reproduce this bug

Description

There seems to be an error in the intellisense engine for controls in webprojects included through the web.config. When in the same assembly/namespace controls and usercontrols are mixed and using the same tagprefix the intellisense seems to stop functioning for the specified tagprefix and controls within the prefix.


<controls>
<add assembly="ErrorExampleMixedControls" tagPrefix="MC" namespace="ErrorExampleMixedControls.Controls"/>
<add src="~/Controls/TestUserControl.ascx" tagPrefix="MC" tagName="TestUserControl" />
</controls>

1) The above construction will cause the intellisense to stop working for the specified tagprefix and cause warnings about invalid tagprefixes (however the code will work as expected).

2) When disabling the line for the .ascx the intellisense is working again (suggesting controls AND webusercontrols). However this will cause errors when running, if these controls are not included through the add with the ascx reference null pointers will be encountered when accessing controls within the element.

3) When disabling the assembly line only the ascx control is suggested by intellisense (which is right since the assembly is not included anymore).

These types of projects were working without problems in VS2010 (and still are). Due to the problems with intellisense the VS2012 software is unfortunately not usable in various webprojects of me and my customers.

The problems only appear in the IDE. When compiling and running the scenario with both add statements in the web.config the application is working as expected.
I have attached a test project to reproduce the problems above. This is tested in the RTM version of VS 2012.
Details
Sign in to post a comment.
Posted by Microsoft on 10/19/2012 at 10:48 AM
Thanks for reporting the issue. The fix will be available in the next Visual Studio 2012 update.
Posted by Microsoft on 9/21/2012 at 6:24 PM
Hi, thanks for reporting the issue. We are able to reproduce the issue internally and currently investigating a fix. Will report back as soon as we find any workaround or if the fix is availabe via VS updates. Thanks!
Posted by M_Brooks on 9/18/2012 at 8:12 AM
I have posted a workaround but it seems this only partially solves the problem. The custom server controls registered will now work fine with intellisense but the user controls will not, at least not all of them.
Posted by doyle_am on 9/12/2012 at 4:43 AM
Hello,

Are there any fixes or workarounds for this issue? Or an expected time frame for a fix to be made available?

We would love to start using all of the new features and functionality of .NET 4.5 and Visual Studio 2012 but just one of our projects is littered with warnings because we reference controls in both assemblies and user controls.

Thanks,

Andy
Posted by doyle_am on 8/24/2012 at 5:24 AM
I too am finding when web.config contains controls from assemblies and user controls, IntelliSense does not work.

The project works okay in VS2010, but displays this problem in VS2012, making upgrading to VS2012 an issue for now.
Posted by Microsoft on 8/16/2012 at 10:23 PM
Thank you for submitting feedback on Visual Studio 11 and .NET Framework. Your issue has been routed to the appropriate VS development team for review. We will contact you if we require any additional information.
Posted by Microsoft on 8/16/2012 at 1:51 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.
Posted by M_Brooks on 9/18/2012 at 9:19 AM
My previous workaround only half solves the problem. The best workaround is to ensure your user controls exist in a different namespace than that used by any <add assembly="" namespace=""> registrations.

Once this is done you can revert to a single tag prefix as supported by VS2010.
Posted by M_Brooks on 9/18/2012 at 7:19 AM
In the <controls> section of the web.config file, ensure all user controls are registered with one tag prefix and all custom server controls registered with another tag prefix.

Put another way, ensure the tag prefix is different between <control> registrations registered using <add assembly="" namespace=""> and <add src="" tagName="">.

For example:

<add tagPrefix="csc" assembly="" namespace="">
<add tagPrefix="uc" src="" tagName="">.
File Name Submitted By Submitted On File Size  
ErrorExampleMixedControls_VS2012.zip 8/16/2012 19 KB