Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS 2017 15.5.0 - Multitargeting just plain doesn't work #4084

Closed
ctaggart opened this issue Dec 8, 2017 · 10 comments
Closed

VS 2017 15.5.0 - Multitargeting just plain doesn't work #4084

ctaggart opened this issue Dec 8, 2017 · 10 comments
Labels
Area-LangService-API Bug Impact-High (Internal MS Team use only) Describes an issue with extreme impact on existing code.
Milestone

Comments

@ctaggart
Copy link
Contributor

ctaggart commented Dec 8, 2017

To reproduce, simply create a console app, edit the fsproj and switch from TargetFrameworkto TargetFrameworks. Here is a video demo:

https://youtu.be/jxrtAIvMPzE

@ctaggart
Copy link
Contributor Author

ctaggart commented Dec 8, 2017

IntelliSense is also not working with TargetFrameworks. Essentially, TargetFrameworks does not work in F#.

@cartermp
Copy link
Contributor

In general, multitargeting with F# is completely hosed. We haven't estimated the extent of the work, but I suspect it will be complicated given the space of things that can go wrong and the large amount of work that had to go into it for C#/VB tooling (and even today, there's no experience for multitargeting in the UI, forcing you to use some of the weirdo MSBuild syntax to express dependencies for different targets under whatever conditions are relevant to you).

I don't recommend multitargeting today unless you must target something that .NET Standard doesn't cover today.

@cartermp cartermp changed the title VS 2017 15.5.0 F# can't set breakpoint when TargetFrameworks VS 2017 15.5.0 - Multitargeting just plain doesn't work Dec 12, 2017
@ctaggart
Copy link
Contributor Author

ctaggart commented Dec 13, 2017

Thanks for the confirmation. I noticed.

Unity only supports net46 and does not yet support netstandard. We have common code that we want to share in a library for Unity and for a server side web app. The web app, we want to deploy on dotnet core. Most likely, Unity will ship netstandard support in the first release of 2018 and then we'll be in a good position again.

When you multitarget, the Visual Studio UI gives you a selectbox to switch between the target frameworks:

C#

image

F#

image

@eiriktsarpalis
Copy link
Member

+1 on this. Would really like to see this issue addressed.

@ctaggart
Copy link
Contributor Author

ctaggart commented Dec 30, 2017

C# in 15.5 simply runs and debugs the first one listed in TargetFrameworks. I learned this the hard way yesterday when trying to debug SourceLink. I only have the netcore 2 sdk installed, not netcore 1 sdk on this laptop. I got some obscure runtime error until I changed netcoreapp2.0 to be first. My recommendation for a short term fix is to simply use the first framework listed for debugging just like C# does.

@jackfoxy
Copy link

jackfoxy commented Jan 2, 2018

Handy repo to develop/test with https://github.com/jackfoxy/multitargetpaket
This now works with Ionide. I would really like to see VS catch up on this.

@dsyme dsyme added Bug Impact-High (Internal MS Team use only) Describes an issue with extreme impact on existing code. labels Jan 9, 2018
@noelmcgrath
Copy link

any update when this will be available?

@cartermp
Copy link
Contributor

We're closing in on the (quite huge) amount of work to complete file ordering with folder support and all current UI gestures for .NET Core SDK projects shipping in 15.6. Once that's locked down, we'll be looking at this and trying to get it fixed for 15.7.

@dmitry-a-morozov
Copy link

Suggested workaround: Have a single target defined for debug and use multi-targeting for release/deploy.

    <TargetFramework Condition="'$(Configuration)'=='Debug'">net461</TargetFramework>
    <TargetFrameworks Condition="'$(Configuration)'=='Release'">netstandard2.0;net461</TargetFrameworks>

@paulostradioti
Copy link

Hi all,

Have this issue been resolved? It seems that the problem persists in Visual Studio 2022 and it only hits breakpoints in the first target framework.

cc @cartermp, @dsyme
Thank you,
Paulo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-LangService-API Bug Impact-High (Internal MS Team use only) Describes an issue with extreme impact on existing code.
Projects
None yet
Development

No branches or pull requests

8 participants