Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
根据发布位置确定javascript/css域_Javascript_Html_Visual Studio - Fatal编程技术网

根据发布位置确定javascript/css域

根据发布位置确定javascript/css域,javascript,html,visual-studio,Javascript,Html,Visual Studio,我在Visual Studio 2013中创建了一个解决方案,其中包括两个web应用程序项目Core.web和App.webCore.Web使用urlWeb.Core.devApp.Web使用urlWeb.App.dev Core.Web包含几个可以在项目之间共享的javascript和css文件App.Web引用这些javascript文件App.Web可能有一个html文件,如 <!DOCTYPE html> <html xmlns="http://www.w3.org/1

我在Visual Studio 2013中创建了一个解决方案,其中包括两个web应用程序项目
Core.web
App.web
Core.Web
使用url
Web.Core.dev
App.Web
使用url
Web.App.dev

Core.Web
包含几个可以在项目之间共享的javascript和css文件
App.Web
引用这些javascript文件
App.Web
可能有一个html文件,如

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>App1.Web</title>
    <!-- core javascript -->
    <script src="//web.core.dev/Javascript/Common.js" type="text/javascript"></script>
    <script src="//web.core.dev/Javascript/Ticker.js" type="text/javascript"></script>    
    <!-- local javascript -->
    <script src="index.js" type="text/javascript"></script>
    <!-- core css -->
    <link href="//web.core.dev/Style/Reset.css" rel="stylesheet" type="text/css" />
    <link href="//web.core.dev/Style/Global.css" rel="stylesheet" type="text/css" />
    <!-- local css -->
    <link href="index.css" rel="stylesheet" type="text/css" />
</head>
<body>
    ...
</body>
</html>

App1.Web
...
这在当地很管用。但当我开始发布live时,除非我手动更改这些链接(
web.core.dev
更改为
core.mywebsite.com
)。我希望能够发布该项目,而不必担心将本地HREF更改为实时HREF


是否有一个标准策略允许根据域的发布位置更改域?一种适用于
.aspx
.html
文件的策略?

您可以使用web.config中的AppSettings并将配置文件转换为您的构建配置文件。@TryingToImprove这对aspx页面有效,但您能否建议如何适用于普通html文件?这不仅是.NET应用程序的常见问题,因此必须有一个标准的解决方案?