dotnet / wpf

WPF is a .NET Core UI framework for building Windows desktop applications.
MIT License
7.08k stars 1.17k forks source link

class library .NET 4.8 => .NET 6 - problem #9390

Open vsfeedback opened 4 months ago

vsfeedback commented 4 months ago

This issue has been moved from a ticket on Developer Community.


[regression] [worked-in:.Net framework 4.8] Hi,

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'.'

q

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.

Any help appreciated...


Original Comments

Feedback Bot on 6/14/2022, 11:28 AM:

(private comment, text removed)

Feedback Bot on 10/9/2022, 11:42 AM:

(private comment, text removed)


Original Solutions

(no solutions)

harshit7962 commented 4 months ago

Can you provide the minimal repro for the same.

bgrainger commented 3 months ago

Looks like a duplicate of this question: https://stackoverflow.com/q/72602061/23633

Based on https://stackoverflow.com/a/76564520/23633 and https://github.com/dotnet/sdk/issues/21942#issuecomment-603193785, it's probably caused by references to old NuGet packages.