From 2851335c55ac329d30720cfc1f1bed3a06f80c63 Mon Sep 17 00:00:00 2001 From: brphelps Date: Fri, 22 Jan 2021 10:45:40 -0800 Subject: [PATCH 1/2] Add info about enabling projFS re: badimageformat --- README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e4b9c9a..cc5516c 100644 --- a/README.md +++ b/README.md @@ -68,10 +68,14 @@ you can run SimpleProviderManaged.exe or a provider of your own devising. Refer [this page](https://docs.microsoft.com/en-us/windows/desktop/projfs/enabling-windows-projected-file-system) for instructions. -### Dealing with a BadImageFormatException at run time under .NET Core -If you encounter this exception pattern at runtime when using this package under .NET Core: - - 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. +### Dealing with BadImageFormatExceptions +If you're seeing an error pattern like this: +``` 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. ``` +then it's likely that a dependent assembly of this library is missing. The most common cause for BadImageFormatExceptions is that you haven't enabled the ProjFS windows component yet, which is now optional: +` Enable-WindowsOptionalFeature -Online -FeatureName Client-ProjFS -NoRestart ` +([source](https://docs.microsoft.com/en-us/windows/win32/projfs/enabling-windows-projected-file-system)) + +#### If you encounter this exception pattern at runtime when using this package under .NET Core: 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: From 5bc1ae7558e1af90e6ad93280154f65a5b580b46 Mon Sep 17 00:00:00 2001 From: brphelps Date: Wed, 27 Jan 2021 12:26:30 -0800 Subject: [PATCH 2/2] Update README.md --- README.md | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index cc5516c..40278e9 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,9 @@ very large git repos. Conceptual documentation for ProjFS along with documentation of its Win32 API is at [docs.microsoft.com](https://docs.microsoft.com/en-us/windows/desktop/projfs/projected-file-system). -ProjFS ships as an [optional component](https://docs.microsoft.com/en-us/windows/desktop/projfs/enabling-windows-projected-file-system) -starting in Windows 10 version 1809. +## Enabling ProjFS + +ProjFS enablement is **required** for this library to work correctly. ProjFS ships as an [optional component](https://docs.microsoft.com/en-us/windows/desktop/projfs/enabling-windows-projected-file-system) starting in Windows 10 version 1809. ## About the ProjFS Managed API @@ -69,15 +70,9 @@ you can run SimpleProviderManaged.exe or a provider of your own devising. Refer for instructions. ### Dealing with BadImageFormatExceptions -If you're seeing an error pattern like this: -``` 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. ``` -then it's likely that a dependent assembly of this library is missing. The most common cause for BadImageFormatExceptions is that you haven't enabled the ProjFS windows component yet, which is now optional: -` Enable-WindowsOptionalFeature -Online -FeatureName Client-ProjFS -NoRestart ` -([source](https://docs.microsoft.com/en-us/windows/win32/projfs/enabling-windows-projected-file-system)) - -#### If you encounter this exception pattern at runtime when using this package under .NET Core: +The simplest cause for BadImageFormatExceptions is that you still need to [enable ProjFS](#enabling-projfs). -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: +For .Net Core specific consumers, this can also occur 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: True