Skip to content

Commit 2f7e988

Browse files
authored
Merge pull request #43 from erikma/dev/erikmav/exceptionDoc
Add search bait for dealing with exception under .NET Core
2 parents 93be3a6 + 3a5044e commit 2f7e988

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,18 @@ you can run SimpleProviderManaged.exe or a provider of your own devising. Refer
6868
[this page](https://docs.microsoft.com/en-us/windows/desktop/projfs/enabling-windows-projected-file-system)
6969
for instructions.
7070

71+
### Dealing with a BadImageFormatException at run time under .NET Core
72+
If you encounter this exception pattern at runtime when using this package under .NET Core:
73+
74+
System.BadImageFormatException: Could not load file or assembly 'ProjectedFSLib.Managed, Version=1.2.19351.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. An attempt was made to load a program with an incorrect format.
75+
76+
This typically occurs when the .NET Core loader attempts to find Ijwhost.dll from the .NET Core runtime. To force this to be deployed with your application under MSBuild, add the following property to each csproj file that is importing the Microsoft.Windows.ProjFS package:
77+
78+
<PropertyGroup>
79+
<UseIJWHost>True</UseIJWHost>
80+
</PropertyGroup>
81+
82+
7183
## Contributing
7284

7385
For details on how to contribute to this project, see the CONTRIBUTING.md file in this repository.

scripts/BuildProjFS-Managed.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ IF NOT EXIST %nuget% (
2020
:: Use vswhere to find the latest VS installation (including prerelease installations) with the msbuild component.
2121
:: See https://github.com/Microsoft/vswhere/wiki/Find-MSBuild
2222
SET vswherever=2.8.4
23-
%nuget% install vswhere -Version %vswherever% || exit /b 1
23+
%nuget% install vswhere -Version %vswherever% -OutputDirectory %PROJFS_PACKAGESDIR% || exit /b 1
2424
SET vswhere=%PROJFS_PACKAGESDIR%\vswhere.%vswherever%\tools\vswhere.exe
2525
set WINSDK_BUILD=18362
2626
echo Checking for VS installation:

0 commit comments

Comments
 (0)