I had an old VC++ project on VS2013, now I have converted that project to VS2O19. It is able to create the dll successfully.
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
But that .dll not able to load in my web application. It is throwing below error.
Could not load file or assembly 'abc.xyz.dll' or one of its dependencies. is not a valid Win32 application. (Exception from HRESULT: 0x800700C1) System.BadImageFormatException: Could not load file or assembly 'abc.xyz.dll' or one of its dependencies. is not a valid Win32 application. (Exception from HRESULT: 0x800700C1) Filename: 'abc.xyz.dll'
@Joseph Willcoxson comments help. After installing Visual C++ 2019 runtime on the target machine this problem get resolve.
User contributions licensed under CC BY-SA 3.0