6

I've been using the Publish Wizard in VS2010 to deploy my MVC app and I've got no issues there but intermittently the publish will fail with the following error.

Error 23 Web deployment task failed.(Could not complete the request to remote agent URL 'https://webserver:8172/msdeploy.axd?site=mysite'.)

Could not complete the request to remote agent URL 'https://webserver:8172/msdeploy.axd?site=mysite'. The request was aborted: The request was canceled. COM object that has been separated from its underlying RCW cannot be used.

It seems to happen at random but the longer I have VS open the more likely it is to occur and the guaranteed way to fix it is to restart VS but it occurs like clockwork if I leave VS open for prolonged periods of time (all day or overnight) and is starting to get very frustrating to have to restart VS every time it happens. I honestly don't recall if the error number is always 23 or not, I'll look for that next time it happens, but has anyone else had this problem or know what might be causing it?

Update: The problem is still present when using VS2012 as well.

Nick Albrecht
  • 15,828
  • 8
  • 64
  • 95

2 Answers2

11

We discovered this bug shortly after finalizing the RTW components for web publishing. To give you a bit of background, the underlying issue was very difficult for us to uncover. After some through investigation we were able to pinpoint the issue to being related to how internet connections are managed by the singleton RCW object used by WPF and whether requests are coming in on an STA or MTA thread.

Fortunately we were able to workaround the underlying issue and have a fix ready. We are planning to update the web publishing bits in a few months which should resolve this issue once and for all. Until then the workaround is to close VS and then re-open it. I know that this is not an ideal workaround, but that is the best that we can do at this time.

Sayed Ibrahim Hashimi
  • 42,483
  • 14
  • 139
  • 172
  • Thank you very much for looking into this and posting your findings, I really appreciate it. I look forward to trying out the updated Web Publishing bits! – Nick Albrecht Sep 12 '12 at 22:22
  • Is this fixed in VS2012 Update 1? – Jack Ukleja Dec 04 '12 at 00:04
  • The fix is available in the Azure SDK http://www.windowsazure.com/en-us/develop/net/ – Sayed Ibrahim Hashimi Dec 04 '12 at 02:18
  • I just got the same error so I would say it's NOT included in VS2012 Update 1, which to be honest strikes me as odd. I don't do any Azure development, Do I still have to install the Azure SDK just to get this fix? – Nick Albrecht Dec 04 '12 at 23:17
  • Sorry the fix is only available through the Azure SDK. We've heard some feedback from others as well about this. The reason why its in the Azure SDK currently is that standing up a dedicated feed for this would be very costly (i.e. we couldn't ship other features due to working on this). The best thing to do here would be to create a suggestion on http://aspnet.uservoice.com and have it voted up. – Sayed Ibrahim Hashimi Dec 05 '12 at 00:05
0

According to http://www.asp.net/mvc/tutorials/deployment/deployment-to-a-hosting-provider/deployment-to-a-hosting-provider-creating-and-installing-deployment-packages-12-of-12

"COM object that has been separated from its underlying RCW cannot be used." Scenario You have been successfully using one-click publish to deploy your application and then you start getting this error:

Web deployment task failed. (Could not complete the request to remote agent URL 'https://serverurl.com/msdeploy.axd?site=sitename'.) Could not complete the request to remote agent URL 'https://url/msdeploy.axd?site=sitename'. The request was aborted: The request was canceled. COM object that has been separated from its underlying RCW cannot be used.

the solution is:

Possible Cause and Solution Closing and restarting Visual Studio is usually all that is required to resolve this error.

Roger
  • 909
  • 2
  • 10
  • 17
  • That's not a solution, it's a workaround. That's like telling some one every time their internet goes down they have to reboot their cable modem. I am looking for something that can explain why it happens and how to prevent it from happening. I have also gotten the error in Visual Studio 2012 so it's not something they've fixed yet. – Nick Albrecht Aug 21 '12 at 18:39
  • @Yarx yes I agree it is not a solution. But by restarting people can continue working. – Roger Aug 22 '12 at 07:00
  • True, but I already stated in the question that restarting Visual Studio fixes the problem, I'm looking for feedback on what caused it so I can prevent it from happening. – Nick Albrecht Aug 22 '12 at 17:30
  • If it helps debugging, - everything was working fine for me for a long time deploying to subdomain: subdomain.awesam.net - Then in the publish window I changed the site to awesam.net and published it. - Then in the publish window I changed it back to subdomain.awesam.net and it stopped working. I have not been able to reproduce. – saml Sep 27 '12 at 19:04