我正在使用.NET 4.0的ASP.NET Web API客户端库(Microsoft.AspNet.WebApi.Client版本4.0.30506.0).
我需要发送一个带有请求体的HTTP DELETE.我把它编码如下:
using (var client = new HttpClient())
{
client.BaseAddress = Uri;
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
// I would normally use httpClient.DeleteAsync but I can't because I need to set content on the request.
// For this reason I use httpClient.SendAsync where I can both specify the HTTP DELETE with a request body.
var request = new HttpRequestMessage(HttpMethod.Delete, string.Format("myresource/{0}", sessionId))
{
var data = new Dictionary<string, object> {{"some-key", "some-value"}};
Content = new ObjectContent<IDictionary<string, object>>(data, new JsonMediaTypeFormatter())
}; …
Run Code Online (Sandbox Code Playgroud) 我致力于将企业库程序集注册到全局程序集缓存(GAC)中.我正在使用我用自己的密钥签名的企业库5.0版,我在许多.NET 4.0应用程序中使用程序集.
成功将企业库程序集注册到GAC后,应用程序以此消息开始:
无法解析类型"Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter,Microsoft.Practices.EnterpriseLibrary.ExceptionHandling".请验证拼写是否正确或是否提供了完整的类型名称.
当我从GAC取消注册企业库程序集时,应用程序将返回到正常操作条件.
企业库程序集注册到GAC时导致应用程序失败的原因是什么?
我正在一个我们不时遇到与Oracle连接相关的生产问题的环境中工作.我们使用ASP.NET应用程序中的ODP.NET,我们怀疑防火墙会关闭连接池中的连接太长时间.
有时我们会收到"ORA-12571:TNS数据包写入失败"错误,有时我们会收到"ORA-03135:连接失去联系".
我想知道是否有人遇到这个和/或了解2个错误之间的区别.
在过去的几周里,我一直在成功运行MSDEPLOY命令,直到昨天(至少在我第一次意识到部署脚本失败的时候).我昨天在构建服务器上安装了Visual Studio 2010 Service Pack 1来修复与web.config转换相关的问题,我从该服务器运行MSDEPLOY脚本以安装在远程服务器上(运行Windows Server 2008 R2 IIS 7.5) .
我加强了MSDEPLOY命令以进行详细操作并得到以下跟踪:
-------------------------------------------------------
Start executing msdeploy.exe
-------------------------------------------------------
"C:\Program Files\IIS\Microsoft Web Deploy\msdeploy.exe" -source:package='E:\Staging\ChildSupportWebsite.Beta1\Release\_PublishedWebsites\Csws.UI_Package\Csws.UI.zip' -dest:auto,computerName='HFSWP121-03720',userName='DOMAIN\USERNAME',password='PASSWORD',includeAcls='False',tempAgent='true' -verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension -setParamFile:"E:\Staging\ChildSupportWebsite.Beta1\sit.Csws.UI.SetParameters.xml" -skip:Directory="Csws\\Participant" -skip:objectName=filePath,absolutePath="bin\\.*.xml|pdb" -whatif -verbose
Verbose: Using ID '557f88cc-6194-41fb-84b0-6895fe8bc47d' for connections to the remote server.
Verbose: Creating temporary directory '\\HFSWP121-03720\C$\Windows\TEMP\MSDEPLOY\557f88cc-6194-41fb-84b0-6895fe8bc47d' on remote target.
Verbose: Copying temporary agent file C:\Program Files\IIS\Microsoft Web Deploy\Microsoft.Web.Delegation.dll to \\HFSWP121-03720\C$\Windows\TEMP\MSDEPLOY\557f88cc-6194-41fb-84b0-6895fe8bc47d\Microsoft.Web.Delegation.dll.
Verbose: Copying temporary agent file C:\Program Files\IIS\Microsoft Web Deploy\Microsoft.Web.Deployment.dll to \\HFSWP121-03720\C$\Windows\TEMP\MSDEPLOY\557f88cc-6194-41fb-84b0-6895fe8bc47d\Microsoft.Web.Deployment.dll.
Verbose: Copying temporary agent file C:\Program Files\IIS\Microsoft …
Run Code Online (Sandbox Code Playgroud)