gpt4 book ai didi

c# - Visual Studio 2012 注册标记前缀 "Could not complete the action."

转载 作者:太空狗 更新时间:2023-10-29 17:55:03 25 4
gpt4 key购买 nike

我有以下代码行:

<%@ Register %>

当我尝试添加这行代码时,Visual Studio 会通知我这条非信息性消息:

"Could not complete the action."

Alert box with error

我从 Register 语句中删除了一个字符,它给了我那条消息。我输入“<%@ Register %>”,它给出了消息。

我正在尝试完整添加这一行:

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

一些附加信息:

  1. 我正在使用 Microsoft Visual Studio 2012。
  2. Sitecore.Kernel 已添加到应用程序的引用中。
  3. 内核本身包含在应用程序中并设置为复制本地。
  4. 应用程序使用这行代码正确构建,并由 Sitecore 正确呈现到页面。
  5. Sitecore.Kernel 可在后面的 C# 代码中使用。
  6. 更新:11 月 26 日下午 4:28 此问题现在影响 TFS 解决方案的所有用户。
  7. 更新:12 月 2 日上午 9:38 我们创建了一个新的解决方案,并非常缓慢地将我们的代码移植到它。仍在寻找这个问题的答案,以防再次发生。这似乎更像是一个 Visual Studio 问题,而不是 Sitecore 问题。
  8. 更新:12 月 13 日下午 4:31 完全移植到新的解决方案。所以我假设一个新的解决方案可以解决这个问题。
  9. 更新:2014 年 1 月 14 日:仍然没有答案。无赖
  10. 更新:2014 年 3 月 21 日:我为 Knockout.js 添加了标签,因为我认为向 ASP 标记添加数据绑定(bind)导致了这个问题。它会导致智能感知变得疯狂并出错。用户@Jeroen 在 Visual Studio 中也遇到了这个问题。

相关代码如下:

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

最佳答案

您可以将前缀添加到配置文件,以使其可用于项目中的其他页面。

<configuration>

<system.web>

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

</system.web>

</configuration>

拍一个look here以获得详尽的解释。

关于c# - Visual Studio 2012 注册标记前缀 "Could not complete the action.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20228196/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com