asp .net core app on IIS --> Could not load file or assembly System.Windows.Forms

490 views Asked by At

I have an Asp .Net core project with

<UseWindowsForms>true</UseWindowsForms>

Trying to deploy this project to IIS with following settings

 <TargetFramework>net6.0-windows</TargetFramework>
 <SelfContained>false</SelfContained>

On the server, asp .net core hosting bundle is installed.

However, when the function which requires windows forms assemblies is called, following error is thrown:

System.IO.FileNotFoundException:Could not load file or assembly 'System.Windows.Forms, >Version=6.0.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find >the file specified.

EDIT:

So the question is if any component is built on a different version like 6.0.2.0, how is it resolved on IIS ? Do we have to have a redirection file like in old times?

0

There are 0 answers