Issue
I'm still pretty new to Visual Studio and am having an issue with html and css files not saving.
I have basically written a simple website to act as an instructions document for the webforms app I am building.
I have added the website to the "Resources" section of the solution explorer, and my app is happily calling up the webpage.
However, when I need to edit the website, I open the file in Visual Studio and make my code changes. But the changes I make to the html or css are not saved on file.
For example, I open up index.html in Visual Studio and make a change to the code and save it and then close the file in Visual Studio. If I open it up again, my changes are reflected in the code editor.
However, when I run the app and launch the website from within it, the changes are not reflected.
Also, if I check the .html file on file, or open the file direct from Windows Explorer, the changes are not in there either.
So although the changes show in Visual Studio the actual files do not appear to change.
Is this standard behaviour in Visual Studio or am I overlooking something?
Many thanks in advance.
Cheers
Steve
Solution
I have got this solved now.
Solution was as follows:
- Create a new folder in Solution Explorer in Visual Studio.
- In Windows Explorer, copy my html files and other resources to the folder.
- In Visual Studio Solution Explorer, click the Show All Files button.
- The newly copied files will show in folder. Highlight all the files, right click and choose "Include in project".
- To make sure the folder is accessible at runtime when debugging, with the files still highlighted, in the Properties window, choose "Copy Always" for the "Copy to Output Directory" property.
Now any changes I make to the files in Visual Studio, the changes are reflected in the files on the file system, and vice-versa.
Thanks Steve
Answered By - welshsteve147
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.