Menol
Menol

Reputation: 1348

Can I "lock" code files in Visual Studio to avoid accidents (NOT source control locking)

I have a lot of common JavaScipt code in the solution that works hand in hand with the rest of the solution. Most of the time I open these files, just to see their API (function signature, etc.) to call them from somewhere else in the solution.

As you know, IntelliSense doesn't do much for JavaScript, so I have to open the file to see the API and IntelliSense doesn't complain if I accidentally edit and break JavaScript code.

I have many times accidentally edited or pasted random code into such Javascript files, and I wouldn't realize the problem until the thing raises an error. There were times where the errors were so ambiguous and unclear I had to spend hours before finding the accident. The common JavaScript code is the last thing I'd look in for errors as they have been working error-free for long.

Is there a way to somehow "lock" (or make "read-only") source files in Visual Studio?

Please note this is not related to source control.

Upvotes: 3

Views: 3405

Answers (1)

user2463711
user2463711

Reputation:

You can set write protection in the Windows file system for the files you want to protect. Then you are not able to save something via Visual Studio to these files.

Upvotes: 3

Related Questions