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

ModuleLoadException: The C++ module failed to load during native initialization

$
0
0

Hi all

i receive the above error message when i try to run a c# program that calls class member
functions in a c++ static lib (lib0) via a c++/cli bridge. The complete error message is
appended at the bottom of my message. This is on Windows XP

The c++ lib0 is built with VS 2005. It links in a couple of other static native c++ libs lib1
and lib2. I have a native c++ console application, which builds an object of a type defined
in lib0 and calls member functions, this works fine.

To bridge to c#, i have defined a wrapper class (public ref class Xwrapper{};) in
wrapper.cpp, which holds a pointer to the native class X and exposes some native
member functions (void and int arguments). I am using Runtime::InteropServices.
On the c# side i have a simple main in tool.cs, which creates an Xwrapper object
and calls the exposed member functions. The build is done from the command line
using the following sequence of commands:

cl.exe /c /clr  /MD  wrapper.cpp
csc /target:module /addmodule:wrapper.obj tool.cs
link /LTCG /CLRIMAGETYPE:IJW /ENTRY:Tool.Program.Main /SUBSYSTEM:CONSOLE
/OUT:tool.exe wrapper.obj tool.netmodule lib0.lib

Running tool.exe produces the above error message.
I have used this general approach in other projects and it worked fine. It also works
fine if i remove all reference to classes defined in lib1 and lib2 from lib0. The problem
hence seems to be related to those libs (which pose no problem at all in the purely
native setting!).

Is there any way to pin down the problem or am i doing something completely wrong?
Maybe i am missing some linker options?

Thanks for all responses!

full error message:
----------------------
Unhandled Exception: System.TypeInitializationException: The type initializer for '<Module>' threw an exception. --->
<CrtImplementationDetails>.ModuleLoadException: The C++ module failed to load during native initialization.
 ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that oth
er memory is corrupt.
   at _initterm((fnptr)* pfbegin, (fnptr)* pfend)
   at <CrtImplementationDetails>.LanguageSupport.InitializeNative(LanguageSupport* )
   at <CrtImplementationDetails>.LanguageSupport._Initialize(LanguageSupport* )
   at <CrtImplementationDetails>.LanguageSupport.Initialize(LanguageSupport* )
   --- End of inner exception stack trace ---
   at <CrtImplementationDetails>.ThrowModuleLoadException(String errorMessage, Exception innerException)
   at <CrtImplementationDetails>.ThrowModuleLoadException(String , Exception )
   at <CrtImplementationDetails>.LanguageSupport.Initialize(LanguageSupport* )
   at .cctor()
   --- End of inner exception stack trace ---

 


Heap corruption in CFusionArray (SxS)

$
0
0

Hi,
I am running into an issue where a reg-free COM usage where we have a COM object A that is CoCreateInstance'ing object B. Object B is a managed class that is decorated with the GuidAttribute -- that guid is supplied in the CoCreateInstance call that A makes.
In normal execution, there are no issues noticed. However, when using App Verifier to turn on full pageheap verification, AV detects heap corruption. The stack trace seems to point to CFusionArray as the place where a buffer overrun seems to be taking place.

Note that this is an NDP 3.5 app. I ran it on a machine with 3.5 SP1 installed.

The following is what I see in WinDbg when this happens:

=======================================
VERIFIER STOP 00000008: pid 0x1948: Corrupted heap block.

 00161000 : Heap handle used in the call.
 38226E30 : Heap block involved in the operation.
 000001CC : Size of the heap block.
 00000000 : Reserved


=======================================
This verifier stop is not continuable. Process will be terminated
when you use the `go' debugger command.

=======================================

(1948.1fcc): Break instruction exception - code 80000003 (first chance)
eax=1000e848 ebx=1000cd44 ecx=00000001 edx=0012c151 esi=00000000 edi=1000e848
eip=7c90120e esp=0012c1e4 ebp=0012c3e8 iopl=0         nv up ei pl nz na po nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000202
ntdll!DbgBreakPoint:

Then, I run the following commands in WinDbg to get the stack:

0:000> dt _DPH_BLOCK_INFORMATION 38226E30-0x20
vfbasics!_DPH_BLOCK_INFORMATION
   +0x000 StartStamp       : 0xabcdbbbb
   +0x004 Heap             : 0x00161000
   +0x008 RequestedSize    : 0x1cc
   +0x00c ActualSize       : 0x1000
   +0x010 DelayQueueEntry  : _DPH_DELAY_FREE_QUEUE_ENTRY
   +0x010 BusyListEntry    : _LIST_ENTRY [ 0xe297 - 0x0 ]
   +0x010 Block            : 0x0000e297 _DPH_HEAP_BLOCK
   +0x018 StackTrace       : 0x3808604c
   +0x01c EndStamp         : 0xdcbabbbb

0:000> dds 0x3808604c
3808604c  abcdaaaa
38086050  00000001 <Unloaded_Ed20.dll>
38086054  00000010 <Unloaded_Ed20.dll>+0xf
38086058  00000000
3808605c  00000000
38086060  00000000
38086064  2da5ef10 <Unloaded_Ed20.dll>+0x2da5ef0f
38086068  3808606c <Unloaded_Ed20.dll>+0x3808606b
3808606c  7c94b394 ntdll!RtlAllocateHeapSlowly+0x44
38086070  7c918f21 ntdll!RtlAllocateHeap+0xe64
38086074  0038fd2c vfbasics!AVrfpRtlAllocateHeap+0xb1 [d:\avrf\source\base\avrf\vrfcommon\heap.c @ 234]
38086078  7e721f7a sxs!operator new+0x16
3808607c  7e768bb8 sxs!FusionWin32AllocateArray<unsigned char>+0x46
38086080  7e768e74 sxs!FusionWin32ResizeArray<unsigned char>+0x83
38086084  7e769028 sxs!CFusionArray<unsigned char,unsigned char,0,0,1>::Win32SetSize+0x55
38086088  7e76a018 sxs!SxsLookupClrGuid+0x293
3808608c  79f0ce6b mscorwks!FindShimInfoFromWin32+0x10f
38086090  79f0d330 mscorwks!AppDomain::LoadCOMClass+0xaa
38086094  79f0d45c mscorwks!GetTypeForCLSID+0x35
38086098  7a009449 mscorwks!EEDllGetClassObject+0x2ef
3808609c  7a001882 mscorwks!InternalDllGetClassObject+0xc6
380860a0  79f27dc3 mscorwks!DllGetClassObjectInternal+0x5c
380860a4  79016f69 mscoree!DllGetClassObject+0x12c
380860a8  775022e2 ole32!CClassCache::CDllPathEntry::DllGetClassObject+0x2d
380860ac  abcdaaaa
380860b0  00000001 <Unloaded_Ed20.dll>
380860b4  00000010 <Unloaded_Ed20.dll>+0xf
380860b8  00000000
380860bc  00000000
380860c0  00161000 <Unloaded_Ed20.dll>+0x160fff
380860c4  37f7fbb4 <Unloaded_Ed20.dll>+0x37f7fbb3
380860c8  380860cc <Unloaded_Ed20.dll>+0x380860cb

0:000> kP 200
ChildEBP RetAddr 
0012c1e0 10003b68 ntdll!DbgBreakPoint
0012c3e8 100078c9 vrfcore!VerifierStopMessageEx(
   struct _AVRF_LAYER_DESCRIPTOR * LayerDescriptor = 0x1000c540,
   unsigned long StopCode = 8,
   unsigned long Param1 = 0x161000,
   unsigned long Param2 = 0x38226e30,
   unsigned long Param3 = 0x1cc,
   unsigned long Param4 = 0,
   struct _AVRF_STOP_EXTRA * StopExtra = 0x00000000)+0x4d1 [d:\avrf\source\base\avrf\avrf30\vrfcore\sdk.cpp @ 551]
0012c40c 7c96b376 vrfcore!VfCoreRedirectedStopMessage(
   unsigned long Code = 8,
   char * Message = 0x7c96b61c "corrupted suffix pattern",
   unsigned long Param1 = 0x161000,
   char * Description1 = 0x7c96b610 "Heap handle",
   unsigned long Param2 = 0x38226e30,
   char * Description2 = 0x7c96b604 "Heap block",
   unsigned long Param3 = 0x1cc,
   char * Description3 = 0x7c96b5f8 "Block size",
   unsigned long Param4 = 0,
   char * Description4 = 0x7c96b5f7 "")+0x81 [d:\avrf\source\base\avrf\avrf30\vrfcore\stopredirect.cpp @ 103]
0012c488 7c96c6a0 ntdll!RtlpDphReportCorruptedBlock+0x17c
0012c4dc 7c96f6f3 ntdll!RtlpDebugPageHeapFree+0xc7
0012c550 7c94bc4c ntdll!RtlDebugFreeHeap+0x2c
0012c638 7c927573 ntdll!RtlFreeHeapSlowly+0x37
0012c708 0038fe9c ntdll!RtlFreeHeap+0xf9
0012c750 7e728993 vfbasics!AVrfpRtlFreeHeap(
   void * HeapHandle = 0x00160000,
   unsigned long Flags = 0,
   void * BaseAddress = 0x000001cc)+0xf8 [d:\avrf\source\base\avrf\vrfcommon\heap.c @ 385]
0012c764 7e79d674 sxs!operator delete+0x1c
0012c770 7e768fc1 sxs!FusionFreeArray<CFusionFilePathAndSize *>+0x13
0012c780 7e76a129 sxs!CFusionArray<unsigned char,unsigned char,0,0,1>::~CFusionArray<unsigned char,unsigned char,0,0,1>+0x10
0012c7d0 79f0ce6b sxs!SxsLookupClrGuid+0x3a4
0012ca44 79f0d330 mscorwks!FindShimInfoFromWin32+0x10f
0012cb3c 79f0d45c mscorwks!AppDomain::LoadCOMClass+0xaa
0012cb68 7a009449 mscorwks!GetTypeForCLSID+0x35
0012cc10 7a001882 mscorwks!EEDllGetClassObject+0x2ef
0012cc4c 79f27dc3 mscorwks!InternalDllGetClassObject+0xc6
0012cc88 79016f69 mscorwks!DllGetClassObjectInternal+0x5c
0012ccd0 775022e2 mscoree!DllGetClassObject+0x12c
0012ccec 775119a0 ole32!CClassCache::CDllPathEntry::DllGetClassObject+0x2d
0012cd04 775116ba ole32!CClassCache::CDllFnPtrMoniker::BindToObjectNoSwitch+0x1f
0012cd30 7751120f ole32!CClassCache::GetClassObject+0x38
0012cdac 775110b3 ole32!CServerContextActivator::CreateInstance+0x106
0012cdec 77511302 ole32!ActivationPropertiesIn::DelegateCreateInstance+0xf7
0012ce40 77511279 ole32!CApartmentActivator::CreateInstance+0x110
0012ce60 775120c8 ole32!CProcessActivator::CCICallback+0x6d
0012ce80 7751207f ole32!CProcessActivator::AttemptActivation+0x2c
0012ceb8 77511363 ole32!CProcessActivator::ActivateByContext+0x42
0012cee0 775110b3 ole32!CProcessActivator::CreateInstance+0x49
0012cf20 7751104e ole32!ActivationPropertiesIn::DelegateCreateInstance+0xf7
0012d170 775110b3 ole32!CClientContextActivator::CreateInstance+0x8f
0012d1b0 77510ef8 ole32!ActivationPropertiesIn::DelegateCreateInstance+0xf7
0012d960 77500575 ole32!ICoCreateInstanceEx+0x3c9
0012d988 77500544 ole32!CComActivator::DoCreateInstance+0x28
0012d9ac 775005b2 ole32!CoCreateInstanceEx+0x1e
0012d9dc 3809e4e7 ole32!CoCreateInstance+0x37
0012da90 38091e28 MyCode!CMyCode::CMycode(void)+0x187 [c:\...\mycode.cpp @ 123]

Searching the web, I have only seen one reference to this issue:
http://www.eggheadcafe.com/software/aspnet/30413116/heap-corruption-issue-usi.aspx

It had an almost identical stack trace, but that was from 2007.

Is this a common or a known issue? Is there a hotfix or at least a workaround. Even though this issue does not cause any problems and execution continues on, we do notice, intermittently, some access violation crashes with heap corruption. So, I am not sure whether the heap corruption that the CFusionArray seems to introduce might be inducing the AVs later on when that location on the heap is being accessed...

Any help will be really appreciated.

[Edit: FWIW, this is happening on an XP SP3 machine with 3 GB RAM]

sn.exe exit code documentation ?

$
0
0
Hi,

When one calls sn.exe, what are the expected error codes (errorlevel) in return ?

I'm using delay signing. I think about three cases when achieving the final signing:
- assembly was signed successfully (seems to be errorlevel 0)
- assembly was not signed because it's already signed with the provided key
- assembly could not be signed (either because it's already signed with another key, or file not found etc)

I could not find anything related to those exit codes in the documentation. Is there any official reference for that ?

kind regards

Thibaut Barrère

pass SAFEARRAY of BSTR from C++ to C# DLL

$
0
0

My code is soemthing like

BSTR vb[20]; //heap alloc or _bstr_t no help

SAFEARRAY* sa = SafeArrayCreateVector(VT_BSTR, 0, 20);

long m =0;

SafeArrayPutElement(sa, &m, vb);

_exten_obj->GetData(sa); //C# DLL void GetData(string[]) in which correctly populates the string[]

//vb contains unrecognized texts; regardless of char set to unset, UNICODE or MBCS

SafeArrayGetElement(sa, &m, (void*)vb); //did not help

Any idea?

TargetException while raising COM event for interop

$
0
0

Hi experts,

I've one DLL loaded in two Internet Explorer Windows. While loading the first one, a singleton is created. This singleton raises COM events, which are received by JavaScript in the Internet Explorer windows. This works fine and both IE windows are getting the events. The whole scenario works on my development machine. After deploying everything to a production machine, I get a TargetException (the object does not match the target type) when raising the COM event, but only when a function in the singleton is called from the second IE window. When I call a function from singleton instance from the first IE window everything works fine and I receive the events. I am completely lost because it works on my dev machine.

My event is defined in an interface, however the delegate is created within the singleton class.

The event definition:

  [Guid("6FA477D9-85C7-4bf3-9D53-F5440AD7164F")]

  [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]

  [ComVisible(true)]

  public interface IOcsExposedEvents

  {


    void CallStatusEvent(string message);

  }

The function definition raising the event :

[Guid("3F088DF3-2C22-4b81-8D28-68547665E706"),
InterfaceType(ComInterfaceType.InterfaceIsDual),
ComVisible(true)]

public interface IOcsIntegrator

{


  int call(string sip_uri);

}


My event delegate (defined in the singleton class):

public delegate void CallStatusDelegate(string message);


public event CallStatusDelegate CallStatusEvent;

 

And finally raising the event:

public int call(string sip_uri)

{
  _callStatus = CallStatus.disconnected;

  CallStatusEvent(_callStatus.ToString());
}

 

 

Any help is really appreciated!

System.ComponentModel subclass instantiation very slow when optimize is enabled in a .net 4.0 x64 VB project

$
0
0

Hi,

Our company is facing a crucial performance issue with component instantiation (using Component Model). We currently use .net 3.5 for most of our products and we cannot migrate to .net 4.0/4.5 because of that performance issue. The problem only occurs when the component loads for the first time and in the following commonly used conditions:
- Optimization is enabled
- Component is in VB.NET
- Target framework is .net 4.0 or later
- Solution platform is x64

If the component contains a lot of subcomponents, the creation of the instance of the class takes several seconds. In our case, the class contains 300 child components and takes 53 seconds to be instantiated with the above conditions. If we change one of the above conditions, the performance issue disappears. Moreover, we have noticed a huge memory and CPU usage during that time.

We have attached a sample project (VB.NET console application) with a basic UserControl with several sub components. The application creates 4 instances of the UserControl in a row and displays the elapsed time between each new instance. In regular cases, the first instance takes 80/200ms to be created. However, with the above conditions, the first instance takes almost 4s to be created. That’s 50/20 times slower. Even with a basic configuration, we noticed that enabling optimizations increase load time by 5 (60ms to 300ms).
From what we saw and analyzed, it seems to be a JIT compiler issue.

Download sample project: https://dl.dropboxusercontent.com/u/20096697/msdn_vb_new_component_issue.zip

Please note that the issue is not present while debugging the application within Visual Studio or using any profiler other than “sampling” mode.

We are currently running on Windows 7 x64 with .net 4.5 and Visual Studio 2012 installed.

Does anyone have any information about this behavior?

Thanks a lot.

asp.net master page designing

$
0
0
please tell me how to navigate pages in master page designing process

pinned heap objects

$
0
0

Hello *,

 

we have a Windows Forms Desktop Application written in VB.NET. The components of our GUI we call „formular“ (inherits Windows.Forms.Form).  After recognizing OutOfMemoryExceptions at our customers and seeing that the memory of the application increases when opening one formular after another or the same many times we debugged the application with WinDbg (with sos and sosex). It turns out that the GC was moving the instances of formulars up to Generation 2 and they were living there the whole time while the application was open although the formular.Dispose() method is explicitly called. The !gcroot command for the formulars shows that they all have root-handles which are pinned and the path to the root seems to be similar for each formular. By climbing up the path from the formular up to the root (by sosex !refs) we ended up that some children aren’t connected to their shown parent. So the question is: How can we find out why the formulars are pinned?

 

Below is the result of one !gcroot command for the formular “frmLohnarten”. It may be worth knowing that DataStart.Main is the main class of the application.

 

Thread 11f4:

   0015ebc4 68f1ee58 System.Windows.Forms.Application+ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr, Int32, Int32)

       ebp+50: 0015ebf0

           ->  021e64c0 System.Windows.Forms.Application+ComponentManager

           ->  021e6520 System.Collections.Hashtable

           ->  021e6554 System.Collections.Hashtable+bucket[]

           ->  021e6510 System.Windows.Forms.Application+ComponentManager+ComponentHashtableEntry

           ->  021b3a74 System.Windows.Forms.Application+ThreadContext

           ->  021c86f8 System.Threading.ThreadExceptionEventHandler

           ->  021b28b4 DataStart.My.MyApplication

           ->  021b376c Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase+WinFormsAppContext

           ->  021c9bfc DataStart.Main

           ->  021ce890 System.ComponentModel.EventHandlerList

           ->  02e0ad70 System.ComponentModel.EventHandlerList+ListEntry

           ->  02e0ab54 System.ComponentModel.EventHandlerList+ListEntry

           -> 02e071d8 System.ComponentModel.EventHandlerList+ListEntry

           ->  021e0ec4 System.ComponentModel.EventHandlerList+ListEntry

           ->  021e0eb0 System.ComponentModel.EventHandlerList+ListEntry

           ->  07e0f35c System.EventHandler

           ->  07e0f32c System.Object[]

           ->  0ab42a28 System.EventHandler

           ->  0ab270a4 System.Windows.Forms.ToolTip

           ->  0ab27118 System.Collections.Hashtable

           ->  0ab2b218 System.Collections.Hashtable+bucket[]

           ->  0ab28ec8 Data.NumericUpDownNoMouseWheel

           ->  0ab29014 System.Windows.Forms.PropertyStore

           ->  0ab2eae4 System.Windows.Forms.PropertyStore+ObjectEntry[]

           ->  0ab2c1bc System.Windows.Forms.ContextMenuStrip

           ->  0ab2c458 System.ComponentModel.EventHandlerList

           ->  0ab2e97c System.ComponentModel.EventHandlerList+ListEntry

           ->  0ab2e8d8 System.ComponentModel.EventHandlerList+ListEntry

           ->  0ab2e8c4 System.ComponentModel.EventHandlerList+ListEntry

           ->  0ab2e884 System.ComponentModel.CancelEventHandler

           ->  0ab26d9c Data.CFilter2

           ->  0ab26fc0 System.ComponentModel.EventHandlerList

           ->  0774c7b0 System.ComponentModel.EventHandlerList+ListEntry

           ->  0774c790 System.Windows.Forms.MouseEventHandler

           ->  0ab1d538 Lohn.frmLohnarten

 

HandleTable:

   001b13ec (pinned handle)

   -> 031b3338 System.Object[]

   -> 021ce49c System.Collections.Generic.Dictionary`2[[System.Object, mscorlib],[System.Collections.Generic.List`1[[Microsoft.Win32.SystemEvents+SystemEventInvokeInfo, System]], mscorlib]]

   -> 021ce7c0 System.Collections.Generic.Dictionary`2+Entry[[System.Object, mscorlib],[System.Collections.Generic.List`1[[Microsoft.Win32.SystemEvents+SystemEventInvokeInfo, System]], mscorlib]][]

   -> 021d644c System.Collections.Generic.List`1[[Microsoft.Win32.SystemEvents+SystemEventInvokeInfo, System]]

   -> 0ae0db60 System.Object[]

   -> 0abeb4f4 Microsoft.Win32.SystemEvents+SystemEventInvokeInfo

   -> 0abeb4d4 Microsoft.Win32.UserPreferenceChangedEventHandler

   -> 0abe7078 System.Windows.Forms.ContextMenuStrip

   -> 0abe7314 System.ComponentModel.EventHandlerList

   -> 0ac2d4cc System.ComponentModel.EventHandlerList+ListEntry

   -> 0abf23cc System.ComponentModel.EventHandlerList+ListEntry

   -> 0abf23b8 System.ComponentModel.EventHandlerList+ListEntry

   -> 0abf2378 System.ComponentModel.CancelEventHandler

   -> 0abdd070 Data.AdvDataGridView

   -> 0abdd3cc System.ComponentModel.EventHandlerList

   -> 0abe6bb0 System.ComponentModel.EventHandlerList+ListEntry

   -> 0abe6c1c System.EventHandler

   -> 0abe6c04 System.Object[]

   -> 0abe6b90 System.EventHandler

   -> 0abe6b70 Data.Aktivierungsstack

   -> 0abdd9bc System.Windows.Forms.DataGridView

   -> 0abe6808 System.Windows.Forms.DataGridView+DataGridViewDataConnection

   -> 0abe6748 System.Data.DataView

   -> 0ab2fe6c System.Data.DataTable

   -> 0ab2fbf0 System.Data.DataSet

   -> 0ab2fc5c System.Data.DataTableCollection

   -> 0ab2fc80 System.Collections.ArrayList

   -> 0ab406e0 System.Object[]

   -> 0ab3d270 System.Data.DataTable

   -> 0ad566e4 System.Data.DataRowChangeEventHandler

   -> 0ad06054 Data.AdvDataGridView

   -> 0adff3c4 System.EventHandler`1[[Data.AdvDataGridView+CellCancelEventArgs, DataBasis]]

   -> 0ab1d538 Lohn.frmLohnarten

Regards,

David


aspnet_regiis error when encrypting connectionStrings

$
0
0

 

I have a website whose domain is www.myWebsite.com and on my server it is located in a directory on my c: drive at the following physical path:

   c:\dirVirtual\myWebsite

I have a connection string defined in my web.config in the connectionString section.

<connectionStrings>

   <add name="myConnectionString" connectionString="Data Source = 1.2.3.4; Initial Catalog = XYZ; UserID=user;Passowrd=xyz" providername="System.Data.SqlClient" />

</connectionStrings>

I go to the c:\Windows\Microsoft.Net\FrameWork\2.050727 directory and there run the following command to try to encrypt this section:

aspnet_regiis -pe "connectionStrings" -app "/myWebsite" -prov DataProtectionConfigurationProvider

When I do this I get an error

Encrypting configuration section...
A configuration file cannot be created for the requested Configuration object.
Failed!

The -app parameter says it is supposed to be the virtual path but I'm not certain I have that correct. I don't know where to look to see what the virtual name is.

I have been able to successfully encrypt other websites on the same server. Is there any way to find out what the error really is?

Thanks,

Bob

Supports multi-platform technology selection?

$
0
0
I now want a product that general idea is that,
A server,
There are many clients: WinForm, Web, IOS, Android, WP8, and supporting GOOGLE account verification, also open API  for third parties to develop.

In fact, this framework is currently the world there are many, such as GOOGLE, Amazon, Apple are such practices.

I do not know what such a system should be chosen technology.

My initial thought follows:
1, if you want to fit so many clients, this at least use JSON data format or XML, JSON lighter view, should be the preferred JSON
2, support GOOGLE account verification, it should be OpenID technology; support open API, it should be OAuth2.0 technology, so should reference DotNetOpenAuth
3, for the service side of the technology selection is the most tangled, WCF fact, I am most familiar, but the client when the first connection is very slow, so I think that WCF is not suitable;
       WCF Data Service data types because it is open, I think an open database structure is not a good thing out, I saw GOOGLE, Apple did not open out, moreover full with EF, I think controlling a single field is not flexible (I may be right EF understand enough), so I think it is not suitable for WCF DATA SERVICE
       Excluded from the above two, only ASP.NET WEB API Microsoft platform, this is a new out of something, I see only go HTTP, very lightweight, have not used, do not know ASP.NET WEB API can not afford such a great pressure, or it is appropriate to do this kind of system?

This is just my personal opinion, it may not described, please know that Friends of the altar gets advice, thank you very much!

相信自己,坚持下去。

how to register a dll into Assembly (Gac) in windows server 2008 r2 without windows sdk and Vs2010 but installed with .net framework 2.0 and 3.5

$
0
0

Hi Team,

We are doing migration project.

The database sql server 2008 is intallled in a machine and this machine  has .net framework 2.0 and 3.5

But VS2010 and windows sdk not installed.

We are not allowed to install any software.

But our requriement is to register a dll into GAC of this machine.How can we do this without VS2010  and windows SDK


ilikemicrosoft

.NET Runtime error in event log on running a a win32 process that uses a mixed mode .Net 2.0 assembly which is launched from .Netframework 4.0 using the useLegacyV2RuntimeActivationPolicy

$
0
0

Description:
Here is the exact error in eventlog:
".NET Runtime version 4.0.30319.18033 - There was a failure initializing profiling API attach infrastructure.  This process will not allow a profiler to attach.  HRESULT: 0x80004005.  Process ID (decimal): 2976.  Message ID: [0x2509]."

The process does work as expected except this error in event log which is a concern though we have not see any issues arising out of this error but we want to proactively deal with it. The reason for running the .Net 2.0 assembly in .Net 4.0 is to avoid the dependency on .Net 2.0 if it is not available on the machine. I want to know a way to get rid off the error in evenlog and also the issues it can possible cause due to the reported error. In advance thanks for your time helping me on this!

EnumerateInstalledRuntimes is not giving all runtimes

$
0
0

I am using EnumerateInstalledRuntimes to enumerate installed .NET Frameworks on win8 x64 platform.

I am getting v2.0.50727 and v4.0.30319 but nothing for 3.0, 3.5, or 4.5 etc.   I have VS2010, VS2012 installed and expecting to have all the frameworks. Any help?

CComPtr<ICLRMetaHost> pICLRMetaHost;

HRESULT hr = ::CLRCreateInstance(CLSID_CLRMetaHost, IID_ICLRMetaHost, (LPVOID*)&pICLRMetaHost);

if(FAILED(hr))throw_com_error(hr);

CComPtr<IEnumUnknown> pIEnumUnknown;

hr = pICLRMetaHost->EnumerateInstalledRuntimes(&pIEnumUnknown);

Reading .NET 4.0 dump files in WinDBG

$
0
0

I'm familiar with the WinDBG paradigm. Been reviewing a lot of dump files using WinDBG x64 version. For the most part dump files were  .NET 2.0 applications and psscor2.dll. Current WinDBG version I am using is 6.12.0002.633. Recently, I've been trying to open x64 dump IIS dump files generated from a .NET 4.0 application pool using psscor4.dll. Any command I run returns, "Failed to request <Command> information"

  1. I've mscordacwks.dll from c:\Windows\Microsoft.NET\Framework64\v4.0.30319 on the server
  2. Renamed to mscordackwks_AMD64_AMD64_4.0.30319.xxxx.dll. xxxx matches the compiled version in the file
  3. Open WinDBG, open the dump file and add the path to the above DLL to exepath
  4. Run a basic command !eeversion to check all is fine and I get GC Heap not initialized, so GC mode is not determined yet.
    In plan phase of garbage collection
  5. Next I type !threads and get, Failed to request ThreadStore
  6. Next !threadpool and I get, Failed to request ThreadpoolMgr information

I done some basic google search with these error messages and they all point to not having the correct mscordacwks.dll or opening x86 files in WinDBG x64 or x64 files in WinDBG x86. Didn't sound relevant to me

Any help/guidance is much appreciated

KEADAKASA2010

$
0
0
What is a P9: invalidoperationexception  on a download?

ANTS profiler results and fragmentation issue

$
0
0

I am using the ANTS memory profiler for analyzing the continuous increase in memory consumption of a .NET application. I am facing an issue in understanding one of the components of the profiler results.

In the image of the summary tab of the results -

It shows the largest fragment being 67.66 MB, unused memory by .NET 625.3 MB and size of objects on large object heap as 112 KB.

When the large object heap is so small, how can there be fragmentation ? And shouldn't the size of the largest fragment be more or less same as the unused .NET space ? Or am I missing something ?





DebugDiag Memory Pressure analysis doubt

$
0
0

I am using DebugDiag 1.2 to perform memory analysis of a .NET application.

On taking a dump, and analyzing non .NET memory (third option on Advanced Analysis tab of the tool), I see two sections -

Virtual Memory Summary
Size of largest free VM block   6.24 TBytes 
Free memory fragmentation   21.92% 
Free Memory   7.99 TBytes   (99.93% of Total Memory) 
Reserved Memory   4.06 GBytes   (0.05% of Total Memory) 
Committed Memory   1.49 GBytes   (0.02% of Total Memory) 
Total Memory   8.00 TBytes 
Largest free block at   0x00000005`16fc6000 

and -

Virtual Allocation Summary
Reserved memory   3.96 GBytes 
Committed memory   1.08 GBytes 
Mapped memory   13.87 MBytes 
Reserved block count   58 blocks 
Committed block count   102 blocks 
Mapped block count   37 blocks 

Which of these pertain to the process im monitoring ? The private bytes for my process reported at the time the dump was taken are 1.43 GB.

RequiredRuntime Option in Machine.config?

$
0
0

Hi,

The requirement is to force a .NET 4.0 DLL to run in a .NET 2.0 Environment -  .NET Framework 4.0 runtime would not be installed due to various contraints. I would like to understand if it is possible set the requiredruntime option in the machine.config file to impose this setting for the entire machine so that all Applications will use the .NET Framework 2.0 runtime?

Regards,

Vikram


Blog: http://dotnetupdate.blogspot.com |

after I use CLRHost to launch a C# App, the API SetUnhandledExceptionFilter cannot work

$
0
0

I had make a c++ launcher to host clr because of the problem of "CoInitializeSecurity", I use ICLRRuntimeHost.ExecuteInDefaultAppDomain to start a managed method which calls App.Main to run the C# app.
But there rise a new problem, before I use ICLRRuntimeHost to host C# app, SetUnhandledExceptionFilter will hook SEH exceptions, in which I would like to do some thing like writing a MiniDump, now the callback set by SetUnhandledExceptionFilter can't be call any more, instead c# will catch System.Runtime.InteropServices.SEHException by set Application.Current.DispatcherUnhandledException(WPF).

The app interoperates to a native dll via p/invoke, so it's the best if can it record a MiniDump when crash happened in native dll. Can anyone help me? Thanks. 

Random AppCrashes in clr.dll with .NET 4.0

$
0
0

Hi Everyone !

We are developing a 100% managed .NET Application/C# that consists of several Windows-Services and Client-Applications. Until April 2010 the Target was .Net 3.5 SP1. Meanwhile we converted all Projects to target .NET 4.0. And now we are expierencing APP-Crashes which happens every now and then (1 or twice a Week) if we are running our Tests on Win7 or 2008 R2.

The Faults are of Sort: 

Faulting application name: DoX.FX.ServerHostLoader.exe, version: 0.1.16070.73, time stamp: 0x4c403ab2

Faulting module name: clr.dll, version: 4.0.30319.1, time stamp: 0x4ba21eeb

Exception code: 0xc0000005

Fault offset: 0x00000000000026fe

Faulting process id: 0x5e8

Faulting application start time: 0x01cb404b8b0740a1

Faulting application path: C:\DoX.FX.ServerHostLoader.exe

Faulting module path: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll

Report Id: 2311172d-afbc-11df-9ded-0002b3c23d42

 

In some cases I get a Mini-Dump which I was able to debug to a certain point, the Methods where the crash happens are different e.g.

Process Architecture: x64
Exception Code: 0xC0000005
Exception Information: The thread tried to read from or write to a virtual address for which it does not have the appropriate access.
Heap Information: Not Present

System Information
------------------
OS Version: 6.1.7600
CLR Version(s): 4.0.30319.1

> clr.dll!JIT_ChkCastClassSpecial()  + 0x1e bytes 
  [Managed to Native Transition] 
  mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool ignoreSyncCtx) + 0xa1 bytes 
  mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x3b bytes 
  mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() + 0x4d bytes 
  [Native to Managed Transition] 
  kernel32.dll!BaseThreadInitThunk()  + 0xd bytes 
  ntdll.dll!RtlUserThreadStart()  + 0x21 bytes 

We now rolled back all our projects to .NET 3.5 Target, and the above AppCrash did not occur anymore (In a 1-Week continous Test). So we went searching for this error but suprisingly there are only few others that reported this error. Since this is an internal CLR-Error of .NET 4.0 we cannot believe that we are the only ones having this problem. But maybe the are more around also still trying to find a reason for it ? Would be glad to ge some Idea about this.

Sigi

 

 

 

 

Viewing all 1710 articles
Browse latest View live