Modernizing pages: webpartmapping.xml not found

I want to modernize site pages by following the .NET version of this Microsoft Blog: Modernize your SharePoint Pages I added the nugget package, I use a SharePoint Online Url.

When I get to the code

PageTransformator pageTransformator = new PageTransformator(ctx); 

I get the error

Could not find file ‘C:\Program Files (x86)\IIS Express\webpartmapping.xml’.

Altough I have the webpartmapping.xml in the project.

Webpartmapping file in solution explorer

and the webpartmapping properties are “copy always”. Webpartmapping properties

Any idea why I get this error?