Strange VS2010 script documents behavior

Posted on 2011-10-24
Last Modified: 2012-05-12
Dear Experts,

I came across this very strange VS2010 problem. Let there be two web applications in one solution. Let them have a javascript file with a same name. No matter what webapplication I start, the script documents section grabs the javascript file from the project that has been added to the solution later.

I created a simple solution. You can download it from here.WebApplication1 is added to the solution later. WebApplication5 is set up as a start project. Start the project, it loads as expected, the browser loads the javascript from WebApplication5. But if you go to Visual Studio, Script Documents, and double click on JScript1.js then you notice it is from WebApplication1.

This is a serious problem, because it eg. ruins debug. Is this a known bug, or what? Any workaround to fix this?
Question by:develc
    LVL 96

    Expert Comment

    by:Bob Learned
    I can try your example, but my first question is, "Do you have SP1 installed?"
    LVL 1

    Author Comment

    Yes, I have
    LVL 96

    Accepted Solution

    You are using two web applications that are at the same level in the file structure, but using a relative path:  Scripts/JScript1.js.  How would you think that it would distiguish which folder to use?  Did you think about setting the applications at different levels, like http://localhost:57042/WebApplication1 and http://localhost:57031/WebApplication5, so that the relative paths would be pointing to different folders?
    LVL 1

    Author Comment

    Thanks, that solved it.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Suggested Solutions

    We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
    Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
    The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now