简体   繁体   中英

How to access bin/Debug (ConsoleApp) from WebApp?

Currently, I'm building a web application. Inside my solution, I have two project, the WebApp itself and a ConsoleApp . I pass a string from a View (WebApp) to the ConsoleApp to be processed. In the ConsoleApp, it requires to access the bin/Debug folder. I place folder stanford-corenlp-full-2015-12-09 inside the bin/Debug and write it in a code:

...
var jarRoot = @"stanford-corenlp-full-2015-12-09\stanford-corenlp-full-2015-12-09\models";
...

I got an error

 Could not find a part of the path 'C:\Program Files\IIS Express\stanford-corenlp-full-2015-12-09\stanford-corenlp-full-2015-12-09\models'. 

What's wrong with it? How am I supposed to do to access inside the bin/Debug directory from WebApp?

The web page is not running from that exact location as in Windows forms... It uses the IIS location instead , you need to use server.mappath("folder2find") method in order to find ur folder

Check this for more details

https://msdn.microsoft.com/en-us/library/ms524632(v=vs.90).aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM