Issue Migrating friom 4.8 to 6.0

RogerSchlueter-7899 1,321 Reputation points
2022-07-10T12:36:42.267+00:00

The project is a wpf desktop application. I only get one bad error:

Unknown build error, 'Could not find type 'System.Web.UI.TagPrefixAttribute' in assembly 'C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.6\ref\net6.0\System.Web.dll'.' C:\Program Files\dotnet\sdk\6.0.301\Sdks\Microsoft.NET.Sdk.WindowsDesktop\targets\Microsoft.WinFX.targets

The only web access the application makes is to an email verification site using SingleRequestModel.

I have searched other sites and found some other pages that address this issue but only for Web applications. What is a fix - or at least a workaround - for this bug.

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,775 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Ken Tucker 5,851 Reputation points
    2022-07-10T19:57:36.113+00:00

    TagPrefixAttribute is a class in system.web.ui and not compatible with .net 6. Do you have anything like this in your code?

       [assembly:TagPrefix("CustomControls", "custom")]
    

  2. Hui Liu-MSFT 48,531 Reputation points Microsoft Vendor
    2022-07-12T02:02:37.977+00:00

    Hi,@RogerSchlueter-7899 . The problem may be a build error due to a transitive dependency on System.Web.
    There may also be item does not create the correct structure for the project. Either the third party, studio, nuget packages/manager. You could also try to manually restructure the project files to the correct target framework.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.