Questions tagged [target-framework]
94 questions
63
votes
9 answers
System.BadImageFormatException An attempt was made to load a program with an incorrect format
I'm writing a plug-in for another program that is based on a public .NET API. Typically these plugins are made by creating a class library DLL that references the API assembly. Then a command class is created by inheriting from a base command class…

Eric Anastas
- 21,675
- 38
- 142
- 236
45
votes
9 answers
Error when changing to (plural) in .NET Core csproj file
I was following a tutorial on Pluralsight about having an MSTest project target both .net core 2.2 AND .NET 4.7.2. This required going to my .csproj file for my test project and editing it so that the following:
…

David
- 4,665
- 4
- 34
- 60
44
votes
7 answers
Configuration Error related to targetFramework in web.config
I have made an MVC website in Visual Studio 2015 and it works in my localhost. But when I published my website and put into my host, it doesn't work. It gives me this error notice:
Server Error in '/' Application.
Configuration Error
Parser Error…

rockenpeace
- 1,011
- 5
- 18
- 29
37
votes
4 answers
After updated Visual Studio 2019 to 16.4.0 I can't run tests with target framework 2.2
I have updated Visual studio 2019 to version 16.4.0. This version includes .NET Core SDK 3.1.100.
After that, I have tried to run some Unit Tests that I have on a project with Target Framework 2.2 but it's not being able to do so.
It gives the…

Sebastian Inones
- 1,561
- 1
- 19
- 32
24
votes
6 answers
Retrieve Target Framework Version and Target Framework Profile from a .Net Assembly
Is there any way that I can access the values that were used for TargetFrameworkVersion and/or TargetFrameworkProfile when a .Net assembly was compiled?
The values I'm talking about are the ones contained the project file

Scott
- 4,113
- 6
- 37
- 49
16
votes
2 answers
TargetFramework vs. TargetFrameworks (plural)
In the .csproj file in my .NET Core projects, there are these 3 lines by default:
netcoreapp2.2
Now if I want to target mulitple frameworks, I can change it to…

Jakob Busk Sørensen
- 5,599
- 7
- 44
- 96
14
votes
3 answers
Install .Net Framework 4.5 Targeting Pack
please help.
I have installed quite a lot of framework and development pack. as you can see in the image.
unfortunately I want to access an ancient project. this project runs on .net framwork 4.5, and must not be upgraded.
I have visual studio 22…

Rikudou En Sof
- 526
- 1
- 4
- 21
12
votes
2 answers
How to list all target frameworks of all projects for a given solution inside Visual Studio?
Given an opened solution in Visual Studio, how do I quickly check which target frameworks the various projects in the solution have? Is there a solution-wide view somewhere that shows which target framework each project targets, or an aggregate view…

julealgon
- 7,072
- 3
- 32
- 77
10
votes
2 answers
Xamarin Incompatible target framework error - can NuGet help me?
I am coding a Xamarin application and I wish to add the MonoDroidToolkit as a project to my current solution. I have done this correctly, and my solution builds.
I now need to add a reference in my application to the MonoDroidToolkit project.
I have…

Simon
- 7,991
- 21
- 83
- 163
9
votes
4 answers
What decides the target framework version of a satellite assembly?
What decides the target framework version of a satellite assembly?
Looking at the log file I can see the satellite assembly is build by running ResGen.exe and Al.exe but I can't find out what decides the target framework of the resulting…

Magnus Lindhe
- 7,157
- 5
- 48
- 60
6
votes
2 answers
How can I target a different framework version in a different configuration of the same project?
I have a class library that targets .NET 3.5. Now, I would like to add some features that require .NET 4.0, but I still want to be able to generate a version that targets .NET 3.5 (without these features of course).
Ideally, I would like to target a…

Thomas Levesque
- 286,951
- 70
- 623
- 758
4
votes
1 answer
Multiple target framework project: different versions of the same NuGet package on different frameworks?
I've put together a .Net 5 for Windows application, using among other things EntityFramework 5.0.13.
Now we're trying to run it on a specific server, that doesn't have the .Net 5 framework yet. The nice people who admin the server tell me that…

Jean-David Lanz
- 865
- 9
- 18
4
votes
2 answers
Unable to update project to .NET 5
I've installed .NET 5 SDK both x64 and x86 and updated visual studio to the latest version. Restarted the computer and visual studio many times, the only options it allows me are .NET Framework up to version 4.8.
.NET 5 does not appear in the new…

Issung
- 385
- 3
- 14
4
votes
2 answers
How to run unit tests with .NET version 4.6.2 in Visual Studio 2019?
I'm trying to resolve this warning from unit test runs in Visual Studio:
[6/7/2019 7:16:21 PM Warning] Test run will use DLL(s) built for
framework .NETFramework,Version=v4.5 and platform X64. Following
DLL(s) do not match framework/platform…

DonClaveau
- 43
- 1
- 7
4
votes
1 answer
dotnet publish sln having projects with multiple target frameworks fails
I have a solution with many projects. Some target frameworknetcoreapp2.1, some other target framework netstandard2.0 and one project has a double target framework
netstandard2.0;net471
I'd want to have a…

Lorenzo Isidori
- 1,809
- 2
- 20
- 31