Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2012 Register Tag Prefix "Could not complete the action."

I have the following line of code:

<%@ Register %>

When I attempt to add this line of code Visual Studio informs me of this non-informative message:

"Could not complete the action."

Alert box with error

I remove even one character from the Register statement and it gives me that message. I type "<%@ Register %>" and it gives the message.

I am attempting to add this line in full:

<%@ Register TagPrefix="sc" Namespace="Sitecore.Web.UI.WebControls" Assembly="Sitecore.Kernel" %>

Some additional information:

  1. I am using Microsoft Visual Studio 2012.
  2. The Sitecore.Kernel has been added to the references in the application.
  3. The Kernel itself is included in the application and is set to copy local.
  4. The application builds correctly with this line of code applied and is correctly rendered by Sitecore to the page.
  5. The Sitecore.Kernel is usable in the C# code behind.
  6. Update: 11/26 4:28 PM This issue is now effecting all users of the TFS Solution.
  7. Update: 12/2 9:38 AM We created a new solution and very slowly ported our code to it. Still looking for an answer to this question in case it happens again. This seems to be more of a Visual Studio question than a Sitecore one.
  8. Update: 12/13 4:31 PM Fully ported to a new solution. So I assume a new solution is the fix to this issue.
  9. Update: 1/14/2014: Still no answer. Bummer
  10. Update: 3/21/2014: I added the Tag for Knockout.js because I think the addtion of the data-bind to the ASP markup has caused this issue. It causes intellisense to go bonkers and error out. User @Jeroen is also having this issue in Visual Studio.

Here's the relevant code:

<controls>
    <add tagPrefix="sc" namespace="Sitecore.Web.UI.WebControls" assembly="Sitecore.Kernel" />
    <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add tagPrefix="sc" namespace="Sitecore.Web.UI.WebControls" assembly="Sitecore.Analytics" />
</controls>
like image 648
Andrew Quaschnick Avatar asked Nov 26 '13 21:11

Andrew Quaschnick


1 Answers

You could add the prefix to the config file, to make it available to other pages in the project.

<configuration>

  <system.web>

    <pages>
      <controls>
        <add tagPrefix="sc" src="~/locationofcontrol" tagName="sitecore"/>
      </controls>
    </pages>

  </system.web>

</configuration>

Take a look here for a thorough explanation.

like image 158
Christian Phillips Avatar answered Nov 15 '22 16:11

Christian Phillips