Created
March 13, 2019 01:34
-
-
Save cowlinator/1b6ea106502b1027fe65bd2b11770d9a to your computer and use it in GitHub Desktop.
How to fix msbuild LNK1318 in Docker containers without modifying the project files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create a file with the following contents: | |
<?xml version="1.0" encoding="utf-8"?> | |
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<!-- Fix for error LNK1318 in hyperV docker containers --> | |
<ItemDefinitionGroup> | |
<ClCompile> | |
<DebugInformationFormat>OldStyle</DebugInformationFormat> | |
</ClCompile> | |
</ItemDefinitionGroup> | |
<!-- END fix for error LNK1318 in hyperV docker containers --> | |
</Project> | |
And name it `docker_msbuild_fix.props` . | |
Then, add `/property:ForceImportBeforeCppTargets=docker_msbuild_fix.props` to your msbuild command. | |
For example: | |
`msbuild solution.sln /property:ForceImportBeforeCppTargets=docker_msbuild_fix.props` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment