question

JohnBigboot-4808 avatar image
0 Votes"
JohnBigboot-4808 asked cooldadtx answered

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

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





vs-general
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

cooldadtx avatar image
0 Votes"
cooldadtx answered

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.