【问题标题】:AJAX Control Toolkit publish to Visual Studio Online failsAJAX 控件工具包发布到 Visual Studio Online 失败
【发布时间】:2014-01-14 18:40:11
【问题描述】:

到目前为止,我已经花了一个多星期的时间完成了一个项目(所以从头开始不会真的那么好),其中包括使用 .Net 4.5 的 AJAX 控制工具包。

我有 Visual Studio 2012,并通过 Nuget 安装了 AJAXControlToolkit 作为参考。然后我进行了构建,并将控件从该构建的 bin 文件夹拖放到我的工具箱中。

我的 WebConfig 也有工具包的参考:

<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
    <appSettings/>
    <system.web>
        <compilation debug="true" targetFramework="4.5">
            <assemblies>
                <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="AjaxControlToolkit"/>
            </assemblies>
        </compilation>
        <httpRuntime/>
        <pages controlRenderingCompatibilityVersion="4.0">
            <controls>
                <add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit, Version=4.5.7.1213, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" namespace="AjaxControlToolkit"/>
            </controls>
        </pages>
    </system.web>
    <system.webServer>
        <handlers>
            <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit"/>
            <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit"/>
            <remove name="ExtensionlessUrlHandler-Integrated-4.0"/>
            <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0"/>
            <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0"/>
            <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0"/>
        </handlers>
    </system.webServer>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
                <bindingRedirect oldVersion="0.0.0.0-2.1.0.4" newVersion="2.1.0.4"/>
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
</configuration>

我正在通过 TFS 构建到使用 Visual Studio Online 的在线目标,但每次构建都会导致这组错误:

17 个错误,4 个警告 $/SCEIP/SCEIP.sln - 17 个错误,4 个警告 查看日志文件

错误:

  • Application\step1.aspx.designer.cs (274):类型或命名空间名称 在全局命名空间中找不到“AjaxControlToolkit”(是 您缺少程序集参考吗?)
  • Application\eligibility.aspx.designer.cs (58):类型或命名空间 在全局命名空间中找不到名称“AjaxControlToolkit” (您是否缺少程序集参考?)
  • Application\eligibility.aspx.designer.cs (148):类型或命名空间 在全局命名空间中找不到名称“AjaxControlToolkit” (您是否缺少程序集参考?)
  • Application\eligibility.aspx.designer.cs (193):类型或命名空间 在全局命名空间中找不到名称“AjaxControlToolkit” (您是否缺少程序集参考?)
  • Application\step1.aspx.designer.cs (112):类型或命名空间名称 在全局命名空间中找不到“AjaxControlToolkit”(是 您缺少程序集参考吗?)
  • Application\step1.aspx.designer.cs (148):类型或命名空间名称 在全局命名空间中找不到“AjaxControlToolkit”(是 您缺少程序集参考吗?)
  • Application\step1.aspx.designer.cs (175):类型或命名空间名称 在全局命名空间中找不到“AjaxControlToolkit”(是 您缺少程序集参考吗?)
  • Application\step1.aspx.designer.cs (247):类型或命名空间名称 在全局命名空间中找不到“AjaxControlToolkit”(是 您缺少程序集参考吗?)
  • Application\eligibility.aspx.designer.cs (103):类型或命名空间 在全局命名空间中找不到名称“AjaxControlToolkit” (您是否缺少程序集参考?)
  • Application\step1.aspx.designer.cs (328):类型或命名空间名称 在全局命名空间中找不到“AjaxControlToolkit”(是 您缺少程序集参考吗?)
  • Application\step1.aspx.designer.cs (346):类型或命名空间名称 在全局命名空间中找不到“AjaxControlToolkit”(是 您缺少程序集参考吗?)
  • Application\step1.aspx.designer.cs (400):类型或命名空间名称 在全局命名空间中找不到“AjaxControlToolkit”(是 您缺少程序集参考吗?)
  • Application\step1.aspx.designer.cs (418):类型或命名空间名称 在全局命名空间中找不到“AjaxControlToolkit”(是 您缺少程序集参考吗?)
  • Application\step1.aspx.designer.cs (436):类型或命名空间名称 在全局命名空间中找不到“AjaxControlToolkit”(是 您缺少程序集参考吗?)
  • Application\step1.aspx.designer.cs (454):类型或命名空间名称 在全局命名空间中找不到“AjaxControlToolkit”(是 您缺少程序集参考吗?)
  • Application\step1.aspx.designer.cs (472):类型或命名空间名称 在全局命名空间中找不到“AjaxControlToolkit”(是 您缺少程序集参考吗?)
  • SCEIP.Master.designer.cs (40):类型或命名空间名称 在全局命名空间中找不到“AjaxControlToolkit”(是 您缺少程序集参考吗?)

警告:

  • C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (1605):无法解析此引用。找不到 程序集“AjaxControlToolkit”。检查以确保程序集存在 在磁盘上。如果您的代码需要此参考,您可能会得到 编译错误。
  • C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (1605):无法解析此引用。找不到 程序集“AjaxMin”。检查以确保该程序集存在于磁盘上。 如果您的代码需要此参考,您可能会得到编译 错误。
  • C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (1605):无法解析此引用。找不到 程序集“HtmlAgilityPack”。检查以确保程序集存在于 磁盘。如果您的代码需要此参考,您可能会得到 编译错误。
  • C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (1605):无法解析此引用。找不到 程序集“Newtonsoft.Json,版本=4.5.0.0,文化=中性, PublicKeyToken=30ad4fe6b2a6aeed,处理器架构=MSIL”。检查 以确保程序集存在于磁盘上。如果这个参考是 您的代码需要,您可能会遇到编译错误。

我的构建在本地(当然)工作得很好,但如果我不能发布它,那就是失败了。我在网上找遍了,但没有发现任何似乎可以提供任何帮助的东西。

【问题讨论】:

  • 经过大量搜索,一无所获,我的一个朋友引导我这样做:robertgreiner.com/2013/09/… 正是我需要的答案。我跑了这些步骤,瞧——构建成功了!
  • @Esther Fan - MSFT - 虽然我感谢 Microsoft 员工的意见,但请停止对这篇文章进行编辑。这些名称对于有问题的产品是正确的,因为那是我使用它时的产品名称。 now 这个名字不是这个问题的意思,我希望无论这个产品的最新版本是什么,这些问题仍然不存在。
  • 对任何冒犯表示歉意。仅试图帮助不知道旧名称的用户找到答案。

标签: ajax build build-process azure-devops


【解决方案1】:

使用 NuGet,您可以在构建过程中依赖包还原来确保加载您的依赖项。无需将包文件夹签入源代码管理。

正如评论中提到的,blog post 解释了针对此特定场景的修复。

NuGet 官方网站上也有解释how to configure projects with package restore and Team Build的文档

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-20
    相关资源
    最近更新 更多