question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

This application has failed to start because the application configuration is incorrect

See original GitHub issue

I have a WPF application, and I’m getting the error message below upon adding the library.

  • Removing the library makes it work again
  • Compared the solution directories before and after the install. Literally the only difference are in packages.config and myProject.csproj which I provided below. I also added "additional few lines hoping that may give you a clue.

This application has failed to start because the application configuration is incorrect. Review the manifest file for possible errors. Reinstalling the application may fix this problem. For more details, please see the application event log.

image

packages.config

  <package id="LibGit2Sharp" version="0.26.1" targetFramework="net472" />
  <package id="LibGit2Sharp.NativeBinaries" version="2.0.289" targetFramework="net472" />

myProject.csproj

<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>x64</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <Prefer32Bit>false</Prefer32Bit>
  </PropertyGroup>
  <PropertyGroup>
    <GenerateManifests>true</GenerateManifests>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="LibGit2Sharp, Version=0.26.0.0, Culture=neutral, PublicKeyToken=7cbde695407f0333, processorArchitecture=MSIL">
      <HintPath>..\..\packages\LibGit2Sharp.0.26.1\lib\net46\LibGit2Sharp.dll</HintPath>
    </Reference>
  </ItemGroup>
  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
    <Error Condition="!Exists('..\..\packages\LibGit2Sharp.NativeBinaries.2.0.289\build\net46\LibGit2Sharp.NativeBinaries.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\LibGit2Sharp.NativeBinaries.2.0.289\build\net46\LibGit2Sharp.NativeBinaries.props'))" />
  </Target>
  <Import Project="..\..\packages\LibGit2Sharp.NativeBinaries.2.0.289\build\net46\LibGit2Sharp.NativeBinaries.props" Condition="Exists('..\..\packages\LibGit2Sharp.NativeBinaries.2.0.289\build\net46\LibGit2Sharp.NativeBinaries.props')" />
</Project>

Event logs - SideBySide

Activation context generation failed for "C:\Source\github\myProject\src\MyApp\bin\Debug\MyApp.exe.Manifest".Error in manifest or policy file "C:\Source\github\myProject\src\MyApp\bin\Debug\MyApp.exe.Manifest" on line 1207. The value "lib\alpine.3.9-x64\native\..\libgit2-7ce88e6.so" of attribute "name" in element "urn:schemas-microsoft-com:asm.v1^file" is invalid.

Manifest file line 1207

  <file name="lib\alpine.3.9-x64\native\..\libgit2-7ce88e6.so" size="1328560">
    <hash>
      <dsig:Transforms>
        <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
      </dsig:Transforms>
      <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
      <dsig:DigestValue>dB4Q60wN4VMMMXxILRlbKYEReOqrxvLr0+IXJaLy5HA=</dsig:DigestValue>
    </hash>
  </file>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
bordingcommented, Dec 28, 2019

If for some reason you can’t just disable the manifest generation, adding the following to your project file should help:

  <Target Name="RemoveNonWindowsLibGit2SharpLibraries" BeforeTargets="_DeploymentComputeClickOnceManifestInfo">
    <ItemGroup>
      <ContentWithTargetPath Remove="@(ContentWithTargetPath)" Condition="'%(Extension)' == '.so'"/>
      <ContentWithTargetPath Remove="@(ContentWithTargetPath)" Condition="'%(Extension)' == '.dylib'"/>
      <ContentWithTargetPath Remove="@(ContentWithTargetPath)" Condition="'%(Filename)%(Extension)' == 'LibGit2Sharp.dll.config'"/>
    </ItemGroup>
  </Target>

The assumption here is that since you’re writing a WPF app, you don’t need any of the non-Windows files. Those are included by default to enable support for mono.

0reactions
abulhasanlakhanicommented, Nov 4, 2020

Thank you so much. This workaround helped me!

Read more comments on GitHub >

github_iconTop Results From Across the Web

"application has failed to start ... configuration is incorrect ...
When I want to run my project, I get this message: "This application has failed to start because the application configuration is incorrect....
Read more >
Side by side configuration is incorrect
"WINDOWS 10 error The application has failed to start because the side by side configuration is incorrect please see the application event log ......
Read more >
The Application Failed To Start Because Its Side-by- ...
If you see the “ The application has failed to start because its side-by-side configuration is incorrect ” error when trying to start...
Read more >
The Application Has Failed to Start Because Its Side-By- ...
Today we're looking at the error known as "The application has failed to start because its side-by-side configuration is incorrect.
Read more >
Windows XP: This application has failed to start because ...
System Shock™ 2 - Windows XP: This application has failed to start because the application configuration is incorrect. If you are using Windows...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found