Question

I have some text files (and others) that I want to be hidden from the public when deploying an ASP.net project. How do I do that? (And what's the technical term for that? "hidden"? Searching, I couldn't find an answer to this so I'm probably using the wrong term.)

Also, if you know of a way to specify not to upload certain files when publishing - I'd like to hear it. (I know I can do that by excluding them from the project, but I rather they stay included because I use them while debugging on localhost.)

Was it helpful?

Solution

You can put them in the App_Data folder in your project that is available on the webserver via the file system or your application but not accessible from the internets.

OTHER TIPS

I suppose if you want the files to be included, but not reachable via web request, you could look at the IIS redirect module. As for not uploading a file at all, simply select the item in the solution explorer, right-click and select properties (or press F4), and change the build action to none. Files should only be included in a deployment if you choose content.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top