.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

DisposableCOMProxy doesnt appear to release underlying DLL

Posted By:      Posted Date: September 22, 2010    Points: 0   Category :.NET Framework

Hello All,

I am writing a windows forms application (in C# targetting .NET v2 x86), that instanciates a COM object by its ProgID, calls a few methods on it to check its version , and then disposes it (with the dispose interface that the DisposeableCOMProxy provides). 

Based on the method calls to the COM object, my program will download and run an MSI that updates the dll that contains the COM object (should an update be required).  The MSI is set to remove previous versions, and all this happens automatically.

My problem is that the MSI shuts down my forms application because it claims that it still has a handle on the dll - the below is an excerpt from the msi verbose log:

MSI (s) (40:74) [14:38:06:141]: RESTART MANAGER: Will attempt to shut down and restart applications in no UI modes.
MSI (s) (40:74) [14:38:06:141]: RESTART MANAGER: Detected that application with id 3676, friendly name 'MyApp', of type RmUnknownApp and status 1 holds file[s] in use.

The MSI only contains one file, and thats the dll file that the DisposableCOMProxy used when i instanciated the COM Object with the progid.

Ive tried explicitly calling GC.Collect() and subsequently calling GC.WaitForPendingFinalizers()

None of this works!

How can I remove the "lock" on this file? is it even a lock?

Is this an issue

View Complete Post

More Related Resource Links

Editor's Note: A Large Release Wave is Headed your Way


This month Howard Dierking discusses the coverage of Windows Server 2008, SQL Server 2008, and Visual Studio 2008.

Howard Dierking

MSDN Magazine Launch 2008

The underlying connection was closed: An unexpected error occurred on a send.


I am consuming a third party web service wsdl using my .net aps.net page. And I am getting following error message. Cannt get to resolve it. Its working on my machine but not in my development machine. I have installed the certificate also in certificates on that machine. Can somone please help.?

Error -->  The underlying connection was closed: An unexpected error occurred on a send.





Can two columns have the same display names but different underlying names?


I have two columns which are set up differently. But for a display purpose and different usage, they should share the same display names but not the underlying name. How may I set them up in SharPoint?

Add Release-Only try-catch to CLR languages

Deploying a software, it's a common practice to encapsulate top-most function calls and/or event handlers with general try-catch blocks to deliver an error description to the user instead of just having him/her see the software exiting unexpectedly when unexpected exceptions occur. Unfortunately, during debugging it is most annoying to reach these log entries or message boxes instead of having Visual Studio halt where the exception occured. At the time of writing it is possible to designate particular exception types to halt the debugger when they are actually thrown. But it becomes a nuisance when there are many exception types to be marked this way. Plus, it becomes contra-productive if there is a scenario when expected exceptions of the marked types occur regularly and "Continue" has to be selected again and again in the debugger. Thus, I'd like to suggest to add a new, Microsoft specific, "try" keyword to all of the CLR languages (plus C++), perhaps something like "__try". This new kind of try should create a try-catch block only when compiling in Release mode. (This behaviour might apply to other configurations as well. I suppose the Configuration Settings dialog to provide an additional checkbox column to provide an option to select whether a particular configuration will create a try-catch block or not.)   See here for

System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a rec

Hello Guys,         I am getting following exception while web service (ASMX) is returning the response. <!-- [if gte mso 10]> <mce:style> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive.     <!-- [if gte mso 10]> <mce:style>                                                     InnterException (System.IO.Exception): "Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."       I think either the Asp.net web server is closing the connection or the response is too long.   Following is my simple code.    1)   namespace JFA.IndiePay.BusinessAccess { public class VerTexProcessor { public DataSet ProcessVerTexForBatch(DataSet dsInputRequest) { DataSet dsResponse = new DataSet(); //Call vertex web service here. VertexService.Service texCalculator = new VertexService.Service(); texCalculator.Timeout = 500000;

System.Transactions.TransactionManagerCommunicationException: Communication with the underlying tran

Hi there,I have an urgent issue at production.I hit the above mentioned exception when my application execute the line of System.Data.SqlClient.SqlBulkCopy.WriteToServer(DataTable table)I also see this message from web server event viewer: MSDTC encountered an error (HR=0x80004005) while attempting to establish a secure connection with system <SQL Server macchine name>.I have configure the MSDTC servive as below at both web server and sql server:- Enable Network DTC Access- Allow Inbound- Allow Outbound- Select Mutual Authentication RequiredFirewall service is not running at both servers.One thing very interesting, I have exactly the same setting for development environment, it works perfectly at development environment, but not production.Please help!Thank you very much.Regards,Fenny

The underlying connection was closed: An unexpected error occurred on a receive

Hi All,   i have developed a web application to call WCF service (which is hosted in IIS) from client application using .Net 1.1 it works fine.   but i got an error "The underlying connection was closed: An unexpected error occurred on a receive." when the return object is getting complex.   i analysis the issue with different level of object complexity and i found it get failed for following structure.   eg:   ObjectA - outer object that has some primitive data types and the list of ObjectB ObjectB - this also contain some primitive data and list of ObjectC.   Hope you can understand the hierarchy (complexity) of the return object. This works up to 2nd level of object hierarchy.   Does anyone have idea about the solution for this exception?   Thanks in Advance Shazvi

Exception: "The underlying connection was closed: The connection was closed unexpectedly." (sometime

I have a windows app connecting to a webservice.  In some situation(s) (haven't narrowed it down enough), I get the following exception: The underlying connection was closed: The connection was closed unexpectedly. When this exception is thrown, it is calling a method of a web reference. Now the situation that we experience this is on a laptop in the field that is using a WWAN connection in at least one location.  It works fine in the lab at the office.  Anyone have any ideas what could be causing this?

RFC: I want your FB on "RS Parameters Enhancements" for the next major release

Hello,RS product team is looking into doing some substantive work in the next release of Reporting Services, related to enhancing parameters. This could include changes to RDL, design tools like BIDS and RB, SOAP API's, Report Manager and SharePoint UI's, and of course the Report Server internals. Without making any commitments, I'll just lob a few "top of the list" features out there to prime the pump:Prompt localizabilityValidation (value ranges, defining invalid values, extensible validation through assemblies, etc.)Tree view of heirarchical parametersHistory and Execution snapshot parameter controlSelect All configuration -- yes or no, top or bottom, etc.Multivalue usabilityPLZ reply to this thread with your "wish list" for better RS parameters. I'd also very much like to see sample reports that use parameters in creative ways, especially if you had to do extra work to compensate for missing features or unexepected behaviors. I'll take all the FB, filter it through the list we already have, and hopefully come up with a list of features we can pull off in time for the next major release that meets as much of your needs as possible.Thanks for your consideration, and regards.Mike

Task doesnt have the approve button

Finally I was able to start runing my workflow, it starts ok, and then it generates a task, but when I go to the task, it doesnt have the Approve or Reject buttons, What am I missing? www.sharepoint2010blogger.com Follow me on Twitter <<<

VS2010 Web App does not build Release - Could not load AjaxControlToolkit error

I have a VS2010 Web Application that uses the AjaxControlToolkit. I am able to build the Debug configuration. When I build the release configuration I get the following error message: Error 89 Could not load file or assembly 'file:///S:\My Code\Libraries\ACT\May 2010\AjaxControlToolkit.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) S:\My Code\EZFishing\EZFishing\EZFishing\SGEN EZFishing The location of the file is correct, and I just downloaded and unzipped there the Ajax CT. I have always built this app correctly before upgrading to VS2010 and ACT May 2010. Any idea of what is going on? Thank you in advance for your help. Mauro  

<%=%> doesnt working if script is in seperate js file.

var a =document.getElementById("<%= TextBoxId1.ClientID %>")this code soesnt working on a seperate javascript file (ofsure linked to aspx file)but works if javascript embedded in aspxwhat if my javascript code is not in aspx ?how can I access autonamed IDs like this ? any idea ?(thank you before any anwer).

change URL using javascript, but URL doesnt change

I want to redirect a user to an url after he clicks a checkbox using javascript.I succeed at doing that using this code:<input id="partylocation" type="checkbox" onclick="javascript:location.href='www.domain.com/?q=party';" />HOWEVER: the URL remains the same! I need the URL to change accoding to the new domain.I also tried:<input id="partylocation" type="checkbox" onclick="javascript:window.location='www.domain.com/?q=party';" />

Dataflow resetting ID from underlying sources,transformations and destinations

Good afternoon, I have multiple packages with multiple dataflow tasks. The dataflow tasks and it's underlying transformations are copied. Now these underlying transformations have the same ID (numeric, NO GUID). In my logging framework I have a problem getting these tasks recognised. Is there anyway to reset the the transformations ID? maybe programmaticly? I looked how I could get the currenct package object in a script component but this did not worked out for me. I'm looking for something like reset GUID's in BIDS helper but then for the numeric ID's of transformations. Any help is appreciated, Ivo

Release a public program - read me/warranty

Do i need to include a read me or anything like this? ( i copied this...) This program is provided as-is without any warranty, implied or otherwise. By using this program, the end user agrees to take full responsibility regarding its proper and lawful use. The authors/hosts/distributors cannot be held responsible for any damage resulting in the use of this program, nor can they be held accountable for the manner in which it is used. I wouldn't be blamed if something happened to someones computer if i include this, right?

SharePoint workflow Enable WorkflowModification doesnt work

Hi   I'm trying to enable WorkflowModification in a sequential workflow in VS Studio 2008 according to the *** of examples of microsoft but When I run my workflow I get this error: 09/14/2010 10:24:35.78  w3wp.exe (0x11FC)                        0x13A8 Windows SharePoint Services    Workflow Infrastructure        88xr Unexpected WinWF Internal Error, terminating workflow Id# 74f4bd77-7aaa-407e-90ac-f56a6184bc21  09/14/2010 10:24:35.78  w3wp.exe (0x11FC)                        0x13A8 Windows SharePoint Services    Workflow Infrastructure        98d4 Unexpected System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.SharePoint.SPException: Error in the application.     at Microsoft.SharePoint.Workflow.SPWinOEWSSService.EnableWorkflowModification(Guid modificationId, String contextData)     --- End of inner exception stack trace ---     at System.RuntimeMethodHandle._InvokeMe

Sharepoint 2010 WorkFlow Task AssignedTo Windows Group doesnt send email notification

Hi, Which configuration would prevent sharepoint to send a notification when a workFlow task is assigned to a Windows Group with an email ? The same task with a single User send a notification. Thanks, Patrice      
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend