Quantcast
Channel: Common Language Runtime Internals and Architecture forum
Viewing all 1710 articles
Browse latest View live

Unable to Load Assembly from GAC

$
0
0

Hi,

I am getting the below error while logging the trace details.

Invalid TraceListenerData type in configuration 'listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging"'.


My logging configuration is as follows:

  <configSections>
    <section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
  </configSections>


I have the EntLib Logging dll deployed in GAC (Ver. 4.0) @ location C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.Practices.EnterpriseLibrary.Logging\v4.0_6.0.0.0__31bf3856ad364e35. But, for some reason .NET Runtime is not pull this dll from GAC.

The exception goes away when I copy the EntLib Logging dll to the dir where the executable is actually located.

Kindly, let me know why the .NET Runtime is not able to Load thid assembly from GAC?

As per my understanding if the CLR doesnt finds the required dlls in the base directory (the one where the executable is actually located it will look for it into GAC)

But for some reason this is not happening.

Kinldy, let me know what is going wrong?


Sachin R. Chavan.


How to unload or release memory when using win32 dll

$
0
0

Hi All,
I used to track the memory of my application using dot memory tool.
In this tool, it is  observed that  managed memory is releasing properly but unmanaged memory is keep on increasing.
so i want to release the unmanged memory in my application.
I am using the below unmanged win32 dll in our winform application.
Can someone please suggest a way  how to release memory for these.

      [DllImport("user32.dll", CharSet = CharSet.Auto)]
        public static extern bool PostMessage(int hhwnd, uint msg, IntPtr wparam, IntPtr lparam);

        [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
        static extern uint RegisterWindowMessage(string lpString);

        // This function checks wheather internet connection is avilable or not
        [DllImport("wininet.dll")]
        private extern static bool InternetGetConnectedState(out int netConnection, int val);

        // Sets an event hook function for a range of events.
        [DllImport("user32.dll")]
        static extern IntPtr SetWinEventHook(uint eventMin, uint eventMax, IntPtr hmodWinEventProc, WinEventDelegate lpfnWinEventProc, uint idProcess, uint idThread, uint dwFlags);

        // This Function is used to get Active Window Title.
        [DllImport("user32.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto)]
        public static extern int GetWindowText(IntPtr hwnd, string lpString, int cch);

        // This Function is used to get Handle for Active Window.
        [DllImport("user32.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto)]
        private static extern IntPtr GetForegroundWindow();

        // This Function is used to get Active window process ID.
        [DllImport("user32.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto)]
        private static extern Int32 GetWindowThreadProcessId(IntPtr hWnd, out Int32 lpdwProcessId);

        [DllImport("user32.dll", EntryPoint = "SendMessageW", CharSet = CharSet.Unicode, SetLastError = true)]
        public static extern IntPtr SendMessage(
            IntPtr hWnd,
            IntPtr Msg,
            IntPtr wParam,
            [MarshalAs(UnmanagedType.LPWStr)] StringBuilder lParam
            );

        [DllImport("user32.dll")]
        public static extern IntPtr FindWindowEx(
            IntPtr hWndParent,
            IntPtr hWndChild,
            string WndClass,
            string WndTitle
            );

        [DllImport("user32.dll")]
        [return: MarshalAs(UnmanagedType.Bool)]
        static extern bool UnhookWinEvent(IntPtr hWinEventHook);

        // This Function is used to retrieves the name of the class to which the specified window belongs.
        [DllImport("User32")]
        private static extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount);

        // This Function is used to receive the child window handles.
        [DllImport("User32")]
        private static extern bool EnumChildWindows(IntPtr hWndParent, EnumChildCallback lpEnumFunc, ref IntPtr lParam);

        // This Function is used to retrieves the address of the specified interface for the object associated with the specified window.
        [DllImport("Oleacc.dll")]
        private static extern int AccessibleObjectFromWindow(IntPtr hwnd, uint dwObjectID, byte[] riid, ref Excel.Window ptr);


   

Padma Yeddula

WCF

$
0
0

Hi Everybody,

                    Please anyone say what is the use of WCF? how we want to create wcf? compare between web service, and wcf. please share me any link. better with snapshots. 

Thank you in advance


.NET

inheriting a c++

$
0
0
i have a doubt
in c# , multiple inheritance is not allowed.

so is it possible to inherit a c++ which is multiple inherited.? 

problems after use useLegacyV2RuntimeActivationPolicy setting

$
0
0

Please see below the architecture of my application:

Application A -> Assembly B -> Assembly C (Third party dll file could not be modified) -> Third Party A and Third Party B.

1. The original Runtime versions:

     Application A: Runtime Version: v2.0.50727

     Assembly B: Runtime Version: v2.0.50727

     Assembly C: Runtime Version: v1.1.4322 

2. Now only upgrade/recompile Application A from Runtime v2.0.50727 to v4.0, the configuration file of Application:

      <startup>
         <supportedRuntimeversion="v4.0"sku=".NETFramework,Version=v4.0"/>

   </startup>

 The third party A does not work again under Application A. Third Party B still works fine.

So Modify above config file to :

   <startupuseLegacyV2RuntimeActivationPolicy="true">
         <supportedRuntimeversion="v4.0"sku=".NETFramework,Version=v4.0"/>

   </startup>

Now, Third party A works again. However, third party B does not work.

I try below configuration files, the third party B still does not work:

  <startup useLegacyV2RuntimeActivationPolicy="true">
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
        <supportedRuntimeversion="v2.0.50727"/>
        <supportedRuntime version="v1.1.4322"/>
        <supportedRuntime version="v1.0.3705"/>
  </startup>   

 

Both third party A and third party B are important customers.

Are there any suggestions to support both Third Party A and B?

Thanks Very Much!

Scott 




RDP Client (IMsRdpClientNonScriptable) SendKey Error

$
0
0

Im trying to sendkeys to an remotedesktop using the interface IMsRdpClientNonScriptable (more info hereIMsRdpClientNonScriptable::SendKeys Method)
But somehow the AXIMP.exe fails to make the correct SendKeys method as defined by microsoft (see link above).
microsoft states that the sendkeys method should be native like this:

HRESULT SendKeys(
 [in] LONG numKeys,
 [in] VARIANT_BOOL *pbArrayKeyUp,
 [in] LONG *plKeyData
);

I would argue that this correctly translated to C# would be like this:

int SendKeys(int numKeys, refbool[] pbArrayKeyUp, refint[] plKeyData)

But the AXIMP.EXE translates this into this:

void SendKeys(int numKeys, refbool pbArrayKeyUp, refint plKeyData);

I cant seem to get this to work. so I've been searing the web for a solution without success!!
I found that another guy had the same issue aximp.exe generates incorrect wrapper method for IMsRdpClientNonScriptable::SendKeys but no solution was found here either. hmmm

OK so here ones and for all; "Does anyone have a working C# or VB.Net code that can send key strokes to the remote desktop. ???"

This code fails with the following (HRESULT E_FAIL at MSTSCLib.IMsRdpClientNonScriptable.SendKeys(Int32 numKeys, Boolean& pbArrayKeyUp, Int32& plKeyData)):

publicvoid SendKeys(IMsRdpClientNonScriptable rdpNonScript, Keys[] keys)
    {try
      {if (null != rdpNonScript)
        {int arrayIndex = 0;int[] plKeyData = newint[20];bool[] pbArrayKeyUp = newbool[20];for (int i = 0; i < keys.Length; i++)
          {
            plKeyData[arrayIndex] = (int)keys[i];
            pbArrayKeyUp[arrayIndex] = false;
            arrayIndex++;
          }for (int i = keys.Length - 1; i >= 0; i--)
          {
            plKeyData[arrayIndex] = (int)keys[i];
            pbArrayKeyUp[arrayIndex] = true;
            arrayIndex++;
          }

          rdpNonScript.SendKeys(keys.Length * 2, ref pbArrayKeyUp[0], ref plKeyData[0]);
        }
      }catch (Exception ex)
      {
        MessageBox.Show(ex.Message + Environment.NewLine + Environment.NewLine + ex.StackTrace);
      }
    }

With great code, comes great complexity, so keep it simple stupid...

C# SerialPort KERNEL_SECURITY_CHECK_FAILURE

$
0
0

I'm using SerialPort class to read and write data from an USB device that use USB CDC class. My Program is called CameraControl.

Often I get blue screen with KERNEL_SECURITY_CHECK_FAILURE

Below WinDbg analysis

*******************************************************************************
*                                                                            *
*                        Bugcheck Analysis                                    *
*                                                                            *
*******************************************************************************

KERNEL_SECURITY_CHECK_FAILURE (139)
A kernel component has corrupted a critical data structure.  The corruption
could potentially allow a malicious user to gain control of this machine.
Arguments:
Arg1: 0000000000000003, A LIST_ENTRY has been corrupted (i.e. double remove).
Arg2: ffffd00020d51470, Address of the trap frame for the exception that caused the bugcheck
Arg3: ffffd00020d513c8, Address of the exception record for the exception that caused the bugcheck
Arg4: 0000000000000000, Reserved

Debugging Details:
------------------


OVERLAPPED_MODULE: Address regions for 'niorbk' and 'IntcDAud.sys' overlap

TRAP_FRAME:  ffffd00020d51470 -- (.trap 0xffffd00020d51470)
NOTE: The trap frame does not contain all registers.
Some register values may be zeroed or incorrect.
rax=ffffe001e1d400b8 rbx=0000000000000000 rcx=0000000000000003
rdx=ffffe001e5cf6c28 rsi=0000000000000000 rdi=0000000000000000
rip=fffff800c73f0414 rsp=ffffd00020d51600 rbp=ffffe001e1a87080
 r8=fffff800c73f03c0  r9=0000000000000012 r10=0000000000000000
r11=fffff80209967897 r12=0000000000000000 r13=0000000000000000
r14=0000000000000000 r15=0000000000000000
iopl=0         nv up ei pl nz na pe nc
usbser+0xa414:
fffff800`c73f0414 cd29            int     29h
Resetting default scope

EXCEPTION_RECORD:  ffffd00020d513c8 -- (.exr 0xffffd00020d513c8)
ExceptionAddress: fffff800c73f0414 (usbser+0x000000000000a414)
   ExceptionCode: c0000409 (Security check failure or stack buffer overrun)
  ExceptionFlags: 00000001
NumberParameters: 1
   Parameter[0]: 0000000000000003

CUSTOMER_CRASH_COUNT:  1

DEFAULT_BUCKET_ID:  LIST_ENTRY_CORRUPT

BUGCHECK_STR:  0x139

PROCESS_NAME:  CameraControl.

CURRENT_IRQL:  2

ERROR_CODE: (NTSTATUS) 0xc0000409 - Il sistema ha rilevato un sovraccarico di un buffer basato su stack in questa applicazione. Il sovraccarico potrebbe consentire a un utente non autorizzato di assumere il controllo dell'applicazione.

EXCEPTION_CODE: (NTSTATUS) 0xc0000409 - Il sistema ha rilevato un sovraccarico di un buffer basato su stack in questa applicazione. Il sovraccarico potrebbe consentire a un utente non autorizzato di assumere il controllo dell'applicazione.

EXCEPTION_PARAMETER1:  0000000000000003

ANALYSIS_VERSION: 6.3.9600.17029 (debuggers(dbg).140219-1702) amd64fre

LAST_CONTROL_TRANSFER:  from fffff802099667e9 to fffff8020995aca0

STACK_TEXT:  
ffffd000`20d51148 fffff802`099667e9 : 00000000`00000139 00000000`00000003 ffffd000`20d51470 ffffd000`20d513c8 : nt!KeBugCheckEx
ffffd000`20d51150 fffff802`09966b10 : ffffe001`e7dc0440 00000000`00000000 ffffe001`00000001 ffffd000`20d514c0 : nt!KiBugCheckDispatch+0x69
ffffd000`20d51290 fffff802`09965d34 : 00000000`00000000 ffffe001`e7956de8 ffffc001`e05c6320 fffff800`c377ccb2 : nt!KiFastFailDispatch+0xd0
ffffd000`20d51470 fffff800`c73f0414 : 00000000`00000306 00000000`00000000 00000000`00000050 00000000`000007ff : nt!KiRaiseSecurityCheckFailure+0xf4
ffffd000`20d51600 fffff800`c73f0470 : ffffe001`e5cf6c18 00000000`00000000 ffffe001`e1aa4400 00000000`00000000 : usbser+0xa414
ffffd000`20d51630 fffff800`c73ef9a1 : ffffe001`e53ffa00 ffffe001`e5cf69d0 ffffe001`e5cf6880 00000000`00000010 : usbser+0xa470
ffffd000`20d51660 fffff802`09bdcab2 : ffffe001`e17bf780 ffffe001`e17bf780 00000000`00000000 ffffe001`e7546680 : usbser+0x99a1
ffffd000`20d51690 fffff802`09bed5fa : ffffe001`e1aa43d0 ffffe001`e0d88dc0 ffffe001`e1aa43e0 ffffe001`e1aa4300 : nt!IopCloseFile+0x152
ffffd000`20d51720 fffff802`09bed3f3 : 00000000`00000000 00000000`00000000 00000000`00000000 ffffe001`00000001 : nt!ObpDecrementHandleCount+0x1b6
ffffd000`20d517c0 fffff802`09bed02e : ffffe001`e1a8c080 fffff802`09855114 00000000`00000000 00000000`00000002 : nt!ObCloseHandleTableEntry+0x313
ffffd000`20d51890 fffff802`09d641f6 : ffffe001`e1a87080 ffffe001`e1a7e400 ffffc001`ed9e17c0 00000000`00000001 : nt!ExSweepHandleTable+0xba
ffffd000`20d518f0 fffff802`09b9506a : ffffd000`245d7713 ffffd000`245d7713 ffffe001`e1a87348 ffffffff`00000040 : nt! ?? ::NNGAKEGL::`string'+0x32c16
ffffd000`20d51960 fffff802`09c2f6cb : 00000000`e1a87088 00000000`e1a87088 00000000`c000010a 00000000`00000000 : nt!PspRundownSingleProcess+0x286
ffffd000`20d519f0 fffff802`09c2f3d1 : ffffe001`e1def880 ffffe001`e1a7e400 ffffe001`e1a87080 ffffe001`e1a87080 : nt!PspTerminateAllThreads+0x27f
ffffd000`20d51a50 fffff802`09c2f15e : ffffffff`ffffffff ffffe001`e10c0080 ffffe001`e1a87080 ffffe001`e1a7e080 : nt!PspTerminateProcess+0xe5
ffffd000`20d51a90 fffff802`099664b3 : ffffe001`e1a87080 ffffe001`e1a7e080 ffffd000`20d51b80 00000000`0000159c : nt!NtTerminateProcess+0x9e
ffffd000`20d51b00 00000000`77022772 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : nt!KiSystemServiceCopyEnd+0x13
00000000`0ff6eac8 00000000`00000000 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : 0x77022772

STACK_COMMAND:  kb

FOLLOWUP_IP: 
usbser+a414
fffff800`c73f0414 cd29            int     29h

SYMBOL_STACK_INDEX:  4

SYMBOL_NAME:  usbser+a414

FOLLOWUP_NAME:  MachineOwner

MODULE_NAME: usbser

IMAGE_NAME:  usbser.sys

DEBUG_FLR_IMAGE_TIMESTAMP:  5215f890

IMAGE_VERSION:  6.3.9600.16384

FAILURE_BUCKET_ID:  0x139_3_usbser+a414

BUCKET_ID:  0x139_3_usbser+a414

ANALYSIS_SOURCE:  KM

FAILURE_ID_HASH_STRING:  km:0x139_3_usbser+a414

FAILURE_ID_HASH:  {f38f031c-a840-6c18-f377-c47aa3e1dec1}

Followup: MachineOwner


I'm using Windows 8.1 PRO and this problem is very embarrassing for my clients.

Thank you

Problem generating manifest. Insufficient memory to continue the execution of the program.

$
0
0

Hi,

      I am using visual studio 2008 when i am start debugging some times it showing the error

Problem generating manifest. Insufficient memory to continue the execution of the program.

for this again i am restarting visual studio

so please give a solution to this error

waiting for reply...................


Getting error message that a file can't be loaded but there are no references to it

$
0
0

I have been working to upgrade a VS solution from VS2003 to VS2012 (through several steps through VS2005 and VS2008).  I have one assembly (TMGDevelopment.PrintForm) which I am removing from the project and replacing with other functionality.  I have removed all references to this assembly including doing a Windows Explorer search for the name (PrintForm) and its PublicKeyToken (cb51e09df98aa227) and removing all lines that existed anywhere within the solution hierarchy.  I have also removed a number of licenses.licx files that reference the assembly.  Most of these edits have been done directly in an editor rather than in VS2012.  I have also removed all of the cache files that have contained references to this assembly and let them be rebuilt.

My problem is that even though I believe I have removed all references to this assembly, I am still getting the error "Could not load file or assembly 'PrintForm, Version=2.0.1.0, Culture=neutral, PublicKeyToken=cb51e09df98aa227' or one of its dependencies. The system cannot find the file specified." when I attempt to open one of the forms.  This is driving me batty because I can't find anything that would cause this reference to occur.

Any help would be appreciated.   Thanks.

Web based application

$
0
0

I want to read all excel sheets in one excel file by specifiying few cell addresses which has no header using web based application.

Kindly help me.


SSL Handshake on HttpWebRequest after WebExceptionStatus.ProtocolError

$
0
0

Hi,

I need help with ssl handshakes.
I appreciate any help you can provide :)

Tested Framework(s): .NET 4.5 (will be used), .NET 4.0 (same behavior)

Situation: 

- The following code is producing the following output

- On each request, a ssl handshake will be done
    - I checked this with ServerCertificateValidationCallback
    - and also with WireShark (Client Hello, Server Hello)

- For testing purpose, the part HandleResponse(request); was used several times. The end product will not get a response, because I dont really need it! So the method HandleResponse(request); wont be called
    - I noticed, whenever an WebException in HandleResponse(request); occurs, the next request will do a ssl handshake. The problem is, its pretty often
    - Main reason for WebException is the HTTP 502 StatusCode

- The request will be done every couple of minutes up to every couple of hours

- My goal is to minimize the ssl handshake data traffic and latency

Console Output:

Certificate
WebExceptionStatus.ProtocolError
Certificate
WebExceptionStatus.ProtocolError
Certificate
WebExceptionStatus.ProtocolError

Representing Code, if you need more information, just ask:

public static bool AcceptAllCertifications(object sender, X509Certificate certification, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{
    Console.WriteLine("Certificate");
    return true;
}

public void Run()
{
    ServicePointManager.ServerCertificateValidationCallback = AcceptAllCertifications;

    while (true)
    {
        HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://####.##/path");
        request.Method = "POST";
        request.KeepAlive = true;
        request.ContentType = "application/x-www-form-urlencoded; charset=UTF-8";
        request.Proxy = null;

        string content = "...";
        byte[] byteArray = Encoding.UTF8.GetBytes(content);
        request.ContentLength = byteArray.Length;

        using (Stream stream = request.GetRequestStream())
        {
            stream.Write(byteArray, 0, byteArray.Length);
        }

        HandleResponse(request);
        
        Thread.Sleep(3000);
    }
}

public void HandleResponse(HttpWebRequest request)
{
    try
    {
        HttpWebResponse response = (HttpWebResponse)request.GetResponse();
        //...
    }
    catch (WebException e)
    {
        if (e.Status == WebExceptionStatus.ProtocolError)
        {
            using (StreamReader sr = new StreamReader(e.Response.GetResponseStream()))
            {
                string content = sr.ReadToEnd();
            }
        }
    }
}




advapi32.dll vs .Net4 Cryptography: Should\Can I upgrade to the .Net calls?

$
0
0

We have an existing codebase using the advapi32.dll calls for encrypting and decrypting out passwords and Licence files. It has been converted from VB6 to VB.Net, but we need to use it with C# now (we are now a C# shop so obviously it all needs to be converted because .Net wont let you use multiple languages in the same solution and C# is better </sarcasm>), and the question has been asked if we can stop referencing the advapi32.dll calls and use .Net instead. 

Can anyone tell me if this is a good idea, bad idea, or just not going to be possible if we want to use the old licence files? The calls all seem to be vailable, but do they implement the same was as the older DLL's? Are there versioning issues if we use the DLL's or are they all standard from Win8 backwards? Do we need to deploy them as part of our package in case they are missing? 

Talk about versioning

$
0
0

Ok, let's talk about assembly versions.

Currently, Microsoft (and a Microsoft-stack developers) using four number version: Major.Minor.Build.Revision. The vast majority of questions are about Build or Revision components. If a Build is more or less clear, the implementation of a Revision differs from developer to developer. Usually, we say that Revision is a unique ID of version of our product, which will changes at each build, even if it's fix or used for debugging reason. But what if we'repartially wrong?..

Ok. Why we need to four-number formatting? Because it's about hierarchy: we use Major number for big changes and Minor for small and when we change the Major number, wezero out the Minor number, we increase Build number at every build and zero out it when Minor number changes. Of course, we can always increase the Build number (as Microsoft does in Windows) and/or increase (or use the date or compute hash for) the Revision. But then why we need a hierarchy? We can simple use Release.Build scheme and have giant version numbers like 37.17365 (hello to Google and Mozilla!). If we use four-number formatting,we must use hierarchy rule for all parts of version. For example: we use Major number for big changes and Minor for small, we increase Build number at every build with thesame [internal and external] functionality and zero out it when the Minor number changes, and we increase Revision numberat every successful build and zero out it when Build number changes (=we use Revision when we need release fix and zero out it in all other reasons). In pseudo-graphical it looks like Major → Minor → Build → Revision hierarchy. As the result, we have cute version like 1.2.345.6 where full version is a unique ID of version of our product. Good job, guys.

And what scheme you are using?

How to prevent garbage collection from pausing my application?

$
0
0

(I have already posted my question on StackOverflow, but since it only resulted in discussion rather than a solution I think it's better to post it here for some more advice. Just for reference: http://stackoverflow.com/q/25158665/259059)

The problem is that my application gets occasionally paused when in production use (.NET Framework 4.0, Server 2003 R2, WPF mixed with WinForms and native components).

The reason could easily be determined using Debug Diag:

mscorlib_ni!System.GC.Collect(Int32, System.GCCollectionMode)+47 
[[InlinedCallFrame] (System.GC._Collect)] System.GC._Collect(Int32, Int32) 
PresentationCore_ni!MS.Internal.MemoryPressure.ProcessAdd()+1d0 
PresentationCore_ni!MS.Internal.MemoryPressure.Add(Int64)+39 
PresentationCore_ni!System.Windows.Media.SafeMILHandleMemoryPressure..ctor(Int64)+43 
PresentationCore_ni!System.Windows.Media.SafeMILHandle.UpdateEstimatedSize(Int64)+38 
PresentationCore_ni!System.Windows.Media.Imaging.RenderTargetBitmap.FinalizeCreation()+df 
PresentationCore_ni!System.Windows.Media.Imaging.RenderTargetBitmap..ctor(Int32, Int32, Double, Double, System.Windows.Media.PixelFormat)+d9 
WindowsFormsIntegration_ni!System.Windows.Forms.Integration.HostUtils.GetRenderTargetBitmapForVisual(Int32, Int32, System.Windows.Media.Visual)+b1 
WindowsFormsIntegration_ni!System.Windows.Forms.Integration.HostUtils.GetBitmapForFrameworkElement(System.Windows.FrameworkElement)+89 
WindowsFormsIntegration_ni!System.Windows.Forms.Integration.HostUtils.GetBitmapForTransparentWindowsFormsHost(System.Windows.Forms.Integration.WindowsFormsHost)+4b 
WindowsFormsIntegration_ni!System.Windows.Forms.Integration.HostUtils.GetBitmapForWindowsFormsHost(System.Windows.Forms.Integration.WindowsFormsHost, System.Windows.Media.Brush)+1f 
WindowsFormsIntegration_ni!System.Windows.Forms.Integration.WindowsFormsHostPropertyMap.BackgroundPropertyTranslator(System.Object, System.String, System.Object)+109 
WindowsFormsIntegration_ni!System.Windows.Forms.Integration.PropertyMap.RunTranslator(System.Windows.Forms.Integration.PropertyTranslator, System.Object, System.String, System.Object)+32 
WindowsFormsIntegration_ni!System.Windows.Forms.Integration.WindowsFormsHost.ArrangeOverride(System.Windows.Size)+277 
PresentationFramework_ni!System.Windows.FrameworkElement.ArrangeCore(System.Windows.Rect)+8e3 
PresentationCore_ni!System.Windows.UIElement.Arrange(System.Windows.Rect)+385 
PresentationCore_ni!System.Windows.ContextLayoutManager.UpdateLayout()+2b5 
PresentationCore_ni!System.Windows.ContextLayoutManager.UpdateLayoutCallback(System.Object)+19 
PresentationCore_ni!System.Windows.Media.MediaContext+InvokeOnRenderCallback.DoWork()+10 
PresentationCore_ni!System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()+76 
PresentationCore_ni!System.Windows.Media.MediaContext.RenderMessageHandlerCore(System.Object)+8a 
PresentationCore_ni!System.Windows.Media.MediaContext.AnimatedRenderMessageHandler(System.Object)+6e 
WindowsBase_ni!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)+53 
WindowsBase_ni!MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)+42 
WindowsBase_ni!System.Windows.Threading.DispatcherOperation.InvokeImpl()+8d 
WindowsBase_ni!System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)+38 
mscorlib_ni!System.Threading.ExecutionContext.runTryCode(System.Object)+51 
[[HelperMethodFrame_PROTECTOBJ] (System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup)] System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode, CleanupCode, System.Object) 
mscorlib_ni!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)+6a 
mscorlib_ni!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)+7e 
mscorlib_ni!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)+2c 
WindowsBase_ni!System.Windows.Threading.DispatcherOperation.Invoke()+68 
WindowsBase_ni!System.Windows.Threading.Dispatcher.ProcessQueue()+15e 
WindowsBase_ni!System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)+63 
WindowsBase_ni!MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)+be 
WindowsBase_ni!MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)+7d 
WindowsBase_ni!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)+53 
WindowsBase_ni!MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)+42 
WindowsBase_ni!System.Windows.Threading.Dispatcher.InvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)+b4 
WindowsBase_ni!MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)+104 
WindowsBase_ni!DomainBoundILStubClass.IL_STUB_PInvoke(System.Windows.Interop.MSG ByRef)+3c 
[[InlinedCallFrame]] 
WindowsBase_ni!System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)+c1 
WindowsBase_ni!System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)+49 
PresentationFramework_ni!System.Windows.Application.RunDispatcher(System.Object)+5b 
PresentationFramework_ni!System.Windows.Application.RunInternal(System.Windows.Window)+74 
PresentationFramework_ni!System.Windows.Application.Run(System.Windows.Window)+2b 

So in other words, having a WinFormsHost inside your application will occasionally result in a call to GC.Collect(2) through GetRenderTargetBitmapForVisual() and MemoryPressure.Add(). Apparently, this also is a "foregorund garbage" collection, so the .NET 4.0 background garbage collection doesn't help here.

Since it doesn't seem like I can prevent these garbage collection calls, what should I do to reduce the problem? The only idea I had so far is calling GC.Collect() manually when the application is idle (not in use) for a couple of minutes, to make sure it doesn't happen when it's in use. However, I believe this is to be considered a bad practice. Any other options?



VBA Excel call to c# dll via Visual Studio 2012

$
0
0

I have created a dll lib via the following:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VBAprocs
{
    public class fileSys
    {
        public string getDirectories()
        {
            return "Directory A";
        }
    }
}

using the COM interop facilities  ie checking both the "Make assembly COM-Visible" and the "Register for COM InterOp" boxes on the project property pages [Visual Studio 2012 Express Edition]
However when I try and build the class library, I get the following message regardless of the fact that I am executing from an account with administrative privileges. What do I need to do to get the dll library registered?

"Cannot register assembly "D:\VS_Development\VBAprocs\VBAprocs\bin\Debug\VBAprocs.dll"  - access denied. Please make sure you're running the application as Administrator. Access to the registry key 'HKEY_CLASSES_ROOT\VBAprocs.fileSys' is denied."


Can not Create ActiveX component exception

$
0
0

Hi,

We are facing the below mentioned exception :

System.Exception was caught

Message = Cannot create ActiveX component

source = Microsoft.VisualBasic

StackTrace

At Microsoft.VisualBasic.Interaction.CreateObject(String ProgId,String Server Name)

At AutomationAQ.Script.var.GetobjectAlternative(String Name, String AlternativeName)

At AutomatedQA.TestComplete.Connect.TBaseTCClass.GetTestCompleteIntegration()

at AutomatedQA.TestComplete.connect.TBaseTCClass.GetTestCompleteObjectByName(String Name)

at AutomatedQA.TestComplete.Connect.sysClass.init()

at AutomatedQA.Script.var.get_Item(String name, var[] args

 

If anybody could help us will be a great help

mscorlib recursive resource lookup bug

$
0
0

Hi,

I got crash in my application when restart of the Windows 8.

Please find the assertion failure details below.

Expression: [mscorlib recursive resource lookup bug] Description: Infinite recursion during resource lookup within mscorlib. This may be a bug in mscorlib, or potentially in certain extensibility points such as assembly resolve events or CultureInfo names. Resource name: Word_At

[Expanded Information] Stack Trace:    at System.Environment.ResourceHelper.GetResourceStringCode(Object userDataIn)    at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)    at System.Environment.ResourceHelper.GetResourceString(String key, CultureInfo culture)    at System.Environment.ResourceHelper.GetResourceString(String key)    at System.Environment.GetResourceStringLocal(String key)    at System.Environment.GetResourceFromDefault(String key)    at System.Diagnostics.StackTrace.ToString(TraceFormat traceFormat)    at System.Diagnostics.StackTrace.ToString() 

:

:

------------------------------------------------------------------

Event Viewer Showing Error Message: .NET Runtime version : 4.0.30319.17929 - Assert FailureExpression: [mscorlib recursive resource lookup bug] Description: Infinite recursion during resource lookup within mscorlib. This may be a bug in mscorlib, or potentially in certain extensibility points such as assembly resolve events or CultureInfo names. Resource name: Arg_AccessViolationException.

What could be the reason and any fix is available for this issue in windows 8?

Thanks....



What operating systems does .Net support other than windows ?

$
0
0

What operating systems does .Net support other than windows ?

can please tell me,

.NET plat form Independent or Dependent ?


anilbabu

Is my application truly a 64bit application?

$
0
0

Can someone assist me on this research below??

-If an application is compiled and developed successfully in a 32 bit environment from visual basic 6.0, and then migrated and recompiled in a native 64 bit ..net environment, are there any issues or concerns in general that I need to be aware of. My goal is to migrate a successful developed visual basic 6.0 32bit working application into an 64bit native c sharp .net environment.

I basically want to know once I have migrated over to a 64bit .net environment, and I decided to use a 32bit ado recordset in a 64bit application, is my application truly a 64bit application or is it a 32bit application now because I am using a 32bit ado recordset. How can I find out if my application is 64bit application once I inject a 32bit application.


exe file

$
0
0
i have deleted .exe file of my project by mistake.Is there any way to create it again?
Viewing all 1710 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>