Questions tagged [multitargeting]
115 questions
33
votes
4 answers
How do you run unit tests for a specific target framework in Visual Studio 2017/2019?
I am really loving the new .csproj format. It is so much better than that dreaded (limited) project.json.
However, there is one thing that I am trying to work out. I have merged my (multiple) test projects into a single multi-targeted project.…

NightOwl888
- 55,572
- 24
- 139
- 212
22
votes
2 answers
Is there a recommended approach to configuring a NuGet package targeting multiple frameworks in TeamCity using MSBuild?
I've read a handful of posts (see references below) and have yet to find a guide on best practices that is specific to my tech stack.
The goal: Create a single NuGet package targeting multiple .NET frameworks built from a single .csproj file via…

David Peden
- 17,596
- 6
- 52
- 72
16
votes
2 answers
Conditional reference in Visual Studio Community 2017
I am creating a multi-platform application. I have a multi-targeted shared library (targeting .netstandard 2.0 and .net 4.5)...See project file:
netstandard2.0;net45
When…

user3689167
- 863
- 1
- 14
- 28
14
votes
2 answers
Custom framework targeting in Visual Studio 2010
I want to give developers using Visual Studio the ability to write programs against a custom framework that replaces .NET (similar to the Windows Phone and Silverlight frameworks, which are not subsets or profiles of an existing framework), and have…

Daniel A.A. Pelsmaeker
- 47,471
- 20
- 111
- 157
14
votes
1 answer
Targeting multiple .NET frameworks in a single binary?
The Background:
I have an application that needs to run on clients whose installed .NET frameworks range all the way from 2.0 up to 4.5. This application has to be able to enumerate and perform operations on large numbers of files (in excess of…

Ed Penwell
- 163
- 5
11
votes
4 answers
Multitargeting in .NET
Having gone through various blogs, I am quite confused about the terminology of "multitargeting" or side by side execution.
Some blogs say that, side by side execution means two versions of CLRs in a process. Some others claims that, its like .net…

Jasmine
- 5,186
- 16
- 62
- 114
10
votes
2 answers
Xamarin - Multi-targetting - "'System.ValueTuple`2' is declared in multiple referenced"
As soon as I try to compile code that use C# 7 tuples with multi targets (netstandard2.0 and xamarin.iOS) I got the following error:
Predefined type 'System.ValueTuple`2' is declared in multiple
referenced assemblies

François
- 3,164
- 25
- 58
7
votes
2 answers
Can my .Net app reference two different versions of a .net framework library?
Say I have two projects, P4 and P3, targetting .net 4.0 and 3.5 respectively.
Each project also has a reference to System.Data.
In the case of P4, it will be to System.Data v4.0.0.0
In the case of P3, it will be to System.Data v2.0.0.0
Project P4…

Rob
- 4,327
- 6
- 29
- 55
7
votes
2 answers
How do I get Nant to use the 4.0 compiler to target .Net 3.5
Yes I know that sounds a little bit crazy, but I've got .Net 3.5 deployed in the field and I'd like to use the new 4.0 compiler to target it.
There are several new syntactic sugar features in the latest versions of Vb.Net and C# which I would like…

Rory Becker
- 15,551
- 16
- 69
- 94
5
votes
2 answers
How to target both Win32 and x64 platforms with ONLY one set of solution/project files?
I'm trying to migrate a multiple-project from VC++2005 to VC++2010, and I also need to port this application from Win32 to x64 platform.
I know that a project file could contain settings for both platforms, but it requires that I have to manully…

cobe24
- 221
- 3
- 8
5
votes
2 answers
Is it possible to use #if NET6_0_OR_GREATER to exclude a benchmark method from a BenchmarkDotNet run?
Suppose that you're writing some benchmarks for use with BenchmarkDotNet that are multi-targeted to net48 and net6.0, and that one of those benchmarks can only be compiled for the net6.0 target.
The obvious thing to do is to use something like this…

Matthew Watson
- 104,400
- 10
- 158
- 276
5
votes
2 answers
How do you select which build target to debug?
If I am multitargeting a project to .Net Core 3.1 and .Net Framework 4.8 and I select Debug | Start Debugging, Visual Studio 2019 starts a debugging session with the .Net Framework build target.
How can I get it to launch the .Net Core build target…

Matthew Watson
- 104,400
- 10
- 158
- 276
5
votes
1 answer
How to Multi target a library project with WPF controls
I have a class library project that needs to target .NET 3.5 and .NET 4.0, and the way it is done now is the typical way of creating separate projects per target framework and linking files in each project to the same source.
I would like to take…

TJ Rockefeller
- 3,178
- 17
- 43
4
votes
3 answers
'HttpClientHandler' does not contain a definition for 'ClientCertificates' in net461 and net47?
I'm making a NuGet package and my csproj looks like this:
SAK
SAK
SAK
…

Jamie Twells
- 1,924
- 4
- 26
- 56
4
votes
1 answer
How does multiple target Ridge Regression work in scikit learn?
I am struggling to understand the following:
Scikit-learn offers a multiple output version for Ridge Regression, simply by handing over a 2D array [n_samples, n_targets], but how is it…

user2933782
- 61
- 4