dotnet / dotnet/wpf

Visual Basic WPF .NET Framework 48 SDK style project fails to compile: assembly mscorlib not found

Open
#11,501 7 comments 2 reactions 0 assignees View on GitHub
Untriaged
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

### Describe the bug

I want to create a legacy .NET Framework 4.8 WPF app in Visual Basic as SDK style project. For C# I can just create a .NET WPF project and change the target framework to `net48`. Doing the same with Visual Basic results in the error below.

### To Reproduce

In Visual Studio:
* create a Visual Basic .NET 6 WPF project
* change _TargetFramework_ to `net48`
* build

### Exceptions (if any)

```
1>Target MarkupCompilePass1:
1> C:\Program Files\dotnet\sdk\7.0.102\Sdks\Microsoft.NET.Sdk.WindowsDesktop\targets\Microsoft.WinFX.targets(211,9): error MC1000: Unknown build error, 'Could not find assembly 'mscorlib, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Either explicitly load this assembly using a method such as LoadFromAssemblyPath() or use a MetadataAssemblyResolver that returns a valid assembly.'
1>Done building target "MarkupCompilePass1" in project "WpfApp1.vbproj" -- FAILED.
```

### Further technical details

Microsoft Visual Studio Professional 2022
Version 17.4.4
VisualStudio.17.Release/17.4.4+33213.308
Microsoft .NET Framework
Version 4.8.04084

Installed Version: Professional

Visual Basic Tools 4.4.0-6.22608.27+af1e46ad38d900023f8b1a2839484e471ece1502
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.