How do I configure the root directory for a Visual Studio 15 oe 2017 project?

John Bigbooté 21 Reputation points
2021-08-20T16:37:07.89+00:00

I'm trying to set up the WebGoat.Net project from Github https://github.com/jerryhoff/WebGoat.NET

When I attempt to populate the database it fails with the following error.

Additional information: Could not find a part of the path 'C:\Program Files (x86)\IIS Express\DB_Scripts create_webgoatcoins.sql'.

The error is accurate as DB_Scripts is under the Application folder ...\WebGoat.NET\WebGoat\DB_Scripts.

If I move DB_Scripts and change the permissions it seems to work OK but that seems like a hack.

Any clues on how I can configure this in either or both of these versions?

Thanks

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

Accepted answer
  1. Michael Taylor 51,346 Reputation points
    2021-08-20T17:38:22.833+00:00

    It looks to me like the code is using a relative path to find the scripts and therefore it is wrong. Taking a look at where it is actually failing it is in MySqlDbProvider (or the sqlite version if you're using that). In both of these it is relying on the client settings being properly set early on. The rebuild process ultimately calls Util.RunProcessWithInput which uses the Settings.RootDir as the default path. The command must be relative to that. It appears in your case that the root dir isn't getting set properly during startup.

    This code is really old and probably out of date. Personally if I were you I'd just fix up the code to get it to do what you want as all this indirection is just making it hard to read and use. It probably isn't worth trying to debug this aspect of the code.

    0 comments No comments

0 additional answers

Sort by: Most helpful