Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
410 views
in Technique[技术] by (71.8m points)

asp.net - Visual Studio Development Server not updating css and javascript?

I've recently returned to a web site project that has been on the backburner. Since recommencing work I've noticed css and javascript changes aren't being recognised by the application when it's running in Visual Studio Development Server. This previously worked fine. I could change stylesheets and javascript and run the app and test. Now the only way I can test the application is to publish it to my local IIS server (though I believe restarting my pc also fixes the problem).

Using Visual Studio 2008 (9.0.30729.1)

The things that have changed since I am certain it was working correctly is the operating system, from Vista x64 Home Premium Edition to Win 7 x64 Ultimate and I've moved the project source from c: to d:. Though I moved back to C: with the same negative results. I've also moved some functionality out in seperate WCF services, hosted by console apps (two service hosts) which are put into debug when the web site starts up in debug.

Stopping the dev server does nothing. Checking out (using VSS 2005) ALL the files to ensure nothing is read only does nothing. The only thing that works is publishing to IIS or restarting my machine. Both undesirable. I'll even be satisfied if there's a process I need to terminate each time I stop debugging, to ensure not using previous copies of things.

Any solutions?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The server may be sending headers to the browser that cause it to keep using cached copies. The simple way to test this is to empty your browser cache.

If that fixes it, you need to study the HTTP headers you get from the server. The developer tools (a.k.a. F12 tools) in your browser of choice will expose the headers returned by the server. Then decide if you want to keep using these caching settings (good for speed) or change them (good for development).

And how do you adjust these headers, you ask? It depends on the server. Here is a link to the instructions for common servers:


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...