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

Garbage collector causes Excel to crash

$
0
0

Hi,

I have an application designed to target .NET 4.0. The application registers some classes to COM.

I use these classes from Excel VBA.

When I throw a COMException from the application, Excel crashes, pointing to clr.dll (APPCRASH).

Now, in versions 4.0 and 4.5 everything works fine, I throw the exception, the error handler handles it and presents to the user in a message box. However, in 4.5.1 and 4.5.2, Excel would crash.

It is both Excel 2010 and 2013, and I have Windows 7 x64-bit installed, while the application itself s 32-bit.

Thanks in advance!


XmlSerializers with addin outlook

$
0
0

I’m trying to create add-in for outlook and have issue with deserialization and antivirus program.

I’ve noticed that when my add-in tried to deserialize any data, .NET framework created temporary dll in “C:\Users\{UserName}\AppData\Local\Temp\" folder.
This dll existed very short time, but from time to time antivirus locked it and add-in thrown error message thatfile is used by another process.

I’m tried to get rid of temporary dll and found recommendations to use sgen tool for creation of XmlSerializers.dll.

I generated MyAssembly. XmlSerializers.dll with strong name and placed it to the folder with add-in (C:\Program Files (x86)\MyAddin). But it doesn’t help.

Then I tried to place MyAssembly. XmlSerializers.dll to GAC and then to outlook folder, but had no success. When dll was called from GAC I got following error message, but dll has no any reference.

"System.IO.FileNotFoundException: Could not load file or assembly or one of its dependencies. The system cannot find the file specified."

Please add any thoughts how can I to get rid of temporary dll


unsigned int32 is verifier-assignable-to enum A, but unbox.any throws InvalidCastException

$
0
0

Consider the following C# console application.

using System;

class Program
{
    enum A { A42 = 42 }

    static void Main()
    {
        object obj = 42;
        Console.WriteLine(obj.GetType().Name);  /* "Int32" */
        Console.WriteLine(obj is int); /* "True" */
        Console.WriteLine(obj is A); /* "False" */

        A a = (A)obj;
        Console.WriteLine(a); /* "A42" */
    }
}

It compiles to the following:

.class private auto ansi beforefieldinit Program
       extends [mscorlib]System.Object
{
  .class auto ansi sealed nested private A
         extends [mscorlib]System.Enum
  {
    .field public specialname rtspecialname int32 value__
    .field public static literal valuetype Program/A A42 = int32(0x0000002A)
  } // end of class A

  .method private hidebysig static void  Main() cil managed
  {
    .entrypoint
    // Code size       71 (0x47)
    .maxstack  2
    .locals init ([0] object obj,
             [1] valuetype Program/A a)
    IL_0000:  ldc.i4.s   42
    IL_0002:  box        [mscorlib]System.Int32
    IL_0007:  stloc.0
    IL_0008:  ldloc.0
    IL_0009:  callvirt   instance class [mscorlib]System.Type [mscorlib]System.Object::GetType()
    IL_000e:  callvirt   instance string [mscorlib]System.Reflection.MemberInfo::get_Name()
    IL_0013:  call       void [mscorlib]System.Console::WriteLine(string)
    IL_0018:  ldloc.0
    IL_0019:  isinst     [mscorlib]System.Int32
    IL_001e:  ldnull
    IL_001f:  cgt.un
    IL_0021:  call       void [mscorlib]System.Console::WriteLine(bool)
    IL_0026:  ldloc.0
    IL_0027:  isinst     Program/A
    IL_002c:  ldnull
    IL_002d:  cgt.un
    IL_002f:  call       void [mscorlib]System.Console::WriteLine(bool)
    IL_0034:  ldloc.0
    IL_0035:  unbox.any  Program/A
    IL_003a:  stloc.1
    IL_003b:  ldloc.1
    IL_003c:  box        Program/A
    IL_0041:  call       void [mscorlib]System.Console::WriteLine(object)
    IL_0046:  ret
  } // end of method Program::Main

  .method public hidebysig specialname rtspecialname
          instance void  .ctor() cil managed
  {
    // Code size       7 (0x7)
    .maxstack  8
    IL_0000:  ldarg.0
    IL_0001:  call       instance void [mscorlib]System.Object::.ctor()
    IL_0006:  ret
  } // end of method Program::.ctor

} // end of class Program
Although obj refers to a boxed Int32 rather than a boxed A, the unboxing conversion (A)obj succeeds at run time. This behavior is specified in Standard ECMA-335 "Common Language Infrastructure (CLI)", 6th Edition:
  1. §I.8.7 ("Assignment compatibility"): "The underlying type of a type T is the following: 1. If T is an enumeration type, then its underlying type is the underlying type declared in the enumeration's definition. 2. Otherwise, the underlying type is itself." Thus, the underlying type of both A and int32 is int32.
  2. §I.8.7: "The reduced type of a type T is the following: 1. If the underlying type of T is: […] c. int32, or unsigned int32, then its reduced type is int32." Thus, the reduced type of both A and int32 is int32.
  3. §I.8.7: "The verification type (§III.1.8.1.2.1) of a type T is the following: 1. If the reduced type of T is: […] c. int32 then its verification type is int32." Thus, the verification type of both A and int32 is int32.
  4. §III.1.8.1.2.3 ("Verification type compatibility"): "A type Q isverifier-assignable-to R (sometimes written R := Q) if and only if T is the verification type of Q, and U is the verification type of R, and at least one of the following holds: 1. T is identical to U." Thus, A is verifier-assignable to int32 and vice versa.
  5. §III.4.33 ("unbox.any – convert boxed value type to value"): "System.InvalidCastException is thrown ifobj is not a boxed value type, typeTok is a Nullable<T> andobj is not a boxed T, or if the type of the value contained in obj is not verifier-assignable-to (§III.1.8.1.2.3) typeTok." Thus, InvalidCastException is not thrown.

However, if I change the initialization to "object obj = 42U;", then Microsoft .NET Framework 4.5.1 actually throws InvalidCastException. Why does that happen? If I understand correctly, the reduced type and verification type are int32 in this case too, so the unbox.any instruction should not throw InvalidCastException.



IL Rewrite works on x86 but fails on x64

$
0
0

Hello, I am trying to inject some code to System.Data dll so that i can log some of the DB calls made for my experiment purpose. Here is the original article http://www.dupuis.me/node/18

I am attaching ICorprofiler and getting the ModuleLoadFinished callback and i inject the code to log in interested methods. It works fine on x86 mode however it fails on x64 mode, i get following exception while running.

 <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Critical"><TraceIdentifier>http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/Unhandled</TraceIdentifier><Description>Unhandled exception</Description><AppDomain>TestApplication.exe</AppDomain><Exception><ExceptionType>System.InvalidProgramException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Common Language Runtime detected an invalid program.</Message><StackTrace>   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() 

Even when i change the code to just copy the old bytes to new memory and pass it back it crashes( ie, i am not injecting anything new). I am using GetILFunctionBodyAllocator to get the allocator and allocate the memory.

Memcopy to copy the headers and code

COR_ILMETHOD_FAT* newFatImage = (COR_ILMETHOD_FAT*)&(pNewMethod->Fat);
memcpy((BYTE*)newFatImage, (BYTE*)fatImage, fatImage->Size * sizeof(DWORD));

memcpy(newFatImage->GetCode(), fatImage->GetCode(),  fatImage->CodeSize);

and finally, setting the new body

pCorInfos->SetILFunctionBody(moduleID, tkMethod, (LPCBYTE)pNewMethod);

I dont know what is going on wrong here. I am Also subscribing to ETL callbacks, so that i get to inject the IL to the NGENed System.Data.dll. And it works fine on x86. Not 




Gp

Why is there a threshold violation in running load test?

$
0
0

Hi,

I am using VS2012 and I have setup my local machine under counter set. However, while running the load test I am getting threshold violations. What causes these violation and how can I prevent my load test from getting this threshold violation.

See screenshot below:

Trying to understand solutions with multiple projects that target different .NET framework versions

$
0
0

I have a solution with 3 projects.  Two of the projects target .NET framework 4.0 and the other one targets .NET framework 3.5. 

The two that target .NET 4.0 have reports that get generated and exported when they are called by the one that targets .NET 3.5.  

I want to have a better understanding of when it's okay to use projects in the same solution that target different versions of the .NET framework and when it's not.  Using the example above, the calling project targets an older version while the ones being "called" target newer versions.  

I think this is fine in this scenario because the older "calling" one is just rendering the reports from the others programmatically and not trying to use a .NET feature that was added to the framework after 3.5.  I wonder if this would be true, if I was trying to use a .NET 4.0 feature in the older 3.5 project though.

When is it necessary to ensure all projects in the same solution target the same version of the .NET framework and when isn't it?  Can a project that targets an older version always call code from another project that targets a newer version?  I assume the answer to the second question is probably no, but I'm curious if anyone has any opinions on this.

 

Curiosity about Lazy version classic (manual) lazy

$
0
0

Lazy loading, a life's bread of many developers, and a valuable tool for operation management.

THat being said there are a few ways to handle lazy loading, and with the advent of .Net 4.0 there is this wonderful nifty little Lazy<> generic class.  However, given a few examples I question it's over head, as well as it's possible benefits with complicated lazy evaluations.  So to begin:

private MyClass _myClass;
public MyClass MyClass
{
   get {
     if (_myClass == null) _myClass = new MyClass();
     return _myClass;
   }
}

private Lazy<MyClass> _myClass = new Lazy<MyClass>();
public MyClass MyClass { get { return _myClass.Value; } }


Now between the two of them, the Lazy<> version still instantiates something regardless if you never access the MyClass property, where as the classic method will not instantiate anything until you reference MyClass and then it will create.  Granted there are Thread safe aspects within the Lazy<> class but let's not deal with that right now, as it isn't pertinent to my questions.

1. What kind of overhead does the Lazy<> class involve here?  Negligible, minor, major, etc?

Now, there are also more complex lazy loads:

private MyClass _myClass;
public MyClass MyClass {
  get {
    if (_myClass == null) _myClass = new MyClass(this);
    return _myClass;
  }
}

private Lazy<MyClass> _myClass = new Lazy<MyClass>(() => new MyClass(this));  /*I may be wrong here because of the self
referencing during constructor creation or something, but hopefully not */

public Lazy<MyClass> MyClass {get { return _myClass.Value;}}

again these do the same thing, but again:

2. What is the overhead? (and does that 'this' referencing break the Lazy<> lambda or not)

Now for the real question.

Sometimes our lazy loading is more complex and not entirely adhering to a prerequisite that the resulting value will NEVER be null. 

private MyComplexClass _myClass;
public MyComplexClass MyClass {
  get {
    if (_myClass == null) _myClass = this.CreateMyClass();
    return _myClass;
  }
}

private Lazy<MyComplexClass> _myClass = new Lazy<MyComplexClass>(() => this.CreateMyClass());
public Lazy<MyComplexClass> MyClass {
  get {return _myClass.Value; }
}

protected MyComplexClass CreateMyClass() {
  MyComplexClass mcc = null;
  if (this.ShouldCreate) {
    mcc = this.SomeCollection.FirstOrDefault(sc => sc.HasComplexValue);
  }
  return mcc;
}

Now, every time the classic version is referenced, if the _myClass field is null, the code to evaluate this.ShouldCreate is executed, as well as the .FirstOrDefault() lamba process is also executed EVEN WHEN THAT RESULTS IN NULL. 

So the code that references this is fully aware that the MyClass property might be null, so that's okay.  But, if I access this property a dozen times, a hundred times, and it never finds the value it's searching for, it will always keep executing those code blocks.  Sometimes this is the exact behavior we want.  Other times we know that if it didn't find it the first time, it isn't going to so stop looking.

Think of the nullable type:

bool? _value; public bool IsValue { get { if (!_value.HasValue) _value = this.DoSomeComplexEq(); return _value.Value; } }

public bool DoSomeComplexEx() {}

that scenario checks the "DoSomeComplexEq" has been run once.  But it will never run it again (unless i set _value to null)

3.  Does the Lazy<> system compensate for this process in a similar fashion, so that the "attempt" to create the object is only ever executed ONCE?

example (in a classic/manual fashion):

private bool _triedCreate;
private MyComplexClass _myClass;
public MyComplexClass MyClass {
  get {
    if (_myClass == null && !_triedCreate) {
      _triedCreate = true;
      _myClass = this.CreateComplexClass();
    }
    return _myClass;
  }
}

public void ResetMyClassLazy() {
  _triedCreate = false;
}

In this scenario, no matter how complex the evaluation is inside the this.CreateComplexClass() method, that method will only ever be executed once, until I call ResetMyClassLazy. 

I am curious if the Lazy<> class system intrinsically handles this circumstance?

Thanks

Jaeden "Sifo Dyas" al'Raec Ruiner


"Never Trust a computer. Your brain is smarter than any micro-chip."
PS - Don't mark answers on other people's questions. There are such things as Vacations and Holidays which may reduce timely activity, and until the person asking the question can test your answer, it is not correct just because you think it is. Marking it correct for them often stops other people from even reading the question and possibly providing the real "correct" answer.


CLR20r3 error in WinForms application

$
0
0

We're having an issue with one particular application on one particular server. We've got dozens of installations of this application that have worked for years, it's only one customer's server that can't execute it. The application is developed in VS2005 (we can't move it up to 2010, the one and only assembly reference simply doesn't work in VS2008 or 2010 solutions and we've verified with the assembly's vendor that this is the case). The server with issues is a brand new Server 2008 R2 that is current on system updates.

 

That being said:

1) We can't capture the unhandled exception at either the application or appdomain level...it crashes before those are even involved and we can't even attach debuggers to it because the process never actually starts

2) The only message we're getting is:

Description:
  Stopped working

Problem signature:
  Problem Event Name:                        CLR20r3
  Problem Signature 01:                       routedesigner.exe
  Problem Signature 02:                       2.0.0.0
  Problem Signature 03:                       4dcd5df4
  Problem Signature 04:                       RouteDesigner
  Problem Signature 05:                       2.0.0.0
  Problem Signature 06:                       4dcd5df4
  Problem Signature 07:                       18
  Problem Signature 08:                       e9
  Problem Signature 09:                       System.InvalidOperationException
  OS Version:                                          6.1.7601.2.1.0.272.7
  Locale ID:                                             1033


Now, clearly this points out the issue is an InvalidOperationException in the RouteDesigner assembly (our .exe). It also points out that it is in methoddef 18 (converted: 0x06000024) at IL offset e9. The problem is that there is no offset e9 in in that method and the method appears to be a built-in method, it is not anywhere in our solution, even all of the generated code that is in the solution.

The methoddef 06000024 is:

Method #5 (06000024)
	-------------------------------------------------------
		MethodName: Create__Instance__ (06000024)
		Flags     : [Private] [Static] [ReuseSlot]  (00000011)
		RVA       : 0x00005dbc
		ImplFlags : [IL] [Managed]  (00000000)
		CallCnvntn: [DEFAULT]
		generic
		Type Arity:1
		ReturnType: MVar!!0
		1 Arguments
			Argument #1:  MVar!!0
		1 Generic Parameters
			(0) GenericParamToken : (2a000004) Name : T flags: 00000010 Owner: 06000024
		1 Parameters
			(1) ParamToken : (0800000e) Name : instance flags: [none] (00000000)
		CustomAttribute #1 (0c00006f)
		-------------------------------------------------------
			CustomAttribute Type: 0a00001b
			CustomAttributeName: System.Diagnostics.DebuggerHiddenAttribute :: instance void .ctor()
			Length: 4
			Value : 01 00 00 00                                      >                <
			ctor args: ()

This methoddef is inside of the following typedef:

TypeDef #5 (02000006)
-------------------------------------------------------
	TypDefName: MyWebServices  (02000006)
	Flags     : [NestedAssembly] [AutoLayout] [Class] [Sealed] [AnsiClass]  (00000105)
	Extends   : 01000005 [TypeRef] System.Object
	EnclosingClass : RouteDesigner.My.MyProject (02000004)

The actual method in the IL is:

.method private static !!T  Create__Instance__<.ctor T>(!!T 'instance') cil managed
{
  .custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = ( 01 00 00 00 )
  // Code size       32 (0x20)
  .maxstack  2
  .locals init ([0] !!T Create__Instance__,
           [1] bool VB$CG$t_bool$S0)
  IL_0000:  nop
  IL_0001:  ldarg.0
  IL_0002:  box        !!T
  IL_0007:  ldnull
  IL_0008:  ceq
  IL_000a:  stloc.1
  IL_000b:  ldloc.1
  IL_000c:  brfalse.s  IL_0018
  IL_000e:  call       !!0 [mscorlib]System.Activator::CreateInstance<!!0>()
  IL_0013:  stloc.0
  IL_0014:  br.s       IL_001e
  IL_0016:  br.s       IL_001d
  IL_0018:  nop
  IL_0019:  ldarg.0
  IL_001a:  stloc.0
  IL_001b:  br.s       IL_001e
  IL_001d:  nop
  IL_001e:  ldloc.0
  IL_001f:  ret
} // end of method MyWebServices::Create__Instance__

There is no offset e9 in that method, so I'm confused on a number of points:

1) This application does nothing with webservices

2) RouteDesigner.My.MyProject.MyWebServices must be a generated class at build time, it doesn't exist in any of the solution files, even the generated/hidden ones

3) There's no offset e9 in the method specified by the Watson dump?

4) The application works on dozens of customer systems and has done so for years...this is the only system with this issue and it's a fresh install.

 

We've run the Microsoft .Net verification tool and all of the runtimes including 2.0 verified perfectly. Just in case, we uninstalled the runtimes and reinstalled them to no avail. We've cleaned and rebuilt the solution to no avail. There is only one Administrator account on the server and we were using it. We also tried running the exe with the Run As Administrator option with the same result. We've pretty much exhausted everything that we can think of, so my question to the masses is: does anyone have any other ideas on how to figure this issue out?

 

 


How to configure Default AppDomain via Hosting Interfaces?

$
0
0
The problem is I want to confugure DAD (default AppDomain) when starting CLR Host in native process. I want to set AppBase and execute app.config file for DAD.

In function
CorBindToRuntimeEx  there is no word about  DAD, either in  ICorRuntimeHost.Start.
So DAD is nonconfigurable when starting DotNet from native process ?

When CLR Host started, its possible to configure and start another AD using AppDomainSetup.  Why I cannot do this to DAD ?

Maybe its possible in fw 2.0 b2?  Give me a hint please.

WBR Dennis


.Net Profiler - Getting the uncaught Error details and stack trace.

$
0
0

Hi,

I am developing a .Net profiler using instrumentation by setting necessary event masks for the even callbacks and injecting my helper functions.

I am able to get the call graphs and time taken of the functions in a web request. And also if the code has caught exceptions i am able to get that using "COR_PRF_MONITOR_EXCEPTIONS" . 

But if there are any uncaught exceptions in request how to get the details of it. (the details that will be displayed on the browser )

How to get the snapshot and reason of the error.? Is there any particular function in .Net that i should instrument and analyse it's parameters to get the details of the exceptions thrown?

Example: I can get the DB connection name from the parameter of SqlCommand:Open(..) method. Likewise is there any particular function i should instrument into? 

Or can some one tell how to get the error details from the call backs that "ICorProfilerCallback*" provides ?  like ExceptionThrown,ExceptionSearch* callbacks..

./Selva


Configure Evidence for the default AppDomain when launching from an unmanaged C++ application

$
0
0

I have an unmanaged C++ app that makes calls into managed code libraries written in both C# and C++. One of the libraries uses classes from System.IO.Packaging and certain API's are throwing IsolatedStorageException's. The full detail of the issue is explained in the link below, but the gist of the problem is that my unmanaged app does not have any security evidence configured, which is causing the exception under certain conditions.

http://rekiwi.blogspot.com/2008/12/unable-to-determine-identity-of-domain.html

Is it possible to configure Evidence for the default AppDomain from an unmanaged application? Through code or maybe through the .exe.config file? The general suggestion seems to be to create a new AppDomain, which I'd rather avoid doing just to solve what I thought was a minor problem.

I created a sample app to illustrate the issue. I created an unmanaged MFC app that calls into a managed C++ library. The library just shows a message displaying the security evidence. The message show blank. If I turn on "Common Language Runtime Support (/clr)" in the MFC app, I get Evidence configured (see below) and no IsolatedStorageException's.

Turning on CLR in my app is not an option, so I'm hoping there's another way to do this. Any help would be appreciated.

thanks,

<System.Security.Policy.Url version="1">
<Url>file:///C:\ExcelTest\Debug\MFCApp.exe</Url>
</System.Security.Policy.Url>

<System.Security.Policy.Zone version="1">
<Zone>MyComputer</Zone>
</System.Security.Policy.Zone>

<System.Security.Policy.Hash version="2">
<hash algorithm="SHA1"
value="F6A1F0390C233314F3FAD36A1AC4C462FDE54407"/>
<hash algorithm="SHA256"
value="865B26A88EFA1EF49AF961390C3ACDD638041102F0CEDA361755D16F214432A3"/>
<hash algorithm="MD5"
value="17A180BD7569F426918C8487E479B965"/>
</System.Security.Policy.Hash>


How do I assign an invoked method to a field in CodeDOM?

$
0
0

I have the following desired output:

    public partial class HomeClass
    {

        private UILabelDriver errorLabel;

        private UITextFieldDriver passwordText;

        private UIButtonDriver loginButton;

        private UINavigationBarDriver login;

        protected override void InitializeControls()
        {
            errorLabel = new UILabelDriver("ErrorLabel", TestModel);
            passwordText = new UITextFieldDriver("PasswordText", TestModel);
            loginButton = new UIButtonDriver("LoginButton", TestModel);
            login = new UINavigationBarDriver("Login", TestModel);
        }
	}

I am using CodeDOM and I have everything working right, except for those lines in the InitializeControls method.  I have gotten close, but no cigar.  Please help me to figure out how to writejust one of them in CodeDOM.

System.Net.Dns.GetHostName() returning dot

$
0
0

System.Net.Dns.GetHostName() is returning the dot character instead of the machine name.  I need it to return the machine name so that it matches up with what is in sql server.  Is there any way to control this?

msg.HostName = System.Net.Dns.GetHostName(); //Environment.MachineName;  this was returning . for some reason

thanks

scott


The type initializer for '[Modulename]' threw an exception

$
0
0

I have a VB .NET program written in Visual Studio 2010.  It was developed and compiled on a Windows 7 PC.  It is compiled for Any CPU.  This program loads and runs on any Windows 8 PC but when we try to run it on a Windows 7 PC we get the following error:

Error 5 - The type initializer for 'Accubend.basBend' threw an exception. From Introfrm.Load.  Accubend is the name of the program.  I have no idea what basBend is.  Introfrm is the first form that gets loaded.  I do not get an error in the event logs for this error.

The program runs fine on my development box so there is not way of trapping the error and seeing where it is coming from.

What is basBend and where can I find it so I can see where the error is occurring?

I have already spent many hours trying to figure this out.

Please send a response to jmbooher.home@sbcglobal.net.

Thank you

 



Difference between Abstraction and Encapsulation (OOPS concept)

$
0
0

Hi All,

What is difference between Abstraction and Encapsulation ()in details with example?

There are lots of article on net related to this issue, but they are too confusing.

Please help.

Thanks, 

Sudarshan



MethodAccessException making ECall (FastAllocateString) via DynamicMethod

$
0
0

 

I'm trying to call string.FastAllocateString directly from my code. (Actually, I'm trying to avoid unnecesary memory copies when creating a string from a char* - if there's a better way, I'd love to know.)

 

This is my code:

 

Code Block

var

fas =newDynamicMethod("", typeof(string), new[] { typeof(int) });

var

fasMethod =typeof(string).GetMethod("FastAllocateString", BindingFlags.NonPublic |BindingFlags.Static);

var

ilGen = fas.GetILGenerator();

ilGen

.Emit(OpCodes.Ldarg_0);

ilGen

.Emit(OpCodes.Call, fasMethod);

ilGen

.Emit(OpCodes.Ret);

Func

<int, string> FastAllocateString = (Func<int, string>)fas.CreateDelegate(typeof(Func<int, string>));

FastAllocateString(10);

 

 

 

The IL is fine, but when I make the call, I get:

 

System.MethodAccessException: System.String.FastAllocateString(Int32)
   at (Int32 )
   at System.StringExtensions..cctor() in C:\mycode.cs:line 96

 

What am I missing?

 

.net Framework Version History

PerfView: meaning of "Background JIT Blocking Reason" in JITstats

$
0
0

Does anyone know what Assembly Name or  None in column "Background JIT Blocking Reason" mean?

I mean why was JIT used?

Thank you.

Get Location of loaded assembly using .Net Profiling API

$
0
0

I am writing a profiler that uses the .NET Profiling API.I want to do some analysis on all the assemblies that are loaded by the profiled application.

I can get the AssemblyID by using the AssemblyLoadStarted method of ICorProfilerCallback interface, using this assembly id i want to get

  1. Assembly name
  2. Full path of the file location where the assembly is stored

Is it possible to get both using Profiling API?

App crashes on Server 2012, depending on how it's built.

$
0
0

We have an application compiled using Visual Studio 2010 using .net 4 which parses some data files and writes the data to SQL Server. It's currently using .net 4, but was originally .net 1.0 (or 1.1, the early history's hard to get at since we've changed version control systems in the past decade).

In any case, we recently upgraded the server that it runs on to Windows 2012, and it's stopped working, giving a System.BadImageFormat exception. The same executable works fine on 64 bit Windows 7. To make life even more fun, if I build it from the IDE, I get a good binary. If I try to build it using our build script (which calls devenv /batch), I get something that 2012 hates.

Looking at the binaries, it looks like there's a slight difference in code size. using the PE File Explorer. ILSpy thinks that the exes are functionally identical.

Does anybody have a clue what the heck is going on? I have a work around, so I'm not planning on digging further into the binaries, but it's still disconcerting to have the current Windows Server occasionally hating "good" executables.


Mike Swaim

Viewing all 1710 articles
Browse latest View live


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