How to get more logs for "Exception has been thrown by the target of an invocation" errors

Matthieu Maitre's Avatar

Matthieu Maitre

19 Dec, 2014 03:26 PM

Hi,

my builds keep on failing with "Exception has been thrown by the target of an invocation". The logs do not show which command line is being run or the exception type/callstack. Is it possible to get more verbose logs to figure out what is wrong with my project?

1Build started
2git clone -q --branch=master git://github.com/mmaitre314/TestWicD2dWarp.git C:\projects\testwicd2dwarp
3git checkout -qf 4a72d1b4e36e173f7758041c4bf8ac42ba000ef2
4echo before build
5before build
6Exception has been thrown by the target of an invocation.

https://ci.appveyor.com/project/mmaitre314/testwicd2dwarp/build/1.0.9

Running msbuild seems to be the problem. The msbuild command-line runs fine on my local machine, so I must not be running the exact same command line/environment.

  1. Support Staff 1 Posted by Feodor Fitsner on 19 Dec, 2014 03:33 PM

    Feodor Fitsner's Avatar

    What command do you use to start msbuild?

    -Feodor

  2. 2 Posted by Matthieu Maitre on 19 Dec, 2014 04:59 PM

    Matthieu Maitre's Avatar

    Here are the commands I ran to try to repro on my local machine:

    C:\>git clone -q --branch=master git://github.com/mmaitre314/TestWicD2dWarp.git C:\projects\testwicd2dwarp
    C:\>cd C:\projects\testwicd2dwarp
    C:\projects\testwicd2dwarp>git checkout -qf 4a72d1b4e36e173f7758041c4bf8ac42ba000ef2
    C:\projects\testwicd2dwarp>msbuild TestWicD2dWarp\TestWicD2dWarp.sln -p:Platform=Arm -p:Configuration=Release

    In case that matters, this is a C++/CX Universal Store apps and my tool versions are:

    git version 1.9.4.msysgit.2
    Microsoft (R) Build Engine version 12.0.30723.0
    [Microsoft .NET Framework, version 4.0.30319.34014]
    Microsoft Visual Studio 12.0.30723.00 Update 3

  3. 3 Posted by Matthieu Maitre on 19 Dec, 2014 05:07 PM

    Matthieu Maitre's Avatar

    Thinking aloud, could there be an issue with SDKs needing to be installed in the VMs? That project has a dependency on the Windows 8.1 and Windows Phone 8.1 SDKs.

  4. Support Staff 4 Posted by Feodor Fitsner on 19 Dec, 2014 05:12 PM

    Feodor Fitsner's Avatar

    Both SDKs are already installed. I'll take a look what's wrong.

  5. Support Staff 5 Posted by Feodor Fitsner on 19 Dec, 2014 08:19 PM

    Feodor Fitsner's Avatar

    The underlying error is:

    The project file "TestWicD2dWarp\TestWicD2dWarp.Shared\TestWicD2dWarp.Shared.vcxitems" is in the ".vcproj" file format, which MSBuild no longer supports. Please convert the project by opening it in the Visual Studio IDE or running the conversion tool, or use MSBuild 3.5 or earlier to build it.

    Just dealt with the same issue today: http://help.appveyor.com/discussions/problems/1237-reference-not-fo...

    I read somewhere that it's like VS 2013 Express for Desktop doesn't support Windows Store apps, but I'm getting the same error locally while trying to analyze .SLN file using managed API. I guess this is the same thing that nuget.exe does at the first place.

    Let me investigate a little bit.

  6. Support Staff 6 Posted by Feodor Fitsner on 19 Dec, 2014 08:34 PM

    Feodor Fitsner's Avatar

    OK, found the issue and fixed it. Will deploy update today.

    The problem was in AppVeyor runner using old 4.0 build framework libraries for analyzing solution files. Switching to 12.0 fixes the issue. Guess the same could be done in nuget.exe too.

  7. 7 Posted by aleksandar.topl... on 19 Dec, 2014 08:58 PM

    aleksandar.toplek's Avatar

    So how would I switch nuget.exe to the v12? Do you have any idea?

  8. Support Staff 8 Posted by Feodor Fitsner on 19 Dec, 2014 09:10 PM

    Feodor Fitsner's Avatar

    Ha ha - found the solution! :)

    Placing nuget.exe.config next to nuget.exe with the following contents makes it work with new project types:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.Build" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="12.0.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.Build.Engine" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="12.0.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.Build.Framework" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="12.0.0.0" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
    </configuration>
    

    Love .NET :)

    Will deploy that today. Just to verify idea you can put this file during the build into c:\tools\nuget.

  9. 9 Posted by Matthieu Maitre on 19 Dec, 2014 09:26 PM

    Matthieu Maitre's Avatar

    Thanks!

  10. 10 Posted by aleksandar.topl... on 19 Dec, 2014 09:45 PM

    aleksandar.toplek's Avatar

    Thanks. Works like a charm!

  11. Support Staff 11 Posted by Feodor Fitsner on 19 Dec, 2014 09:48 PM

    Feodor Fitsner's Avatar

    Nice.

  12. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:53 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac