简体   繁体   中英

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."

警告框有错误

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>

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.

can you delete or rename the suo file of your solution ? Before deleted please make a backup of your file.

The solution user options (.suo) file is a structured storage, or compound, file stored in a binary format. You save user information into streams with the name of the stream being the key that will be used to identify the information in the .suo file. The solution user options file is used to store user preference settings, and is created automatically when Visual Studio saves a solution.

I know this is a bit old, but here it is.

I was having the same exact issue, and was able to resolve it on my machine. What I had was a solution with multiple projects, and I was having this issue on of the projects. After long research, deleting .suo file, resetting VS settings...etc nothing worked. The message “Could not complete the action.” was still coming up. I then thought of checking another project in the same solution, and the other project did not give me the message.

What I ended doing to fix this is:

  • Close Visual Studio
  • Deleting the projectName.csproj.user file from the project folder
  • Open the solution... BAM the message is gone.

Hopefully this helps you solve your problem. Best of luck

This might be a couple of years too late, but I faced a similar issue. My issue was caused because I changed my build directories; instead of the default \\bin directory, I changed my build directory to some other directory. When I changed the build directories to the original directory (\\bin for web applications and \\bin\\Release or \\bin\\Debug for class libraries), this error disappeared.

In order to change your build directories, right click on each project, click Properties and then click on the build tab in the properties window. Here, change the "Output path" to the correct directory listed above.

This was happening to me as well. I use the Telerik asp controls and updated to the recent control-set. Well when ever I click on a file from the solution explorer to view in the designer, that irritating dialog window just spammed the hell out of me.

I opened other web projects that do not use the Telerik controls and the pages worked fine in designer mode.

So on my Telerik-controlled project I uninstalled the recent update and reverted back to the older set and it's back to normal. No more pop-ups.

I don't know what configuration changes need to be made to use the new Telerik control set so I'll just stick to the older set for now.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM