C# 根据使用DI的环境更改视图中的css路径

C# 根据使用DI的环境更改视图中的css路径,c#,asp.net-mvc-4,C#,Asp.net Mvc 4,我使用一个外部服务器来托管我的css/js文件,我没有使用MVC的绑定 我需要根据环境(dev/prepod/prod)切换到css文件的绝对路径 根路径在注入的配置节中定义 从我的视图访问我的配置文件的最佳方式是什么?@System.Configuration.ConfigurationManager.AppSettings[“myKey”] <link rel="stylesheet" type="text/css" href="http://localhost/main.css"

我使用一个外部服务器来托管我的css/js文件,我没有使用MVC的绑定

我需要根据环境(dev/prepod/prod)切换到css文件的绝对路径


根路径在注入的配置节中定义


从我的视图访问我的配置文件的最佳方式是什么?

@System.Configuration.ConfigurationManager.AppSettings[“myKey”]

<link rel="stylesheet" type="text/css" href="http://localhost/main.css")">

<link rel="stylesheet" type="text/css" href="http://mystaticserver.com/main.css")">