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

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

Problem while creating process memory dumps.

Posted By:      Posted Date: August 28, 2010    Points: 0   Category :.NET Framework
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,

View Complete Post

More Related Resource Links

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

CLR "Out of Memory" problem occurs eventually/inevitably

Windows 2003 server Standard edition, 64 bit SQL Server 2005 Developer and Enterprise Edition, 32 bit Servers are configured with 8GB or 32GB of memory (Eight CPUs / cores / whatever, plenty of hard drive space, network latency irrelevant)   Summary: After days of use, CLR memory usage appears to degrade or fragment to a point where “large” runs that had run succesfully now fail with “out of memory” issues. Resetting the server fixes this, but only for a time. Why, and how do we stop this from happening?   Details:  An overview of what we’re doing:  - Web site app calls SQL Server stored procedure “A” in one of several possible databases  - Procedure A calls CRL procedure “B” (Assembly created with CLR permission_set = “safe”). B is stored in a “library” database on the same SQL instance, i.e. there’s only the one copy  - CLR procedure B calls stored procedure “C” (back in the first database, as specified via parameter)  - Procedure C runs and returns three data sets to B. The second data set ranges from large to very large (over 60MB in our extreme cases)  - CLR procedure B performs some severe mathematical processing, returns a single data set to procedure A  - Procedure A slices, dices, and stores the data  - There could be mul

Help!, Problem with creating my store procedure.

I have two tables. Product_Table with ProductID as the primary key. My other table, ProductSKU_Table which has SKU as the primary key and ProductID as the foreign key. I am trying to create a store procedure to insert into both tables. How do I insert the primary key from the Product_Table into the foreign key of the ProductSKU_Table? This is what I have so far:ALTER PROCEDURE [dbo].[sp_addNewProduct] ( @productName varchar(50) = null, @shortDescription varchar(100) = null, @longDescription varchar(4000) = null, @active bit = null, @category int = null, @sku varchar(11), @skuDescription varchar(200) = null, @orginalPrice money = null, @sellingPrice money = null, @specialPrice money = null, @qtyOnHand int = null, @qtyAtSupplier int = null, @imagePath varchar(200) = null, @releaseDate datetime ) AS BEGIN DECLARE @lastIDInserted int INSERT INTO Product_Table(Name, ShortDescription, LongDescription, Active, CategoryId) VALUES(@productName, @shortDescription, @longDescription, @active, @category) SET @lastIDInserted = @@IDENTITY INSERT INTO ProductSKU_Table(ProductId, SKU, Description, OrginalPrice, SellingPrice, SpecialPrice, QtyOnHand, QtyAtSupplier, ReleaseDate, imagePath, CreatedDate, ModifiedDate) VALUES(@lastIDInserted, @sku, @skuDescription, @orginalPrice, @sellingPrice, @specialP

New Webpart Creating Problem

hi, after the successfully created one webpart in visual studio2008,wen i m creating second webpart then it is showing following error. Error 1 The feature name WebParts already exists in SharePoint. You need to rename the feature before solution deployment can succeed.  I tried to rename the webpart name and deleted from C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES location.But still the same error exist.  

namespace of fields problem when creating form template from xml?

I created a form template from a predefined xml, where I do not have any namespace. Later I added more fields. The output xml of the form is for the fields from the xml they have not prefix, for those added later, they have prefix my. I already have them all done. How can I make them consistent to have prefix my? Is there any options in InfoPath to turn on or off the prefix my?   thanks,

Accessing memory of a remote process (x64) from application (x86) - and the other way

Hi everyone, My program access a remote process, e.g. to get the text of ListViewItem. It uses ReadProcessMemory, WriteProcessMemory, SendMessage, LV_ITEM via PInvoke. Below is a little codesnippet. This doesnt work, when i compile for x86 and the remote process is x64 (or the other way). I know that is because the size of IntPtr - and so of the LV_ITEM-Structure - is different. Is there any way, to access x86 and x64 remote processes from the same application?  Is there any way to find out if the remote process is x86 or x64 and make my call's with a suitable LV-Item Structure? thanks Torsten Codesnippet: LV_ITEM lvitem = new LV_ITEM(); // Allocate memory in the remote process's address space string s = string.Empty; IntPtr pszTextMemory = VirtualAllocEx(hProcess,IntPtr.Zero,  1024, (int)(AllocationType.MEM_RESERVE|AllocationType.MEM_COMMIT), (int)(AccessProtectionType.PAGE_READWRITE)); lvitem.pszText = pszTextMemory; ... IntPtr pLVItemMemory = VirtualAllocEx(hProcess, IntPtr.Zero,  Marshal.SizeOf(lvitem), (int)(AllocationType.MEM_RESERVE|AllocationType.MEM_COMMIT), (int)(AccessProtectionType.PAGE_READWRITE)); IntPtr lvItemPtr = Marshal.AllocHGlobal(Marshal.SizeOf(lvitem)); Marshal.StructureToPtr(lvitem,lvItemPtr,false); WriteProcessMemory(hProcess, pLVItemMemory, ref lvitem, Marshal.SizeOf(lvitem), ref written); SendMessage(hListView, LVM_GETITEM

Weird memory problem

Hi all.   I am quite new to c#, I have the following code segments and both of them cause the program to throw System.ComponentModel.Win32Exception indicating that memory is not enough. Both of the code segments is in a form.   while(true) { System.Drawing.Graphics g = this CreateGraphics(); System.Drawing.BufferedGraphicsContext c = System.Drawing.BufferedGraphicsManager.Current; System.Drawing.BufferedGraphics b = c.Allocate( g, new System.Drawing.Rectangle(0,0,3000, 3000) ); } while(true) { this.Controls.Clear(); this.Controls.Add( new Label() ); }   My question is shouldn't the resource created handled automatically by garbage collector ?   Thanks a lot.  

Connection Error: (provider: Shared Memory Provider, error: 0 - No process is on the other end of th

Hello,Please bear with me as I am no Sql Server guru, but am getting this error that is preventing me from continuing with my development work.  I am the only developer on my team running Sql Server 2005 and it has been working just fine for the last week.  I opened the Management Studio this morning, just like every other morning and got this error:TITLE: Connect to Server------------------------------ Cannot connect to (local). ------------------------------ADDITIONAL INFORMATION: A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.) (Microsoft SQL Server, Error: 233) Of course the help page says no help is available.  I have googled myself sick and still have not found a way so resolve this...has anyone else had this error and/or a fix?  I am using XP Pro SP2...any help would be greatly appreciated!Thanks!Steph

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

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. 

Creating Login Page Problem

I doing a login page using visual c# and encounter some problem on it. my database got Username, Password, and UserType I want to create a login page redirect the user to different page based on their roles. It show that there is an error on the code (line 24). Any idea on create a login page that redirect the user to different page based on their roles?It shows this message :   this type or namespace name 'DataView' could not be found(are you missing a using directive or an assembly reference)Here the code, protected void Page_Load(object sender, EventArgs e) { string connectionString = "Data Source =.\\SQLEXPRESS;" + "AttachDbFilename=\"C:\\Program Files\\Microsoft SQL Server\\MSSQL10.SQLEXPRESS\\MSSQL\\DATA\\UserDB.mdf\";" + "Integrated Security=True;" + "Connect Timeout=30;" + "User Instance=True;"; System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(connectionString ); System.Data.SqlClient.SqlCommand cmd = conn.CreateCommand(); conn.Open(); } protected void Button1_Click(object sender, EventArgs e) { SqlDataSource sds = new SqlDataSource(); sds.SelectParameters.Add("Username", TypeCode.String, this.TextBox1.Text); sds.

Problem Creating Asymmetric Key from Executable File

In trying to create an asymmetric key from an executable file, I get an error if the path length to the dll is very long, while a short path length works perfectly.  Does anyone know what the limitation on the path length is?

Problem with Debugging - Cannot communicate with the debug host process


I'm trying to run (with debug) an SSIS  project and getting the following error


"Failed to start project


Cannot communicate with the debug host process. The IDtsHost interface is not registered. (Microsoft.DataTransformationServices.VsIntegration)"


It does run if I run without debug.


Any ideas?

Problem Creating Server Side Javascript


I have a custom control which creates client side Javascript in order for it to function. When the property .OnSelectScript is wrapped in an if...then that tests its length, the value of .OnSelectScript appears to be ignored when the Javascript is being generated. However, when I set the .text value of a test label to Javascript, it appears there. I have confirmed that the statement *does not* appear client side when I view the source for the page.

Property declaration for the control

    Public Property OnSelectScript() As String
            Return _OnSelectScript
        End Get
        Set(ByVal value As String)
            _OnSelectScript = value
        End Set
    End Property
    Private _OnSelectScript As String

Full SUB as designed

    Protected Sub Page_Load() Handles Me.Load

        Dim ClientSideJavaScript As New StringBuilder

        LabelSelectorTitle.Text = Me.Title
        Call LoadData()

        ClientSideJavaScript.Append("/*File: Test Selector.aspx.vb Sub: Page_Load()*/" & Chr(10))
        ClientSideJavaScript.Append("function setValue(ParentPopup, TargetDisplayControl, NewDisplayValue, TargetTextboxControl, NewKeyValue) {" & Chr(10))

Problem creating method?


I added the extender and when i tried to add the method this message poped up;

Cannot create page method "GetCompletionList" because no Code Behind or codefile was found.

does anyone know why this is happening?

Thanks  =)

Problem in creating new web application


I am trying to create new webapplication from central administration

But when I click next to create application it shows me error

Please help

Server Error in '/' Application.

Runtime Error

Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed.

Details: To enable the details of this specific error message to be viewable on the local server machine, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "RemoteOnly". To enable the details to be viewable on remote machines, please set "mode" to "Off".

<!-- Web.Config Configuration File -->

    <customErrors mode="RemoteOnly"/>

Notes: The current error

Problem while creating task with custom content type in sharepoint workflow


Hi all,

I am trying to create task with custom content type in sharepoint statemachine workflow. But it is showing "Error Occured" after task creation code is excecuted. can anyone tell me what is the problem.

Task Content type


  <ContentType  ID="0x01080100A707C0079E8547c0A87515457DB90629"
      Description="Workflow Task"
      <FieldRef ID="{9da97a8a-1da5-4a77-98d3-4bc10456e700}" Name="MyComments" DisplayName="MyComments"  />
      <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
        <FormUrls xmlns="

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