.NET 6 migration

Copper Contributor

Hi all,

During migration of our existing project targeting .NET framework 4.8 we encountered starnge error:

MC1000 Unknown build error, 'Could not find type 'System.Web.PreApplicationStartMethodAttribute' in assembly 'C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.5\ref\net6.0\System.Web.dll'.'

filio__0-1655112262684.png

Basically we have one big class library targeting net6.0-windows that has been used across multiple different smaller projects.

This class library is compileable as a stanalone porject with no errors, but as soon as we reference it in our WPF project, also targeting same net6.0-windows, we got this error.

Does anyone experiencing sme problem? 

Any help appreciated...

2 Replies

Hi @filio_,

Thanks for posting your issue here.

However this platform is used for how-to discussions and sharing best practices for building any app with .NET.Since your issue is a technical question, welcome to post it in Microsoft Q&A forum, the support team and communities on Microsoft Q&A will help you for any technical questions.
Besides, it will be appreciated if you can share it here once you post this technical question Microsoft Q&A.
Best Regards,
Lan Huang

@LanHuang I've posted there already, but does not have answer from them yet.

Meanwhile I figured out that it was problem with mixing APS.NET components with WinForm and WPF controls within one library assembly. So solution to this was isolate ASP.NET components from WinForm and WPF components.