更改项目 URL Visual Studio [英] Change Project URL Visual Studio

查看:20
本文介绍了更改项目 URL Visual Studio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够在本地主机以外的域以及任何子域上调试我的 ASP.NET MVC 应用程序,换句话说:

在我的主机文件中包含以下内容:

127.0.0.1 jam.net127.0.0.1 www.jam.net

以及我的 applicationhost.config 文件中的以下内容:

<站点名称="JBN.Site" id="2"><应用程序路径="/" applicationPool="Clr4IntegratedAppPool"><virtualDirectory path="/" physicalPath="C:DevJamshoppingcartsrcWebJBN.Site"/></应用程序><绑定><binding protocol="http" bindingInformation="*:49707:"/><binding protocol="http" bindingInformation="*:49707:localhost"/></绑定></网站>

记住以管理员身份运行您的 Visual Studio 2015 实例!如果您不想每次我都推荐这样做:

默认情况下如何以管理员身份运行 Visual Studio

我希望这对某人有所帮助,我在尝试升级到 Visual Studio 2015 时遇到了问题,并意识到我的任何配置都没有被结转.

I would like to be able to debug my ASP.NET MVC application on a domain other than localhost as well as any subdomains, in other words:

http://domain.dev http://*.domain.dev

I have tried the following:

  1. Modify the Hosts file
  2. Add a Host record for *.domain.dev that returns 127.0.0.1
  3. Change the 'Project Url' in the project properties.

However, nothing is working. When I start to debug I get a page that either says "Service Unavailable" or "Invalid URL".

What am I missing?

p.s. I am using Visual Studio 2013

解决方案

For Visual Studio 2015 the steps in the above answers apply but the applicationhost.config file is in a new location. in your "solution" folder follow the path

.vsconfig

Within that folder you will see your applicationhost.config file

Alternatively you could just search your solution folder for the .config file and find it that way.

I personally used the following configuration:

With the following in my hosts file:

127.0.0.1       jam.net
127.0.0.1       www.jam.net

And the following in my applicationhost.config file:

<site name="JBN.Site" id="2">
    <application path="/" applicationPool="Clr4IntegratedAppPool">
        <virtualDirectory path="/" physicalPath="C:DevJamshoppingcartsrcWebJBN.Site" />
    </application>
    <bindings>
        <binding protocol="http" bindingInformation="*:49707:" />
            <binding protocol="http" bindingInformation="*:49707:localhost" /> 
    </bindings>
</site>

Remember to run your instance of visual studio 2015 as an administrator! If you don't want to do this every time I recomend this:

How to Run Visual Studio as Administrator by default

I hope this helps somebody, I had issues when trying to upgrade to visual studio 2015 and realized that none of my configurations were being carried over.

这篇关于更改项目 URL Visual Studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆