Problem Building Open-Xml-Sdk

Home Forums Open-Xml-Sdk Problem Building Open-Xml-Sdk

This topic contains 3 replies, has 2 voices, and was last updated by  jholliday 1 week, 2 days ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #3967

    DavidD
    Participant

    Following the Screen-Cast: Introduction to Open-Xml-PowerTools I got the SDK and PowerTools from Git. When I built the SDK in Visual Studio Community 2015 I got the following output:

    1>—— Build started: Project: DocumentFormat.OpenXml, Configuration: Debug Any CPU ——
    1> C:\Program Files\dotnet\dotnet.exe build “C:\Users\david\Documents\WindowsPowerShell\Modules\Open-XML-SDK\DocumentFormat.OpenXml” –configuration Debug –no-dependencies
    1>

      Project DocumentFormat.OpenXml (.NETFramework,Version=v4.5) will be compiled because expected outputs are missing

    1> Compiling DocumentFormat.OpenXml for .NETFramework,Version=v4.5
    1> Compilation succeeded.
    1> 0 Warning(s)
    1> 0 Error(s)
    1> Time elapsed 00:00:16.5789434
    1>
    2>—— Build started: Project: DocumentFormat.OpenXml.Tests, Configuration: Debug Any CPU ——
    2> C:\Program Files\dotnet\dotnet.exe build “C:\Users\david\Documents\WindowsPowerShell\Modules\Open-XML-SDK\DocumentFormat.OpenXml.Tests” –configuration Debug –no-dependencies
    2>

      Project DocumentFormat.OpenXml.Tests (.NETFramework,Version=v4.5.1) will be compiled because expected outputs are missing

    2> Compiling DocumentFormat.OpenXml.Tests for .NETFramework,Version=v4.5.1
    2> Compilation succeeded.
    2> 0 Warning(s)
    2> 0 Error(s)
    2> Time elapsed 00:00:07.6281830
    2>
    ========== Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

    I believe as a result of the underlined lines the DLL’s end up in …\bin\debug\net45. When I go to PowerShell and execute

    import-module Open-Xml-PowerTools

    the script cannot find …\bin\debug\DocumentFormat.OpenXml.dll presumably because it is in …\bin\debug\net45. In addition the script is unable to find …bin\debug\System.IO.Packaging.dll because this dll is nowhere to be found. The script is again expecting it to be in …\bin\debug but it is not there nor is it in …\bin\debug\net45.

    #4028

    DavidD
    Participant

    I have solved the build problem. There is a step missing in the Screen-Cast: Introduction to Open-Xml-PowerTools. It is actually provided in the Screen-Cast: Open Xml Sdk Version 2.6 at
    https://www.youtube.com/watch?v=B13IYHKhcc8

    The secret is, after doing

    $ git clone https://github.com/OfficeDev/Open-XML-SDK

    you should execute

    $ cd Open-XML-SDK
    $ git checkout master
    $ cd ..

    This adds the missing projects (especially the crucial System.IO.Packaging) which makes everything else work.

    #4063

    jholliday
    Participant

    This didn’t work for me. After doing the git checkout master, I’m getting this on DocumentFormat.OpenXml

    Your project.json doesn’t list ‘win’ as a targeted runtime. You should add ‘”win”: { }’ inside your “runtimes” section in your project.json, and then re-run NuGet restore.

    ANd this on DocumentFormat.OpenXml.Tests:

    Your project is not referencing the “.NETFramework,Version=v4.5” framework. Add a reference to “.NETFramework,Version=v4.5” in the “frameworks” section of your project.json, and then re-run NuGet restore.

    • This reply was modified 1 week, 2 days ago by  jholliday.
    #4065

    jholliday
    Participant

    I finally got this to work by starting over with a fresh clone of the SDK. Everything is working as it should now.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.