dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
18.78k stars 4k forks source link

Add "Initialize Interactive with Project" support for projects other than .NET Framework #26934

Open davkean opened 6 years ago

davkean commented 6 years ago

Given the PR called out in this issue https://github.com/dotnet/project-system/issues/223, "Initialize Interaction with Project" now shows up for the new project system if target .NET Framework in 15.8. The menu is hidden when targeting other platforms.

The project system work is done, the rest of this work is on Roslyn's side.

davkean commented 6 years ago

Note, this is basically a new version of the bug @shaggygi filed here https://github.com/dotnet/roslyn/issues/11684.

shaggygi commented 6 years ago

And then there is https://github.com/dotnet/roslyn/issues/19050 where @kuhlenh filed. :laughing:

gregory-seidman commented 5 years ago

Any progress on this? I just ran into it.

davkean commented 5 years ago

This a feature request in the Unknown milestone meaning that it has not been scheduled.

lostmsu commented 5 years ago

Got 2019 RC, and this feature did not make it :/

shaggygi commented 5 years ago

It is on unknown milestone so don't think it is implemented yet.

mmmaxwwwell commented 4 years ago

This is very helpful when I'm trying to one-off something for a quick POC. I can't wait to get it back!!!

andre-ss6 commented 4 years ago

Why is this roslyn instead of IDE?

Postlagerkarte commented 4 years ago

Any update on this? This is such a useful feature!

StingyJack commented 4 years ago

Yet another thing that I went to use in VS that has been available for previous versions and frameworks that is now missing.

Rewriting the entirety of netfx into a wholly different framework and codebase instead of refactoring in place was a really dumb and costly decision. Add this cost to that bucket and to the customer dissatisfaction bucket.

shaggygi commented 4 years ago

There's lots missing from original objectives with the C# REPL. Would love to see NuGet support. I heard the plan was to take what was learned from F# Interactive and add to C# flavor at some point. Any roadmaps/discussions?

Regenhardt commented 4 years ago

Here's hoping this gets more traction soon. C#-Interactive is awesome to quickly try things before trying it in an actual project and compile 15 times before getting it to work. For how long coreFx and netstandard have been around, this has been long overdue.

MikeYuMsft commented 4 years ago

Any update on this?

federicotomasi commented 4 years ago

Still relevant

garethj-msft commented 4 years ago

Without this feature, the c# repl is essentially just a toy for core developers, which is kind of a shame.

dmikov commented 4 years ago

Funny I was directed here from Microsoft site to upvote and there in no voting button. +1

StingyJack commented 4 years ago

@dmikov on the main post, click the smiley and the thumb up/down image

Postlagerkarte commented 4 years ago

Come on guys, it is kind of rude to let the community hang like this. Throw us an update!

qwertie commented 4 years ago

Doesn't anybody at Microsoft actually use C# Interactive? I'm not sure how to explain two years of inaction on this other than "nah, we all use LINQPad over here".

zzhu8192a commented 4 years ago

Yeah, this is quite inexcusable. It's a no-brainer feature, but I should really call the lack of support here a bug. We're having to use Jupyter notebooks with C# interactive so that we can import nuget dependencies for the project. That's just ridiculous :)

shaggygi commented 4 years ago

@terrajobst @KathleenDollard @kendrahavens @cartermp @jonsequitur @LadyNaggaga

If possible, could somebody on the team provide insight on the future of C# Interactive and related tooling for Visual Studio? It just seems like there has not been any love or clear explanation on roadmap (please forgive if I've overlooked).

For example, still looking for debugging with scripting, NuGet package, and .NET Core (partly with this issue) support.

Could someone offer some time during one of the YouTube sessions to provide an update?

Any updates will be appreciated.

jmarolf commented 4 years ago

@tmat was the fix for this ever merged?

tmat commented 4 years ago

We have added support for running Interactive Window on .NET Core in 16.8 Preview 1, which is a prerequisite for this feature. Next step would be to wire up the command in CPS based project system integration.

image

jeffska commented 3 years ago

We have added support for running Interactive Window on .NET Core in 16.8 Preview 1, which is a prerequisite for this feature. Next step would be to wire up the command in CPS based project system integration.

Is there any way to select the Core SDK version? Trying to use 5.0 preview/RC won't work as it uses 3.1 automatically.

Postlagerkarte commented 3 years ago

Can you throw us an update @tmat ?

tmat commented 3 years ago

We have no update at this point.

CCRcmcpe commented 3 years ago

Three years have passed and this feature still hasn't been added. Come on!

brainwipe commented 2 years ago

This is still a problem in Visual Studio 16.10, which is terrible.

gozargozarian commented 2 years ago

I tried to dig into this a little bit in hopes of providing a pull request. It seems like the issue originates in src/VisualStudio/Core/Def/Implementation/Interactive/AbstractResetInteractiveMenuCommand.cs in the method InitializeResetInteractiveFromProjectCommandAsync(). The code in here, line 19-22 only enables for ".NETFramework".

It also seems like there might be an issue in /src/VisualStudio/Core/Def/Interactive/VsResetInteractive.cs in method GetInteractiveHostPlatform(). It starts by looking at targetFrameworkMoniker for the words with .NETCore and Standard. This will fail in .Net 5 and 6 versions.

If I were to try and fix this, how does one go about setting up an environment to build and test with?

Regenhardt commented 2 years ago

@gozargozarian This has information on how to build and test: https://github.com/dotnet/roslyn/blob/main/docs/contributing/Building%2C%20Debugging%2C%20and%20Testing%20on%20Windows.md

Best of luck, hope you make it ;D

marknuzz commented 1 year ago

I'm confused as to why this hasn't had more priority. Is there another IDE which has better REPL support? Do people actually think the immediate window is good enough? What still needs to be done?

onionhammer commented 1 year ago

Yeah, .net interactive is kind of silly without this

CyrusNajmabadi commented 1 year ago

@marknuzz prs welcome :-)

onionhammer commented 1 year ago

@CyrusNajmabadi Is this a passion project? 😄

CyrusNajmabadi commented 1 year ago

Yes. And we support community members putting in effort to get things done that are normally on the backlog.

marknuzz commented 1 year ago

If this were actually a community-driven project, it would be reasonable to wait around for someone to fix this. But everyone on the list of top contributors is a paid Microsoft employee. It's reasonable as a community member to to ask why this hasn't been prioritized by said Microsoft employees before donating time into it. For all we know, there could be a replacement project in the works.

With many options for open source languages and toolchains these days, I hope you can understand the hesitance from myself and literally everyone else to give that kind of support to a project that has decided that the same community doesn't actually need a REPL. But it's worse than that, as this works for NetFx, so the implication is that this is actually a regression.

Additionally, this is the third most upvoted issue out of 8,213 open issues!

Where is Maria G? Or is Steve Ballmer managing this project?

Mattnificent commented 1 year ago

+1

voroninp commented 1 year ago

Meanwhile CSharpRepl tool supports referencing projects and solutions.

onionhammer commented 1 year ago

I guess this is nobody's job to implement/maintain this repo; it's a passion project from some devs so they do stuff they want when they're able?

Obviously most of us here also have jobs so if it's not your job to do this repo, you'll have to find someone very passionate about supporting someone else's repository to add support for this. Also, I'm quite familiar with the process of submitting PRs to Microsoft repos, there is absolutely no guarantee your work will ever be merged (or even glanced at), so PRs are definitely kept on the small side.

CyrusNajmabadi commented 1 year ago

I guess this is nobody's job to implement/maintain this repo; it's a passion project from some devs so they do stuff they want when they're able?

Currently, all devs on the team have multiple years worth of work on all of them with pressing product needs. Things not currently scheduled are in the backlog. This is currently one of those things. We'd def take a community contribution here if someone is interested in that! :-)

Also, I'm quite familiar with the process of submitting PRs to Microsoft repos, there is absolutely no guarantee your work will ever be merged (or even glanced at), so PRs are definitely kept on the small side.

We merge the majority of PRs contributed. It will be looked at, and it will be treated the same as any code PR anyone would make (so it would need to meet the expected level of code quality, testing, etc).

This is all we call promise though. As I said above, everyone in the team has their hands full with other critical things. But this is an open source project, and we have many contributors who contribute lots of fixes when they run into something that want that we don't have the resources to invest in ourselves at a particular time. If you're interested, we'd love to get a contribution from you. Thanks!

piju3 commented 5 months ago

Sorry but this should have been higher priority since the beginning. .NET Core has been the successor to .NET Framework for 7 years now. Having a way to get a proper REPL window so you can test your own code (or at least a NuGet package) is a fundamental feature.

CyrusNajmabadi commented 5 months ago

Sorry but this should have been higher priority since the beginning. .NET Core has been the successor to .NET Framework for 7 years now. Having a way to get a proper REPL window so you can test your own code (or at least a NuGet package) is a fundamental feature.

@piju3 see https://github.com/dotnet/roslyn/issues/26934#issuecomment-1656757498

StingyJack commented 5 months ago

or at least a NuGet package

@piju3 - there are multiple ways to install nuget packages available in VS. You used the REPL window for this?

RoslynPad or LinqPad may be things you find useful if you need a scratch pad to try something. Also there are other csharp scripting tools like Scripty! if you need something more integrated into the project system

Dreamescaper commented 4 months ago

@CyrusNajmabadi

Things not currently scheduled are in the backlog. This is currently one of those things.

I think the main question is why it is not prioritized, considering that it's a highly requested feature.

Regarding the feature itself, I can see that it kinda works by setting the project as a startup project, and then executing "Initialize Interactive with Project" in Feature Search. It is quite slow to init, as it loads a lot of reference assemblies, but it works fine after that.