UWP supporting Windows.Forms library

Andrei Lovin 1 Reputation point
2020-05-06T14:12:11.033+00:00

I'm working on a UWP project in which I'm trying to add a third-party library. I added the library and everything seemed to work fine until I cleaned and rebuild the solution? Now I'm getting:

Cannot resolve Assembly or Windows Metadata file 'Type universe cannot resolve assembly: System.Windows.Forms ...  Project.csproj

and

Could not copy the file "obj\x86\Debug\FavoriteControl\Favorite.xbf" because it was not found.      

I definitely know that the errors are from the library. The library was added through Reference and some header were added inside the project.

Universal Windows Platform (UWP)
{count} votes

1 answer

Sort by: Most helpful
  1. Richard Zhang-MSFT 6,936 Reputation points
    2020-05-06T23:57:30.663+00:00

    Hello,

    Welcome to Microsoft Q&A!

    The libraries used by UWP projects are not fully compatible with WinForm, you cannot directly reference them. Please consider replacing with a library supported by UWP.

    Thank you.

    0 comments No comments