I want to read "script1.js" by filestream in my console application like below. But it returns to me an error. Is there any better way to read a js file in application, by using filestream it returns to me error: FileNotFound exception.
How can i access a js file in my project?
153 Views Asked by Penguen At
3
As your
FileReader
is reading from your build destination not your project destination, it will not find the file (Look at that path it tires to read from, it is.\bin\Debug\script1.js
, where your file will be at.\script1.js
)The easiest fix is to change build action for your script file in its properties, and set
Copy To Output Directory = Copy Always