.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

COM Server process compiled with /clr option doesn't unload itself from memory when last COM client

Posted By:      Posted Date: September 11, 2010    Points: 0   Category :.NET Framework
I created Visual C++ ATL project in VS2010, exe type, imlemented COM object, then added /clr option to project. Project uses other C# dlls (WCF service). When last COM client disconnects and last COM object instance destroys, WCF service stopped, my COM server process doesn't unload itself from memory. All managed threads in C# dll are background, COM object doesn't create threads. How can I unload server process? Thank you in advance. 

View Complete Post

More Related Resource Links

C# COM Client to Existing C++ out-of-process COM Server

I'm reposting this question since I've been having some problems with my MSDN subscription, hoping I might have some better assistance now that aforementioned problems seem to have been resolved. I'm trying to connect a COM client written in C# to an existing (legacy) out-of-process COM server written in C++. I have imported the tlb using tlbimp.exe and have referenced the RWC in my project. I can connect to the COM server using object scComm32ComObj = Marshal.GetActiveObject("ScComm32.Document"); But that is as far as I am able to get. I need to be able to call some methods on the ScComm32CommObj, but trying to cast it to an interface or a class usign the interface results in an exception. Thanks, Bill

[Microsoft][SQL Server Native Client 10.0]Shared Memory Provider: Timeout error [258]


Hello All,

I am using MS SQL SERVER 2008. Im making an application which queries trillion of records. Im using PHP as scripting language. For those functions , which query database and 200 (approximately) rows of DB are returned, everything works fine. But if I query database and a large recordset should be returned, the following error is thrown:

Array ( [0] => Array ( [0] => 08S01 [SQLSTATE] => 08S01 [1] => 258

=> 258 [2] => [Microsoft][SQL Server Native Client 10.0]Shared Memory Provider: Timeout error [258]. [message] => [Microsoft][SQL Server Native Client 10.0]Shared Memory Provider: Timeout error [258]. ) [1] => Array ( [0] => 08S01 [SQLSTATE] => 08S01 [1] => 258
=> 258 [2] => [Microsoft][SQL Server Native Client 10.0]Communication link failure [message] => [Microsoft][SQL Server Native Client 10.0]Communication link failure ) [2] => Array ( [0] => 08S01 [SQLSTATE] => 08S01 [1] => -2147467259
=> -2147467259 [2] => [Microsoft][SQL Server Native Client 10.0]Communication link failure [message] => [Microsoft][SQL Server Native Client 10.0]Communication link failure ) )

If I see the error log it shows:

2010-10-17 12:32:38.88 Logon       Error: 18456, Severity: 14, State: 8.

2010-10-17 12

CI Server: Redefine Your Build Process with Continuous Integration


Jay Flowers demonstrates how to set up and use a Continuous Integration server using both discrete tools and the more comprehensive CI Factory solution.

Jay Flowers

MSDN Magazine March 2008

ClickOnce: Deploy and Update Your Smart Client Projects Using a Central Server


ClickOnce is a new deployment technology that allows users to download and execute Windows-based client applications over the Web, a network share, or from a local disk. Users get the rich interactive and stateful experience of Windows Forms, but still have the ease of deployment and updates available to Web applications. ClickOnce applications can be run offline and support a variety of automatic and manual update scenarios.Learn all about it here.

Brian Noyes

MSDN Magazine May 2004

SOAP: Using ATL Server to Build an Asynchronous SOAP Client in Unmanaged C++


SOAP opens up a new world of Web Services, letting you make function calls across a network or the Internet. But this flexibility creates new problems when your app needs to wait for calls to return from halfway around the world. What you need is an asynchronous SOAP client that takes advantage of threading to continue execution while waiting for calls over the wire. This article covers the basics of building such a client with ATL.

Pranish Kumar and Bogdan Crivat

MSDN Magazine April 2002

passing object values from server to client problem


I get a message that x_login is not declared.  I added Dim login as String = "123", but that didn't help.  What's the problem?

code behind....

Dim Login = "123"
x_login.Value = loginID


<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<form id="simForm" runat="server" method='post' action='https://test.authorize.net/gateway/transact.dll'>
        <input id="HiddenValue" type="hidden" value="Initial Value" runat="server" />
        <input type='hidden' runat="server" name='x_login' id='x_login' />
        <input type='submit' runat="server" id='buttonLabel' />



ASP Development Server doesn't appear to execute JQuery?


Experienced a really strange problem today. I added a jquery script to my MVC application to collapse sections of a View (via divs).

Pretty standard stuff, he showed me the script working before hand and it works.

However any time I would run my MVC app via Visual Studio the script would not work. I changed browsers, re-imported the code from source control and basically me and my co-worker banged our heads together for some time trying to figure out why the exact same code was running different on two machines.

Publishing the MVC app to our web server and running worked for both machines but for some bizarre reason when I ran it on my VS it never did.

One thought that came to mind is that by VS uses the cassini default lightweight webserver for debugging, whereas my co-worker is using IIS.

This seems to suggest then that the ASP Development server does not support JQuery. Is this true and if not, what could the problem be?

AsyncPostBackTrigger doesn't work on server..


 I am new to asp.net and ajax. I have a problem while using update panel.
I have a tabcontainer with 3-4 tab panels. Inside one tab panel there is a cancel button. What i want to do is to when i hit cancel button in code behind i change active tab index to 0 so that tabcontainer shows first tab panel. I have update panel around tab container. This works at my localhost. But on server its behavior is very random. Sometimes it works sometime it doesn't. Unfortunately I am not able to debug it also. I don't know how to debug code on server. As on localhost it works correctly so I am kind of stuck. 

Using SQL Server 2008 R2 client with Enterprise Library



I am modifying an existing application that uses SQL Server 2008 as the database and Enterprise Library 4.1 for Data Access .

What I need to do is to make it use the SQL Server 2008 R2 client to take advantage of out of the box failover capabilities.

Any idea how I can accomplish this?


Problem while creating process memory dumps.

Hi, I have following piece of code: Imports System Imports System.IO Imports System.Runtime.InteropServices Imports Microsoft.Win32.SafeHandles Imports System.ComponentModel Module Module1 <Flags()> Friend Enum NativeMiniDumpType MiniDumpNormal = &H0 MiniDumpWithDataSegs = &H1 MiniDumpWithFullMemory = &H2 MiniDumpWithHandleData = &H4 MiniDumpFilterMemory = &H8 MiniDumpScanMemory = &H10 MiniDumpWithUnloadedModules = &H20 MiniDumpWithIndirectlyReferencedMemory = &H4 MiniDumpFilterModulePaths = &H80 MiniDumpWithProcessThreadData = &H100 MiniDumpWithPrivateReadWriteMemory = &H200 MiniDumpWithoutOptionalData = &H400 MiniDumpWithFullMemoryInfo = &H800 MiniDumpWithThreadInfo = &H1000 MiniDumpWithCodeSegs = &H2000 MiniDumpWithoutAuxiliaryState = &H4000 MiniDumpWithFullAuxiliaryState = &H8000 End Enum <DllImport("dbghelp.dll", CharSet:=CharSet.Auto, SetLastError:=True)> Friend Function MiniDumpWriteDump(ByVal hProcess As IntPtr, ByVal processId As Int32, ByVal hFile As SafeFileHandle, ByVal dumpType As NativeMiniDumpType, ByVal exceptionParam As IntPtr, ByVal userStreamParam As IntPtr,

How to check how much memory from .NET process is allocated in pagefile?

Hi How to check how much memory from .NET process is allocated in pagefile? I was trying use task manager and perfmon but I could not find any counter/column that would tell me how much memory from specific .NET process is in pagefile. Regards

Educational question: How server objects are accessed from multiple client threads?

I will appreciate it if someone can help me to undestand how the following scenario works:   There is remoting server that is registered as WellKnownObjectMode.Singleton. Server implementation: It instantiates a class TestServer that implements interface IFoo interface IFoo { IHelper GetHelper() }   interface IHelper { void StoreString(); }   Implementation of TestServer: internal sealed class TestServer: System.MarshalByRefObject, IFoo { private IHelper> helper = new Helper(); public IHelper GetHelper(string helper){return helper;} }   Implementation of Helper: internal sealed class Helper : System.MarshalByRefObject, IHelper { public void StoreString (string val) {}; }   Implementation of a client (simplified; shown to illustrate the question only): static class Program { public static IFoo TestService; public static IHelper Helper; public TestThreads testmultiplecalls; [STAThread] static void Main() { TestService = (IFoo)Activator.GetObject(typeof(IFoo),"ipc://Channel"); Helper = TestService.GetHelper(); testmultiplecalls.Start(); } }   internal class TestThreads { public Start() { for (int i = 0; i < 20; i++) ThreadPool.QueueUserWorkItem((new TestCall(i.ToString())).DoWork); } }     internal class TestCall { private string m_str; public TestCall (string str) {m_str = str;} public void DoWork() { Program.Helper.StoreString(m_str); } }     Que

SQL Server doesn't exist or access denied while connecting with Access 2010 ODBC

Hello all. I am using Access 2010 and SQL Server 2008 (locally). I can easily connect to server using SSMS and it works excellent. But when I want to import a table to Access 2010 using ODBC, it says that "SQL Server doesn't exist or access denied". It worked previously - almost 3 days ago, but now, it doesn't! Please help! Thanks Mohammad Javahery

SQL-DMO Install on SQL Server 2005 Express Client

I am installing a Client side SQL 2005 Express that needs SQL-DMO. The Client computer does not have SQL Server 2005 Express installed. I have installed all the MDAC and .Net 2.0. The command line I'm using to try and install the SQL-DMO and XML modules is: SQLEXPR_ADV ADDLOCAL=Tools_Legacy,SQLXML I get a message something like 'SQL Server 2005 Version does not support this install option.' How do I get SQL-DMO installed on a SQL Server 2005 Express Client computer?

Replication Wizard doesn't like SQL Server Alias

I tried creating a new replication but I get an error that says, "SQL Server replication requires the actual sever name to make the connection to the server. Connections through a server alias, IP address, or any other alternate name are not supported. Specifiy the actual server name, 'SomeMachineNumber'." I don't get this. Why can't I use an alias? I googled and found few articles but not sure if I understand what others are talking about. Here is how I have things set up and I'm hoping someone can explain to me what is happening. On my machine, I have the following alias set up. Alias Name: SQLDEV, Port No: 2433, Protocol: TCP/IP, Server: SomeMachineNumber In Mgmt Studio, I can connect to the server SomeMachineNumber by using the alias SQLDEV. However, if I try to create a new publication on SQLDEV, I get the above error. Now, just for the heck of it, I created another alias using the same properties as above except, I named the alias the same as the server, "SomeMachineNumber". I connect to the server in Mgmt Studio using the new alias, and now I am able to create the new publication. Does this make sense? Am I not still using an alias in the second example? Why does the replication seemingly like the alias "SomeMachineNumber", but not "SQLDEV"?

Connection problem while connecting from client to server.

Hello, i am trying to connect sql server 2005 express using c#.net 3.5. my connection string is "Server=.\SQLExpress;AttachDbFilename=C:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\DATA\db_naren.mdf;Database=db_naren; Trusted_Connection=Yes;" this is working fine when i am connecting to sql server from the local machine. When i am trying to connect from someother machine to server it is giving error like A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) i added previliges in add new administrator on SQL Server 2005 Surface Area Configuration . and i made changes on SQL Server 2005 Surface Area Configuration  page, on Database Engine --> Remote Connections -->Local and remote connections --> Using both TCP/IP and named pipelines. still same error i am getting from client machine i am using connection string as "Server=MyServer\SQLExpress;AttachDbFilename=C:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\DATA\db_naren.mdf;Database=db_nare; Trusted_Connection=Yes;" is there any thing i need to do to connect from client machine to server?please
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