%3CLINGO-SUB%20id%3D%22lingo-sub-1574043%22%20slang%3D%22en-US%22%3ENuget%20package%20for%20System.Net.Http%20on%20.NET%20Framework%204.7.2%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1574043%22%20slang%3D%22en-US%22%3E%3CP%3EApplication%20with%20a%20dependency%20to%20the%26nbsp%3B%3CSTRONG%3ESystem.Net.Http%20Nuget%20package%3C%2FSTRONG%3E%20may%20break%20after%20upgrading%20.NET%20Framework%20version%20to%26nbsp%3B%3CSTRONG%3E4.7.2%20or%20a%20newer%20version%3C%2FSTRONG%3E.%20This%20issue%20occurs%20if%20you%20are%20using%26nbsp%3B%3CSTRONG%3EVisual%20Studio%2015.5%20or%20a%20higher%20version%3C%2FSTRONG%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20application%20may%20throw%20an%20error%20like%20this%3A%3C%2FP%3E%0A%3CP%3E%3CEM%3EInitialization%20failed%3C%2FEM%3E%3CEM%3E%3CBR%20%2F%3EFailed%20to%20replace%20the%20search%20service.%20Check%20the%20error%20log%20for%20more%20information.%3CBR%20%2F%3Eat%20Telerik.Sitefinity.Services.Search.SearchModule.RegisterService%20%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Nedim_0-1596841715737.jpeg%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F211054i1805E113FEEB5522%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22Nedim_0-1596841715737.jpeg%22%20alt%3D%22Nedim_0-1596841715737.jpeg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1202650095%22%20id%3D%22toc-hId-1202652171%22%3EWorkaround%3C%2FH3%3E%0A%3CP%3EApply%20the%20workaround%20mentioned%20in%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FMicrosoft%2Fdotnet%2Fblob%2Fmaster%2Freleases%2Fnet472%2FKnownIssues%2F613745%2520-%2520Single-name%2520references%2520are%2520removed%2520by%2520the%2520SDK%2520when%2520targeting%25204.7.2.md%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ethis%20document%3C%2FA%3E%20first.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAnother%20workaround%20is%20to%20use%20a%20Visual%20Studio%20version%20that%20is%20lower%20than%2015.5%20may%20get%20the%20application%20working%20but%20this%20is%20not%20recommended.%20Older%20versions%20of%20Visual%20Studio%20may%20present%20security%20issues%20to%20your%20organization.%20They%20are%20also%20not%20supported%20by%20Microsoft.%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--604804368%22%20id%3D%22toc-hId--604802292%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22toc-hId-1882708465%22%20id%3D%22toc-hId-1882710541%22%3ESolution%3C%2FH3%3E%0A%3CP%3EThe%20recommendation%20is%20to%20use%20System.Net.Http%20DLL%20that%20comes%20with%20.NET%20Framework.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20your%20application%20throws%20errors%20when%20you%20switch%20Nuget%20DLL%20with%20platform%20DLL%2C%20it%20means%20it%20is%20not%20compatible%20with%20the%20new%20libraries.%20Coding%20changes%20will%20be%20required%20to%20make%20it%20compatible.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20see%20BadImageFormatException%20for%20System.Net.Http%20or%20other%20libraries%20when%20you%20access%20your%20web%20application%2C%20check%20this%20post%20out%3A%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fiis-support-blog%2Ffusion-log-viewer-fuslogvw-exe%2Fba-p%2F784396%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fiis-support-blog%2Ffusion-log-viewer-fuslogvw-exe%2Fba-p%2F784396%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1574043%22%20slang%3D%22en-US%22%3E%3CP%3EApplication%20with%20a%20dependency%20to%20the%20System.Net.Http%20Nuget%20package%20may%20break%20after%20upgrading%20.NET%20Framework%20version%20to%204.7.2%3C%2FP%3E%3C%2FLINGO-TEASER%3E
Microsoft

Application with a dependency to the System.Net.Http Nuget package may break after upgrading .NET Framework version to 4.7.2 or a newer version. This issue occurs if you are using Visual Studio 15.5 or a higher version.

 

The application may throw an error like this:

Initialization failed
Failed to replace the search service. Check the error log for more information.
at Telerik.Sitefinity.Services.Search.SearchModule.RegisterService

Nedim_0-1596841715737.jpeg

 

Workaround

Apply the workaround mentioned in this document first.

 

Another workaround is to use a Visual Studio version that is lower than 15.5 may get the application working but this is not recommended. Older versions of Visual Studio may present security issues to your organization. They are also not supported by Microsoft.

 

Solution

The recommendation is to use System.Net.Http DLL that comes with .NET Framework.

 

If your application throws errors when you switch Nuget DLL with platform DLL, it means it is not compatible with the new libraries. Coding changes will be required to make it compatible.

 

If you see BadImageFormatException for System.Net.Http or other libraries when you access your web application, check this post out: 

https://techcommunity.microsoft.com/t5/iis-support-blog/fusion-log-viewer-fuslogvw-exe/ba-p/784396