❔ Running a small part of a forms project?
I'm writing a windows forms app. Within in I have a small piece of logic that I will use but which doesnt actually display anything or interact with the rest of the project. Like a utility function.
I want to try it out and see if it works how I want. But I don't want to use it in Program.cs (which already has lots going on) and build the entire project. If I were using Python or Javascript, I would import just the module I need in a REPL and play with it. How do I do something like this in C# without creating a whole new project for the code I want to see running?
5 Replies
I'd rip it out and put it in a new project and call it in the forms project. Additionally, I'd create a Test project for it.
if I really needed to play around with it in a vacuum, I'd capture the *.dll in LINQPad
you can use C# interactive in Visual Studio to get a REPL
Views > Other Windows > C# Interactive
then right click your project, and select “Initialize Interactive with Project”
if it isn’t there then you will need to do something a little different
but if it is there, then you can use your classes freely from the interactive window
wasn't that not updated for Core yet?
or did I just miss that being done
The version of visual studio im using has it, very cool, thanks!
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.