-1

Beginner here in c# using Visual Studio. I've been trying to run a loop, but it keeps giving me Warning MSB3026. I'm not sure why, here's the code,

Console.WriteLine("Would you like to play: Y/N");
do
{
    if (Console.ReadLine() == "y")
    {
        Console.WriteLine("Good");
    }
} while (Console.ReadLine() == "N");
            

I've had a similar issue before, and usually, I just use task manager and close visual studio to eliminate any background tasks that are getting in the way of what I'm trying to do. However, in this case, no background tasks are running. I was wondering how to fix the warning, and how to get the code to work.

DerStarkeBaer
  • 669
  • 8
  • 28
Tom Catt
  • 13
  • 2
  • Is this similar? https://stackoverflow.com/questions/15689353/visual-studio-2012-warning-msb3026-could-not-copy-dll-files – Ghost Jun 21 '20 at 22:48
  • Does this answer your question? [Visual Studio 2012 warning MSB3026: Could not copy DLL files](https://stackoverflow.com/questions/15689353/visual-studio-2012-warning-msb3026-could-not-copy-dll-files) – pinkfloydx33 Jun 21 '20 at 23:31

2 Answers2

0

If I'm correct its an issue with one version of Visual studio (correct me if I'm wrong).

The code is totally okay, and it works for me flawlessly. You can either update visual studio to 2017 and higher or you can try disabling the warning (it won't fix the code if it's not running tho).

To disable warning use #pragma warning disable 3026

To restore warning use #pragma warning restore 3026

大陸北方網友
  • 3,696
  • 3
  • 12
  • 37
tomatoj
  • 32
  • 1
0

Nothing wrong with your code! Try updating VS. To update VS click Help at top of screen and select "Check for Updates"

teslae
  • 239
  • 1
  • 5