【问题标题】:Visual Studio 2012 Hot towel template not working correctlyVisual Studio 2012 热毛巾模板无法正常工作
【发布时间】:2023-03-31 05:57:01
【问题描述】:

我关注this tutorial 开始使用热毛巾,我已经安装了 ASP.NET Web Tools 2012.2 更新,并且还下载并安装了 VSIX Hot towel 模板,但是当我尝试使用此模板创建新项目时,它无法正常工作。如果我在 Visual Studio 2012 中打开一个新项目并选择 ASP.NET MVC 4 Web 应用程序,我会看到 HotTowel Single Page Application 模板在那里列出,但我选择创建的项目缺少很多文件。

我希望在我的 Scripts 文件夹中看到的内容如下:

但是我的项目看起来是这样的:

创建的项目也没有编译,它会抛出以下异常:

Error 1 The name 'BundleConfig' does not exist in the current context

这里抛出了这个异常:

public class MvcApplication : System.Web.HttpApplication
{
    protected void Application_Start()
    {
        FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
        RouteConfig.RegisterRoutes(RouteTable.Routes);
        BundleConfig.RegisterBundles(BundleTable.Bundles);
    }
}

有谁知道为什么 Hot towel 模板在 Visual Studio 2012 中不能正常工作,我可以做些什么来让它工作?

更新:

我尝试使用 Nuget 而不是模板安装 Hot Towel,但也无法正常工作。 Install-Package 安装到了 Q 然后给出了异常。这是 Nuget 输出:

PM> Install-Package HotTowel
Attempting to resolve dependency 'Breeze.WebApi (≥ 1.4.1)'.
Attempting to resolve dependency 'Breeze.Client (≥ 1.4.2)'.
Attempting to resolve dependency 'Q'.
Install-Package : External packages cannot depend on packages that target projects.
At line:1 char:1
+ Install-Package HotTowel
+ ~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException

【问题讨论】:

    标签: asp.net-mvc-4 visual-studio-2012 single-page-application hottowel


    【解决方案1】:

    我通过更新 NuGet 包管理器解决了这个问题。我从这里更新了它:

    http://docs.nuget.org/docs/start-here/installing-nuget
    

    【讨论】:

    • 太奇怪了,但这也为我解决了。我正在运行 VS 2012
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-20
    • 2013-03-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多