Share via

form does not support code parsing or generation becausew it is not contained within a project that supports this code

Gary Morris 0 Reputation points
2026-04-20T00:07:35.4466667+00:00

1>------ Rebuild started: Project: PayDay, Configuration: Debug|AnyCPU ------

1>C:\Program Files\dotnet\sdk\9.0.313\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(32,5): warning NETSDK1138: The target framework 'net6.0-windows' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy.

1>C:\Program Files\dotnet\sdk\9.0.313\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(266,5): error MSB4018: The "ResolvePackageAssets" task failed unexpectedly.

C:\Program Files\dotnet\sdk\9.0.313\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(266,5): error MSB4018: NuGet.Packaging.Core.PackagingException: Unable to find fallback package folder 'C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages'.

C:\Program Files\dotnet\sdk\9.0.313\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(266,5): error MSB4018: at NuGet.Packaging.FallbackPackagePathResolver..ctor(String userPackageFolder, IEnumerable`1 fallbackPackageFolders)

C:\Program Files\dotnet\sdk\9.0.313\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(266,5): error MSB4018: at Microsoft.NET.Build.Tasks.NuGetPackageResolver.CreateResolver(IEnumerable`1 packageFolders)

Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other

A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Q&A Assist
    2026-04-20T00:07:46.8666667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The build log shows two separate issues:

    1. NETSDK1138: The target framework 'net6.0-windows' is out of support
    2. MSB4018: ResolvePackageAssets failed because it cannot find the fallback NuGet package folder

    Address them in this order.

    1. Fix the out‑of‑support target framework

    net6.0-windows is out of support. To bring the project back into support, edit the project file (.csproj or .vbproj) and change the target framework to a supported one, for example:

    <PropertyGroup>
      <TargetFramework>net8.0-windows</TargetFramework>
    </PropertyGroup>
    

    If changing the target framework is not possible right now and the goal is only to get rid of the warning, add this property instead:

    <PropertyGroup>
      <CheckEolTargetFramework>false</CheckEolTargetFramework>
    </PropertyGroup>
    

    This suppresses NETSDK1138 while still targeting the old framework.

    1. Fix the NuGet fallback package folder error

    The error

    Unable to find fallback package folder 'C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages'

    means the SDK is configured to use that path as a fallback package folder, but the folder does not exist on disk.

    Use one of these approaches:

    • Create the folder manually at C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages and rebuild, or
    • Remove/adjust the fallback folder configuration (for example, in NuGet.Config or MSBuild properties) so it no longer points to that path.

    Once the fallback folder path is valid (or removed) and the project targets a supported framework (or has CheckEolTargetFramework disabled), the ResolvePackageAssets task should complete and the project should build.

    The designer message

    form does not support code parsing or generation because it is not contained within a project that supports this code

    is typically a consequence of the project not loading/building correctly. After fixing the target framework and NuGet configuration so the project builds successfully, close and reopen the solution; the Windows Forms designer should then be able to parse and generate code again.


    References:

    Was this answer helpful?

Your answer

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