是否有可能使用Microsoft Fakes隔离/替换类的构造函数?
在为Mole(Fakes的前身)找到了一个例子:http://thecurlybrace.blogspot.co.at/2011/11/how-do-i-detour-mole-type-constructor.html
我试过像这样的结构
ShimStreamReader.Constructor = @this => ShimStreamReader.ConstructorString(@this, "Test");
Run Code Online (Sandbox Code Playgroud)
但它说缺少get访问器.为了澄清它,更换类似的东西会很好
new StreamReader("filename")
Run Code Online (Sandbox Code Playgroud)
像这样的静态输入
new StreamReader(new MemoryStream(Encoding.Default.GetBytes("33\r\n1\r\n16\r\n5\r\n7")))
Run Code Online (Sandbox Code Playgroud)
所以我不必模拟Read,ReadLine等.
IIS Express在哪个目录中存储我的站点DLL和其他资源?
我检查了<site>我的部分,%USERPROFILE%\Documents\IISExpress\applicationhost.config它看起来像这样:
<site name="WebSite1" id="1" serverAutoStart="true">
<application path="/">
<virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%\WebSite1" />
</application>
<bindings>
<binding protocol="http" bindingInformation=":8080:localhost" />
</bindings>
</site>
Run Code Online (Sandbox Code Playgroud)
物理路径设置为%IIS_SITES_HOME%\WebSite1指向%USERPROFILE%\Documents\My Web Sites,但在这个目录中,目前只有默认文件一样iistart.htm,iis.png和其他垃圾.
我的网站运行localhost:58620,但我没有网站配置applicationhost.config.
我从Visual Studio 2015启动IIS Express.
那么我网站的物理目录在哪里localhost:58620?谢谢.
我无法拦截Chrome version 73.0.3683.86对我的 localhost 站点发出的请求。
http://127.0.0.3:80127.0.0.1:8080当拦截打开并且我在Chrome浏览器中重新加载页面时,Burp 没有“捕获”任何请求,我的本地站点加载并且只拦截外部请求,例如从 CDN 加载外部脚本。
同样在“代理”>“HTTP 历史记录”下,只有对外部站点的请求,http://127.0.0.3:80而不会记录所有对外部站点的请求。
当我通过 重新加载同一页面时Internet Explorer 11,初始GET请求被 Burp 拦截,正如预期的那样。此外,“代理”>“HTTP 历史记录”显示对本地站点的所有请求http://127.0.0.3:80
有什么问题Chrome?谢谢!
我在域上的 IIS 8.5 中获得了 .NET 4.5 WCF 服务https://mydomain,并在 IIS 中配置了 https 绑定和自签名证书。
我可以在浏览器中访问我的服务的配置页面 https://mydomain/FileService.svc
当我尝试POST使用 SoapUI将一些数据发送到服务到端点时https://mydomain/FileService.svc/receiveRequest,我回来了HTTP/1.1 404 Not Found
我的 web.config 服务配置如下所示:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<!-- maxReceivedMessageSize = 1073741824 = 1 GB -->
<binding maxReceivedMessageSize="1073741824" maxBufferSize="1073741824" maxBufferPoolSize="1073741824" >
<security mode="None"></security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpBinding" scheme="http" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<services>
<service name="Foo.FileService">
<endpoint contract="IFileService" binding="basicHttpBinding"></endpoint>
</service> …Run Code Online (Sandbox Code Playgroud) c# ×2
asp.net ×1
burp ×1
iis ×1
iis-express ×1
localhost ×1
mercurial ×1
soap ×1
tortoisehg ×1
unit-testing ×1
wcf ×1
web-services ×1