多设备混合应用程序+ webessentials:捆​​绑两个css文件会出错

时间:2014-08-16 21:11:30

标签: visual-studio-2013 web-essentials visual-studio-cordova

我使用带有webessentials的多设备混合应用程序CTP 2并尝试两个捆绑两个css文件。它给出了以下错误:

16-8-2014 22:58:19: System.NullReferenceException: Object reference not set to an instance of an object.
   at MadsKristensen.EditorExtensions.FileHelpers.RelativePath(String absolutePath, String relativeTo)
   at MadsKristensen.EditorExtensions.BundleDocument.GetRelativePath(String file, String root)
   at MadsKristensen.EditorExtensions.BundleDocument.<>c__DisplayClass5.<WriteBundleRecipe>b__2(String file)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Xml.Linq.XContainer.AddContentSkipNotify(Object content)
   at System.Xml.Linq.XElement..ctor(XName name, Object content)
   at MadsKristensen.EditorExtensions.BundleDocument.<WriteBundleRecipe>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at MadsKristensen.EditorExtensions.BundleFilesMenu.<MakeBundleAsync>d__27.MoveNext()

创建了文件 Mybundle.css.bundle 但是:

  1. 是空的
  2. 未包含在项目中
  3. 我在项目中加入了 Mybundle.css.bundle ,并添加了所需的配置如下:

    <?xml version="1.0" encoding="utf-8"?>
    <bundle xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://vswebessentials.com/schemas/v1/bundle.xsd">
      <settings>
        <!--Determines if the bundle file should be automatically optimized after creation/update.-->
        <minify>true</minify>
        <!--Determin whether to generate/re-generate this bundle on building the solution.-->
        <runOnBuild>true</runOnBuild>
        <!--Use absolute path in the generated CSS files. By default, the URLs are relative to generated bundled CSS file.-->
        <adjustRelativePaths>true</adjustRelativePaths>
        <!--Specifies a custom subfolder to save files to. By default, compiled output will be placed in the same folder and nested under the original file.-->
        <outputDirectory />
      </settings>
      <!--The order of the <file> elements determines the order of the files in the bundle.-->
      <files>
        <file>/css/index.css</file>
        <file>/css/stylesheet.css</file>
      </files>
    </bundle>
    

    编译或保存其中一个css文件不会触发捆绑。

    多设备混合应用CTP 2 WebEssentials 一起工作?

3 个答案:

答案 0 :(得分:0)

您应该在https://github.com/madskristensen/WebEssentials2013

向Mads Kristensen报告这些错误

答案 1 :(得分:0)

打开https://github.com/madskristensen/WebEssentials2013/issues/1429,因为在使用适用于Visual Studio CTP2.0的多设备混合应用程序上使用Web Essentials 2013捆绑css时也遇到类似错误

答案 2 :(得分:0)

请参阅此问题的答案:Why is Visual Studio 2013 crashing when I try to create/open a Multi-Device Hybrid Apps application?

将多设备混合应用程序CTP2和WebEssentials一起安装时会出现问题。您需要禁用WebEssentials或切换到WebEssentials的每晚构建。