VS~通过IIS网站启用"域名"调试

8/10/2015来源:ASP.NET技巧人气:4565

VS~通过IIS网站启用"域名"调试

在我们开发网站时,对某些信息进行序列化时,通常使用session,cookies,nosql等技术,而为了安全,我们在服务器上很多情况都做了防止盗链的设计,这给本机调试带来了不便,因为,本机都是以localhost:端口号来进行调试的,而网站上的资料一般是正式域名,这时,盗链启作用后,你在本机调试时将无法对它进行获取,在VS2012中,首次使用了"按域名调试"的方法,它给我们开发复杂网站带来了福音!

下面将安域名调试的方法总结一下

一 HOSTS文件中设置你的域名

127.0.0.1    dev.test.com

二 IIS中建立域名的网址,并将地址设为VS项目的地址

ip3dsz8lXczZRbv2z/g2FK877Tv8dPp9IMf+2Zz91cfeIJ4i7d4i7d4i3eUeE/m2NF493/ZvMlq87J5c7u58k7jPXvZvDPeJcRbvMVbvMVbvAce7/lmt/pdinea+fkpC8e7fM29Hu9ZuafT6T/86Oebj/f8e97rl93e8xZv8RZv8RbvUce7/1wLxHv+yjsb7/WEz115r5f7F+95z8b867/9+6zczQfWZj+64z4dl90N4i3e4i3e4i3eQ4535Xq6/rJ5nxfbt+bKe/aedzbe6wmfe8/7X//t3/t/2ryZ3ZW3eIu3eIu3eIeLd9rgPu95d8617e9533bulfP5eGfPBubjXTpjEG/xFm/xFm/xHnG8t+DKu1TQW19/3+pl89l73tPPTBLv+fe87zD3tncr3vPf8xZv8RZv8RZv8Y4V76zb/p5308vSlfcs3q0/0pIGvvVVsdnL5vNjWi+bi7d4i7d4i7d4R4/3QlfeW/Zp81m8WzH+13/7f2m85wc0f6Rlvdy3/gtrszHNe97r5U7e857Fe73Z4i3e4i3e4i3eo453/+v1xeLdXHmn8Z71eJbw9NNqG77yFm/xFm/xFm/xDhrvRV8235Z4z195z27Pv2zeKnf2Pe/me963XH/7qph4i7d4i7d4jyLee3ozH+8NzNURb/9jEvEWb/EWb/EW7z7x3rUgTYY3Npd4i7d4i7d4i7d4+1+Cird4i7d4i7d4i/dS4k2SJIeseJMkGUzxJkkymOJN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