Immediate Window unexpected behavior when using .NET 5.0

CSharpRox 0 Reputation points

This is about Visual Studio 2022 Community edition. I have been heavily using Immediate Window for debugging a DLL during design time, and it works great for .net framework 4.8.x (in fact I've used Immediate Window for many years with no problem). However, recently when I created a project/solution to use .NET 5.0, I started getting a popup window telling me that "A project with an Output Type of Class Library cannot be started directly" and it no longer works like it used to. Is there a fix for this problem? For now I have created a dummy calling app project and set it to startup project for temporary workaround (still with a lot of issues), but it takes significant amount of additional time to compile the blank GUI of that dummy project which is of absolutely no use to me, I rather not waste so much compiling time every time I have to make a small change, I have over 140 new DLL calls to implement). Please help if you have any knowledge on this issue or if you know a fix for it!

(I tried on two different computers, both show the same issue; I also tried .NET 1.0 all the way to .NET 6.0, all of them show the same issue, but when using any of the .net framework 4.x.x, Immediate Window works fine).

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,119 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Anna Xiu-MSFT 20,656 Reputation points Microsoft Vendor

    Hi @CSharpRox

    Welcome to Microsoft Q&A! 

    I tested on my side and could reproduce your issue. 

    Please directly report the issue to product team by selecting “Help” menu > Send Feedback > Report a Problem



    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments