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

warning msg didn't quite understand

$
0
0
there was a mismatch between the processor architecture of a project being bruit"MSIL" and the processor of the reference "Oracle.dataAccess, version2.112.1.0, Culture=neutral, PulicKeyToken=89b483f429c47342, processorARCHITECTURE=X86","X86".
THIS MISMATCH MAY CAUSE RUNTIME FAILURES PLEASE CONSIDER CHANGING THE TARGETED PROCESSOR ARCHITECTURE OF YOUR PROJECT THROUGH THE CONFIGURATION MANAGER SO AS TO ALIGN THE PROCESSOR ARCHITECTURES BETWEEN YOUR PROJECT AND REFERENCES, OR TAKE A DEPENDENCY OF REFERENCES WITH A PROCESSOR ARCHITECTURE THAT MATCHES THE TARGETED PROCESSOR ARCHITECTURE OF YOUR PROJECT.

Nillo23


Referencing a .Net 2 Dll in .Net 4

$
0
0

I have 2 DLL's referenced in my project, both were written in .Net 2 and my application is in .Net 4.

I am developing the application in an XP environment using VS2010, when I debug, or execute the exe file in this environment it works perfectly. But when I debug or execute the exe in a Windows 7 environment the application just closes as soon as it opens. There is nothing in the event log and no exception is thrown. I have added the following to my app.config for the mixed assemblies exception I received :

<startup useLegacyV2RuntimeActivationPolicy="true">

This is what the DLL's reference :

using System.Runtime.CompilerServices;

using System.Runtime.InteropServices;

using Microsoft.VisualC;

Any help would be appreciated.<o:p></o:p>


Peverify error - Unable to resovle token

$
0
0

hi,

I am writing a very simple example from a book and I am getting an error when I run Peverify.  It says it is unable to verify token.  There are two files in the example. 

 

The first one - CILCars.il doesn't throw up any errors when I run ilasm // dll CILCars.il

I verify it using peverify CILCars.dll and all is ok

 

here is the code :

 

// Reference mscorlib.dll and
// System.Windows.Forms.dll.
.assembly extern mscorlib
{
	.publickeytoken = (B7 7A 5C 56 19 34 E0 89)
	.ver 4:0:0:0
}

.assembly extern System.Windows.Forms
{
	.publickeytoken = (B7 7A 5C 56 19 34 E0 89)
	.ver 4:0:0:0
}

// Define the single-file assembly.
.assembly CILCars
{
	.hash algorithm 0X00008004
	.ver 1:0:0:0
}

.module CILCars.dll

// Implementation of CILCars.CILCar type.
.namespace CILCars
{
	.class public auto ansi beforefieldinit CILCar
	extends [mscorlib]System.Object
	{
	// The field data of the CILCar.
	.field public string petName
	.field public int32 currSpeed
	
	// The custom constructor simply allows the caller
	// to assign the field data.
	.method public hidebysig specialname rtspecialname
	instance void .ctor(int32 c, string p) cil managed
	{
	.maxstack 8
	
	// Load first arg onto the stack and call base class ctor.
	ldarg.0  // "this" object, not the int32!
	call instance void [mscorlib]System.Object::.ctor()
	// Now load first and second args onto the stack.
	ldarg.0 // "this" object
	ldarg.1 // int32 arg
	// Store topmost stack (int 32) member in currSpeed field.
	stfld int32 CILCars.CILCar::currSpeed
	// Load string arg and store in petName field.
	ldarg.0  // "this" object
	ldarg.2 // string arg
	stfld string CILCars.CILCar::petName
	ret
	}
   }
}	
.class public auto ansi beforefieldinit CILCarInfo
	extends [mscorlib]System.Object
	{
	.method public hidebysig static void
	Display(class CILCars.CILCar c) cil managed
		{
		.maxstack 8
		// We need a local string variable.
		.locals init ([0] string caption)
		// Load string and the incoming CILCar onto the stack.
		ldstr "{0}'s speed is:"
		ldarg.0
		// Now place the value of the CILCar's petName on the 
		// stack and call the static String.Format() method.
		ldfld string CILCars.CILCar::petName
		call string [mscorlib]System.String::Format(string, object)
		stloc.0
		// Now load the value of the currSpeed field and get its string
		// representation (note call to ToString().
		ldarg.0
		ldflda int32 CILCars.CILCar::currSpeed
		call instance string [mscorlib]System.Int32::ToString()
		ldloc.0
		// Now call the MessageBox.Show() method with loaded values.
		call valuetype [System.Windows.Forms]
		System.Windows.Forms.DialogResult
		[System.Windows.Forms]
		System.Windows.Forms.MessageBox::Show(string, string)
		pop
		ret
		}
	}

 

 

The second file CarClient.il throws up an error when I run peverfity.  Here is the code :

// External assembly refs.
.assembly extern mscorlib
{
	.publickeytoken = (B7 7A 5C 56 19 34 E0 89)
	.ver 4:0:0:0
}
.assembly extern CILCars
{
	.ver 1:0:0:0
}

// Our executable assembly.
.assembly CarClient
{
	.hash algorithm 0x00008004
	.ver 1:0:0:0
}
.module CarClient.exe

// Implementation of Program type.
.namespace CarClient
{
	.class private auto ansi beforefieldinit Program
	extends [mscorlib]System.Object
	{
		.method private hidebysig static void
		Main(string[] args) cil managed
		{
			// Marks the entry point of the *.exe.
			.entrypoint
			.maxstack 8
			
			// Declare a local CILCar variable and push
			// values onto the stack for ctor call.
			.locals init ([0] class
			[CILCars]CILCars.CILCar myCILCar)
			ldc.i4 55
			ldstr "Junior"
			// Make new CILCar; store and load reference.
			newobj instance void
				[CILCars]CILCars.CILCar::.ctor(int32, string)
				stloc.0
				ldloc.0
			// Call Display() and pass in topmost value on stack.
			call void [CILCars]
				CILCars.CILCarInfo::Display(
					class [CILCars]CILCars.CILCar)
					ret
		}
	}
}

Any ideas ?

 

 

How to pass unmanaged C++ object to C# library and call methods on C++ objects from C# code...

$
0
0

I'm new to C++ and COM Interop and will appreciate your help in pointing me to samples/posts that achieve the objective of passing a unmanaged C++ object to C# library and calling methods on C++ object from C# library.

Earlier we used to have the implementation defined as below:

//C# delegate signature
public delegate void HandleMessage(MyCustomMessageTypeEnum msgEnum, MyCustomMessage msg);
//C# interface definition
public interface IMyCustomMessageProcessor
{
    void initialize(string clientId, [In, MarshalAs(UnmanagedType.FunctionPtr)] HandleMessage msgCallback);
}

The component has evolved since then and we need to perform additional new functionality other than just "HandleMessage" functionality. So instead of having several different delegates defined for the interacting with C++ and C# components and overloading the "initialize(string clientId, [In, MarshalAs(UnmanagedType.FunctionPtr)]HandleMessage msgCallback)" method signature, I'm thinking of defining another interface that will do "HandleMessage" and new additional functionality. So the "initialize" method call will take in an object that implements the "IMyNewAdditionalFunctionality" as a parameter as shown below:

//C# new additional functionality
public interface IMyNewAdditionalFunctionality
{
     void DoWork1(string test);
     void DoWork2(string test, MyCustomMessageTypeEnum msgEnum, int id);
     void HandleMessage(MyCustomMessageTypeEnum msgEnum, MyCustomMessage msg);
}

and now "IMyCustomMessageProcessor" will be changed to:

public interface IMyCustomMessageProcessor
{
    void initialize(string clientId, [What attribute definition do I need here for UnmanagedType??] IMyNewAdditionalFunctionality newAddedFunc);
}

I was wondering:
1. How do I pass unmanaged or managed object to the new "initialize" method.
2. Should I add several different delegates to "initialize" method or should I go with the interface "IMyNewAdditionalFunctionality" approach as defined above. What are pros/cons of each.
3. If somebody could point me to C++ sample code that will create objects of type IMyNewAdditionalFunctionality and IMyCustomMessageProcessor and pass in the "IMyNewAdditionalFunctionality" to "intialize" method would be great.

LDAPConnection heartbeat healthcheck and unbind

$
0
0

Dear all,

We're using .net framework 2.0 using COM+ ServicedComponent as objectpool to launch ldapconnection. We want to have health check feature to poll ldap server periodically similar as heartbeat checking. We implemented health check to create a new ldapconnection and bind and dispose asap for every 5 seconds. We worried that this frequent create and dispose ldapconnections will burden the network traffic. Any suggestions for improving this health check mechanism? Do ldapconnection class have function call for sending heartbeat? Also do this class have unbind functions?

Thanks and regards,

Wallace


servicedcomponent which function call to return to objectpool

$
0
0

Dear all,

We're using .net framework 2.0 with Com+ servicedcomponent and objectpooling feature. Which function call in servicedcomponent is dedicated to release the servicedcomponent to objectpool without destroy it?(dispose or disposeobject or deactivate?) Thx a lot.

Thanks and regards,

Wallace

How to retrieve and parse the signature of a mdtTypeDef

$
0
0

Hi

I'm having a problem retrieving and parsing the signature of a mdtTypeDef token. My metadata knowledge is not the best, so for all I know I might be going about this in the completely wrong way.

I've read the metadata specification (Partition II of the CLI spec) and they actually have an example which is very similar to what I'm trying to do. I quote from page 495 of ECMA specification 335 where they have this sample code:

using System;
class Phone<K, V>
        {
            private int hi = -1;
            private K[] keys;
            private V[] vals;
            public Phone() { keys = new K[10]; vals = new V[10]; }
            public void Add(K k, V v) { keys[++hi] = k; vals[hi] = v; }
        }
        class App
        {
            static void AddOne<KK, VV>(Phone<KK, VV> phone, KK kk, VV vv)
            {
                phone.Add(kk, vv);
            }
            static void Main()
            {
                Phone<string, int> d = new Phone<string, int>();
                d.Add("Jim", 7);
                AddOne(d, "Joe", 8);
            }
        }

The spec continues to define the metadata of the above example:

Following this production, the Phone<string,int> instantiation above is encoded as:
0x15 ELEMENT_TYPE_GENERICINST
0x12 ELEMENT_TYPE_CLASS
0x08 TypeDefOrRef coded index for class “Phone<K,V>”
0x02 GenArgCount = 2
0x0E     ELEMENT_TYPE_STRING
0x08     ELEMENT_TYPE_I4

...

Similarly, the signature for the (rather contrived) static method AddOne is encoded as:
0x10 IMAGE_CEE_CS_CALLCONV_GENERIC
0x02 GenParamCount = 2 (2 generic parameters for this method: KK and VV
0x03 ParamCount = 3 (phone, kk and vv)
0x01 RetType = ELEMENT_TYPE_VOID
0x15 Param-0: ELEMENT_TYPE_GENERICINST
0x12                 ELEMENT_TYPE_CLASS
0x08                 TypeDefOrRef coded index for class “Phone<KK,VV>”
0x02                 GenArgCount = 2
0x1e                      ELEMENT_TYPE_MVAR
0x00                      !!0 (KK in AddOne<KK,VV>)
0x1e                      ELEMENT_TYPE_MVAR
0x01                      !!1 (VV in AddOne<KK,VV>)
0x1e Param-1 ELEMENT_TYPE_MVAR
0x00               !!0 (KK in AddOne<KK,VV>)
0x1e Param-2 ELEMENT_TYPE_MVAR
0x01               !!1 (VV in AddOne<KK,VV>)

I have a very similar situation to the one above: a class with 2 generic parameters (similar to Phone) and a method that references the generic parameters of class (just likePhone.Add). Note: I'm not talking about App.AddOne, I'm talking about Phone.Add (although the metadate for AddOne is almost the same as Phone.Add).

I have the mdtMethodDef token for a method. I call IMetaDataImport.GetMethodProps to get the methods binary signature. I can successfully parse the signature of the method. My problems started when I hit the parameters section of the blob. The generic parameters (e.g. "k" and "v" of Phone.Add) are defined as ELEMENT_TYPE_GENERICINST.

ELEMENT_TYPE_GENERICINST is defiend as:

Generic type instantiation. Followed by type type-arg-count type-1 ... type-n

I parsed the type of the GENERICINST and found ELEMENT_TYPE_VAR, defined as:

Generic parameter in a generic type definition, represented as number (compressed unsigned integer)

At first I had no idea what I was supposed to do with the "number" referenced by ELEMENT_TYPE_VAR, but after much searching and a bit of luck I discovered it referenced the generic parameters of the implementing class of the method i.e. "k" is a GENERICINST of type VAR referencing generic parameter 1 of it's containing class "Phone". (if it weren't for a lot of luck in finding the example I quoted above I would never have figured this out).

This is where I reach my next problem: how do I get to the generic parameters of the containing class? IMetaDataImport::GetMethodProps returns "pClass : [out] A Pointer to a TypeDef token that represents the type that implements the method". I can use "pClass" and callIMetaDataImport2::EnumGenericParamswhich works correctly. The only problem is that I don't know how many generic parameters there are, so I have to call EnumGenericParams repeatedly, asking for 1 parameter each time until it fails. That might be the way it's supposed to be done, but when I enum the generic parameters of a mdtMethodDef I can get them all at once because the methodDef signature includes the number of generic parameters that the method has.

So that got me wondering about what other information I can get about the mdtTypeDef token I have for the implementing class. I triedIMetaDataImport::GetTypeDefProps, but that really doesn't return anything I need at the moment, I can't even tellif there are generic parameters never mind how many.

I searched through cor.h and CorHdr.h to see where else I could use a mdtTypeDef token, but I only found one method that looked useful:IMetaDataImport::GetSigFromToken

My theory is that I can use GetSigFromToken() to get the signature of the implementing class. I tried the call and it returned successfully. The signature returned was 4 bytes. If you refer back to the example I mentioned at the beginning you'll notice that the metadata for "Phone" indicated it was a ELEMENT_TYPE_GENERICINST of type ELEMENT_TYPE_CLASS with 2 generic arguments: ELEMENT_TYPE_STRING and ELEMENT_TYPE_I4. I'm expecting to see that kind of information embedded in the signature of the TypeDef?

At the moment I have what I think is the signature of the implementing class, but I have no idea what to do with it. I expect it'll look similar (if not the same) as the signature for a TypeSpec (Partition II 23.2.14) so I thought it would start with the element type i.e. ELEMENT_TYPE_GENERICINST, but it doesn't. If I uncompress the element type I end up with U2. I thought maybe it started with the length, but that's not right either, since the call to GetSigFromToken() returned 4 bytes.

So my questions are:

1. How do I determine the types of the generic arguments of a method when they are ELEMENT_TYPE_VARs? Do I just enumerate the generic parameters of the implementing class one by one until there are none left? Or can I determine upfront how many there are?

2. Am I right in attempting to lookup the signature of the mdtTypeDef token I have for the implementing class? If so how do I decode it?

Sorry in advance if this question doesn't make sense, it's not the easiest of things to explain.

Cheers

Greg

Use c++ class library in C#, x86 vs x64, Framework 3.5 vs 4.0

$
0
0

Hi,

I'm developing a simple c++ class  library to use in C# console application. All works fine if I develop with Framework 4.0 for x86 and for x64. The same code used with Framework 3.5 for x86 is ok, but it doesn't work for x64. In compilation I see 2 warnings :

Assembly generation -- Referenced assembly 'mscorlib.dll' targets a different processor

Assembly generation -- Referenced assembly 'System.Data.dll' targets a different processor

When I run the program, it stops with an FileLoadException! What I have to set correctly to work in x64 with Framework 3.5?!


C++ V/s C# - Performance ?

$
0
0

I wanted to ask whose performance is better C# or C++. I believe that C++ is faster than C#.

It will be very helpful if you provide some codes that might help keeping your argument. 

Thank You,

Feurer

reflectiontypeloadexception unable to load one or more of the requested types

$
0
0

Hello,

I have a dialog which loads all classes that belongs to given Interface in the current Assembly , that works very nice without any error on my maschine but does not work on my collegues maschine , it gives him following error 

 void ClassSelectionDialog_Loaded(object sender, RoutedEventArgs e)
        {
            fullpath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            foreach (string dll in Directory.GetFiles(fullpath, "*.dll"))
            {
                try
                {
                    ProxyDomain pd=new ProxyDomain();
                    Assembly asm = pd.GetAssembly(dll);
                    int cnt = asm.GetTypes().Where(p => p.GetInterface(Interface) != null).Count();
                    if (cnt > 0)
                    {
                        lstAssemblies.Items.Add(Assembly.LoadFile(dll).GetName().Name);
                        break;
                    }
                }
                catch { }
            }
            //foreach (Assembly asm in AppDomain.CurrentDomain.GetAssemblies())
            //{
            //    lstAssemblies.Items.Add(asm.GetName().Name);
            //}
        }
 class ProxyDomain : MarshalByRefObject
    {
        public Assembly GetAssembly(string AssemblyPath)
        {
            try
            {
                return Assembly.LoadFrom(AssemblyPath);
            }
            catch (Exception ex)
            {
                throw new InvalidOperationException(ex.Message);
            }
        }
    }

above is my code for loading assembly and classes. 


Sincerely, dhampall Please remember to mark the replies as answers if they help and unmark them if they provide no help.

"Cannot create ActiveX component" / Win8 / VB 2012

$
0
0

This is not a question but rather a finding of something in case any one else runs across the same problem.

When using "CreateObject" in VB 2012 of an unmanaged com object on a system that was configured with a fresh install of Win8 / VS 2012, the "Cannot create ActiveX component" error will be encountered when the targeted framework is 4.0 or earlier. Targeting 4.5 results in a VSHost32.exe error. Not an issue specific to a single system since it occurs on multiple systems starting with complete clean installs of Win8/VS2012 (issue may or may not apply to VS 2010 on Win8 - didn't bother testing that given time involved to repeatedly install everything)

The above error applies only when running the code in debug mode via the IDE. If the code is compiled and then run, no error occurs and everything works correctly.

Occurs on both 32 and 64 bit Win8 systems.

Running the identical code on a Win7 / VS 2012 system - no problems are encountered

The problem does not occur on a Win8 system which was upgraded from a Win7/VS 2012 (32 or 64 bit) indicating that something is being carried over that is not getting included on a clean Win8 install (which includes any new system using Win8 on which VS 2012 is being installed)

Just to avoid needless suggestions, there is no question the component was properly registered and project settings were identical in all cases. Method of registration used for the component was both using a setup installer for an app that uses the component as well as Regsvr32 when only registering the component on its own.


Karl Timmermans - The Claxton Group
Outlook Import/Export Hints/Tips
Contact import/export/data management tools for Outlook '2000/2010 - ContactGenie.com

Login and Password are saved for bank websites even though I don't give permission to have this done, how do I disable this? Windows 7, IE and Chrome

$
0
0

When I login to mybank.com for the first time I supply my login and password, I am not prompted by my browser to save the login and password.  I disabled all autologin features for my browser and in the registry for my Windows7 box.  When I logout of the mybank.com website, I am taken back to the login page by design, then I am subsequently relogged in!  This applies to other sites like msdn.com too, and this is a problem for a few people here at my job.  They have access to company information that is now not secure because someone else can go to that webpage on their computer and get the private information.

1. how do I disable the behavior of getting autologged in when I have this already disabled for IE, and in the registry.

2. I open Chrome after going to mybank.com from IE and Chrome autologs me into the bank account even though I never went to that website from Chrome before.  This shows me that it isn't a browser setting, but rather a computer account setting.

3. I login as the network administrator user and I can go to mybank.com or msdn.com and it doesn't autologin me.  So this must be tied to my user account, I am the IT admin, but others have this problem too.  I never have allowed passwords to be saved...

Thanks for your help,

Rob

VS2010 Crashes on debug

$
0
0

Hi!

I've encountered a strange problem with VS2010 SP1 on one of our networks.

We have 2 separate managed networks. The only real difference between them is a few group policies.

On one network VS2010 SP1 works fine, however, on the other network the following happens.

Open a new project (existing or blank), click debug (or build the project) and VS crashes.
when VS restarts, debug works as normal UNTIL something in the project changes. Then VS crashes and upon restart, all changes are saved and debug works again as normal until changes are made.
the change can be anything, adding an element to a form, any coding, renaming a form etc etc.

Event log do show an event:

Event ID 1000

"Faulting application devenv.exe version 10.0.40229.1, stamp 4d5f2a73, faulting module unknown, version 0, stamp 0, debug? 0, fault address 0x05cccccc"

The issue occurs on a fresh build, with a fresh install of VS2010 with SP1.
The issue occurs when using devenv.exe /safemode and when using Devenv /ResetSkipPkgs

The issue occurs when using an admin account
devenv.exe /log only seems to log start up activities

procmon logs don't show any access denied messages (though as I'm using an admin account, I wouldn't expect that anyway).

I'm in the process of having the machine moved to an unmanaged OU to rule out any group policy issues before analysing RSoP scans

I've ruled out running the uninstall tool, as this is also occurring on other machines, all on built on the same network, with VS installed using the same install source as machine on the other network that work fine.
for the above reason I've also ruled out account corruption issues.

I'm also checking that all updates are installed using MBSA.

Has anyone seen this before? (have found people experiencing a similar issue, not not quite the same, on various forums)
Can anyone suggest anything else i can try to get to the bottom of this?

Cheers!

Paul


Application crashes on the main form constructor call deep inside .Net framework

$
0
0

One of our customers experiences a problem with our GUI app. It crashes on start during main Form initialization somewhere inside .Net Framework. This exception cannot be cought by standard .Net try-catch handler.

I turned off all 3-rd party modules that were loaded to application on this machine, and got same result, so suppose the problem is somewhere in .Net depths

I't Windows 7 x64, .Net 2.0. Mscorwks.dll  FileVersion: 2.0.50727.5466 (Win7SP1GDR.050727-5400)

The following is the callstack under WinDbg:

(1628.fb8): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\Windows\Microsoft.NET\Framework64\v2.0.50727\mscorwks.dll - 
mscorwks!CompareAssemblyIdentity+0x3f6b3:
000007fe`ec4b9083 0fb64306        movzx   eax,byte ptr [rbx+6] ds:000007ff`1b5f8ab4=??


0:000> .ecxr
rax=00000000002ec9e8 rbx=000007ff1aa78aae rcx=000007ff1aa78aae
rdx=000007fee9848d30 rsi=00000000002ecbd8 rdi=000007fee9848d30
rip=000007fef9719083 rsp=00000000002ec500 rbp=0000000000000000
 r8=0000000000000000  r9=00000000002eca30 r10=0000000000000005
r11=000007fee974dd88 r12=00000000002ece68 r13=00000000002ece78
r14=0000000000da5d70 r15=00000000002ece70
iopl=0         nv up ei pl zr na po nc
cs=0033  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010246
mscorwks!MethodDesc::FindOrCreateAssociatedMethodDesc+0x43:
000007fe`f9719083 0fb64306        movzx   eax,byte ptr [rbx+6] ds:000007ff`1aa78ab4=??


0:000> !clrstack
OS Thread Id: 0x1d38 (0)
Child-SP         RetAddr          Call Site
00000000002ece30 000007fef892242a System.RuntimeType.CreateInstanceSlow(Boolean, Boolean)
00000000002eceb0 000007fef890182f System.RuntimeType.CreateInstanceImpl(Boolean, Boolean, Boolean)
00000000002ecf40 000007fef8922e21 System.Activator.CreateInstance(System.Type, Boolean)
00000000002ecf80 000007fef7ab3925 System.RuntimeType.CreateInstanceImpl(System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo, System.Object[])
00000000002ed060 000007fef7ab365a System.SecurityUtils.SecureCreateInstance(System.Type, System.Object[])
00000000002ed0c0 000007fef7ab2a39 System.ComponentModel.ReflectTypeDescriptionProvider.CreateInstance(System.Type, System.Type)
00000000002ed120 000007fef7ab2621 System.ComponentModel.ReflectTypeDescriptionProvider+ReflectedTypeData.GetConverter(System.Object)
00000000002ed1a0 000007fef7eab2ad System.ComponentModel.TypeDescriptor+TypeDescriptionNode+DefaultTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetConverter()
00000000002ed1f0 000007fee9634ae0 System.ComponentModel.TypeDescriptor.GetConverter(System.Object)
00000000002ed220 000007fef986eb52 System.Windows.Forms.TableLayoutSettings..ctor(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)
00000000002ed9e0 000007fef899533c System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(System.Object, System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)
00000000002edb30 000007fef8995173 System.Runtime.Serialization.ObjectManager.FixupSpecialObject(System.Runtime.Serialization.ObjectHolder)
00000000002edbd0 000007fef899031c System.Runtime.Serialization.ObjectManager.DoFixups()
00000000002edc30 000007fef898ffb6 System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(System.Runtime.Remoting.Messaging.HeaderHandler, System.Runtime.Serialization.Formatters.Binary.__BinaryParser, Boolean, Boolean, System.Runtime.Remoting.Messaging.IMethodCallMessage)
00000000002edcf0 000007fef9335ea3 System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(System.IO.Stream, System.Runtime.Remoting.Messaging.HeaderHandler, Boolean, Boolean, System.Runtime.Remoting.Messaging.IMethodCallMessage)
00000000002edd90 000007fef8920e0d System.Resources.ResourceReader.DeserializeObject(Int32)
00000000002eddf0 000007fef902052b System.Resources.ResourceReader.LoadObjectV2(Int32, System.Resources.ResourceTypeCode ByRef)
00000000002edeb0 000007fef90206cd System.Resources.ResourceReader+ResourceEnumerator.get_Entry()
00000000002edf40 000007fef7eb44e4 System.Resources.ResourceReader+ResourceEnumerator.get_Current()
00000000002edf80 000007fef7eb43f6 System.ComponentModel.ComponentResourceManager.FillResources(System.Globalization.CultureInfo, System.Resources.ResourceSet ByRef)
00000000002ee030 000007fef7eb43f6 System.ComponentModel.ComponentResourceManager.FillResources(System.Globalization.CultureInfo, System.Resources.ResourceSet ByRef)
00000000002ee0e0 000007fef7eb46fd System.ComponentModel.ComponentResourceManager.FillResources(System.Globalization.CultureInfo, System.Resources.ResourceSet ByRef)
00000000002ee190 000007ff00373d47 System.ComponentModel.ComponentResourceManager.ApplyResources(System.Object, System.String, System.Globalization.CultureInfo)
00000000002ee280 000007ff001af341 CB.Controls.PlanControl.InitializeComponent()
00000000002ee5a0 000007ff001af177 CB.Controls.PlanControl..ctor()
00000000002ee630 000007ff001af0b3 CB.BackupPlanUIClass.CreatePlanControl()
00000000002ee680 000007ff001ae7db CB.BasePlanUIClass.GetPlanControl(bool)
00000000002ee6d0 000007ff001aac02 CB.Controls.Pages.BackupPlansPage.MyInitialize()
00000000002ee730 000007ff001a9259 CB.Controls.MainControl..ctor()
00000000002ee780 000007ff0019c9ea CB.ConsoleForm.MyInitializeComponent()
00000000002ee810 000007ff00170c15 CB.Program.RunConsoleForm()
00000000002ee840 000007fef986eb52 CB.Program.Main(string[])

0:000> !dumpstack
OS Thread Id: 0x1d38 (0)
Child-SP         RetAddr          Call Site
00000000002e9db8 000007fefe2710dc ntdll!ZwWaitForSingleObject+0xa
00000000002e9dc0 000007fef9834edd KERNELBASE!WaitForSingleObjectEx+0x79
00000000002e9e60 000007fef98350d2 mscorwks!ClrWaitForSingleObject+0x2d
00000000002e9eb0 000007fef982b518 mscorwks!RunWatson+0x1ca
00000000002ea440 000007fef9c4c31f mscorwks!DoFaultReportWorker+0x79c
00000000002eac90 000007fef985f52f mscorwks!DoFaultReport+0x9f
00000000002ead00 000007fef9c6c9a9 mscorwks!WatsonLastChance+0x47
00000000002ead70 000007fef9c6ccbe mscorwks!EEPolicy::LogFatalError+0x2f9
00000000002eb4f0 000007fef97b659d mscorwks!EEPolicy::HandleFatalError+0x6e
00000000002eb540 000007fef977b3e0 mscorwks!CLRVectoredExceptionHandlerPhase3+0xcd
00000000002eb580 000007fef977b367 mscorwks!CLRVectoredExceptionHandlerPhase2+0x30
00000000002eb5f0 000007fef97b6d66 mscorwks!CLRVectoredExceptionHandler+0xff
00000000002eb670 0000000077aca59f mscorwks!CLRVectoredExceptionHandlerShim+0x42
00000000002eb6b0 0000000077ac8e42 ntdll!RtlpCallVectoredHandlers+0xa8
00000000002eb720 0000000077b01278 ntdll!RtlDispatchException+0x22
00000000002ebe00 000007fef9719083 ntdll!KiUserExceptionDispatcher+0x2e
00000000002ec500 000007fef96cc004 mscorwks!MethodDesc::FindOrCreateAssociatedMethodDesc+0x43
00000000002ec9f0 000007fef9cfc016 mscorwks!MethodTable::GetDefaultConstructor+0x84
00000000002eca60 000007fef89224d2 mscorwks!RuntimeTypeHandle::CreateInstance+0x406
00000000002ece30 000007fef892242a mscorlib_ni!System.RuntimeType.CreateInstanceSlow(Boolean, Boolean)+0x92
00000000002eceb0 000007fef890182f mscorlib_ni!System.RuntimeType.CreateInstanceImpl(Boolean, Boolean, Boolean)+0x12a
00000000002ecf40 000007fef8922e21 mscorlib_ni!System.Activator.CreateInstance(System.Type, Boolean)+0x4f
00000000002ecf80 000007fef7ab3925 mscorlib_ni!System.RuntimeType.CreateInstanceImpl(System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo, System.Object[])+0x381
00000000002ed060 000007fef7ab365a System_ni!System.SecurityUtils.SecureCreateInstance(System.Type, System.Object[])+0x125
00000000002ed0c0 000007fef7ab2a39 System_ni!System.ComponentModel.ReflectTypeDescriptionProvider.CreateInstance(System.Type, System.Type)+0x7a
00000000002ed120 000007fef7ab2621 System_ni!System.ComponentModel.ReflectTypeDescriptionProvider+ReflectedTypeData.GetConverter(System.Object)+0x229
00000000002ed1a0 000007fef7eab2ad System_ni!System.ComponentModel.TypeDescriptor+TypeDescriptionNode+DefaultTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetConverter()+0x51
00000000002ed1f0 000007fee9634ae0 System_ni!System.ComponentModel.TypeDescriptor.GetConverter(System.Object)+0x1d
00000000002ed220 000007fef986eb52 System_Windows_Forms_ni!System.Windows.Forms.TableLayoutSettings..ctor(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)+0x40
00000000002ed260 000007fef96ddea3 mscorwks!CallDescrWorker+0x82
00000000002ed2c0 000007fef9c4a841 mscorwks!CallDescrWorkerWithHandler+0xd3
00000000002ed360 000007fef96b267d mscorwks!MethodDesc::CallDescr+0x2b1
00000000002ed5b0 000007fef9cc682f mscorwks!CNativeImageAssembly::AddDependentAssembly+0x109
00000000002ed6a0 000007fef8995624 mscorwks!RuntimeMethodHandle::SerializationInvoke+0x1cf
00000000002ed9e0 000007fef899533c mscorlib_ni!System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(System.Object, System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)+0x294
00000000002edb30 000007fef8995173 mscorlib_ni!System.Runtime.Serialization.ObjectManager.FixupSpecialObject(System.Runtime.Serialization.ObjectHolder)+0x7c
00000000002edbd0 000007fef899031c mscorlib_ni!System.Runtime.Serialization.ObjectManager.DoFixups()+0xe3
00000000002edc30 000007fef898ffb6 mscorlib_ni!System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(System.Runtime.Remoting.Messaging.HeaderHandler, System.Runtime.Serialization.Formatters.Binary.__BinaryParser, Boolean, Boolean, System.Runtime.Remoting.Messaging.IMethodCallMessage)+0x17c
00000000002edcf0 000007fef9335ea3 mscorlib_ni!System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(System.IO.Stream, System.Runtime.Remoting.Messaging.HeaderHandler, Boolean, Boolean, System.Runtime.Remoting.Messaging.IMethodCallMessage)+0x146
00000000002edd90 000007fef8920e0d mscorlib_ni!System.Resources.ResourceReader.DeserializeObject(Int32)+0x9a6513
00000000002eddf0 000007fef902052b mscorlib_ni!System.Resources.ResourceReader.LoadObjectV2(Int32, System.Resources.ResourceTypeCode ByRef)+0x5d
00000000002edeb0 000007fef90206cd mscorlib_ni!System.Resources.ResourceReader+ResourceEnumerator.get_Entry()+0xfb
00000000002edf40 000007fef7eb44e4 mscorlib_ni!System.Resources.ResourceReader+ResourceEnumerator.get_Current()+0x1d
00000000002edf80 000007fef7eb43f6 System_ni!System.ComponentModel.ComponentResourceManager.FillResources(System.Globalization.CultureInfo, System.Resources.ResourceSet ByRef)+0x1a4
00000000002ee030 000007fef7eb43f6 System_ni!System.ComponentModel.ComponentResourceManager.FillResources(System.Globalization.CultureInfo, System.Resources.ResourceSet ByRef)+0xb6
00000000002ee0e0 000007fef7eb46fd System_ni!System.ComponentModel.ComponentResourceManager.FillResources(System.Globalization.CultureInfo, System.Resources.ResourceSet ByRef)+0xb6
00000000002ee190 000007ff00373d47 System_ni!System.ComponentModel.ComponentResourceManager.ApplyResources(System.Object, System.String, System.Globalization.CultureInfo)+0xcd
00000000002ee280 000007ff001af341 CB!CB.Controls.PlanControl.InitializeComponent()+0x907
00000000002ee5a0 000007ff001af177 CB!CB.Controls.PlanControl..ctor()+0x81
00000000002ee630 000007ff001af0b3 CB!CB.BackupPlanUIClass.CreatePlanControl()+0x37
00000000002ee680 000007ff001ae7db CB!CB.BasePlanUIClass.GetPlanControl(Boolean)+0x53
00000000002ee6d0 000007ff001aac02 CB!CB.Controls.Pages.BackupPlansPage.MyInitialize()+0xeb
00000000002ee730 000007ff001a9259 CB!CB.Controls.MainControl..ctor()+0x142
00000000002ee780 000007ff0019c9ea CB!CB.ConsoleForm.MyInitializeComponent()+0xa9
00000000002ee810 000007ff00170c15 CB!CB.Program.RunConsoleForm()+0x3a
00000000002ee840 000007fef986eb52 CB!CB.Program.Main(System.String[])+0xac5
00000000002eead0 000007fef96ddea3 mscorwks!CallDescrWorker+0x82
00000000002eeb20 000007fef9c4a841 mscorwks!CallDescrWorkerWithHandler+0xd3
00000000002eebc0 000007fef97b998a mscorwks!MethodDesc::CallDescr+0x2b1
00000000002eee00 000007fef97dd288 mscorwks!ClassLoader::RunMain+0x292
00000000002ef060 000007fef9d36e4d mscorwks!Assembly::ExecuteMainMethod+0xbc
00000000002ef350 000007fef97ea40b mscorwks!SystemDomain::ExecuteMainMethod+0x47d
00000000002ef920 000007fef97cd02c mscorwks!ExecuteEXE+0x47
00000000002ef970 000007fef9f574e5 mscorwks!CorExeMain+0xac
00000000002ef9d0 ffffffffffffffff mscoreei!CorExeMain+0xe0
00000000002ef9d8 0000000000da5d70 ffffffffffffffff
00000000002ef9e0 0000000000000000 0000000000da5d70
I'd submit a bug to Connect, but it doesn't accept .Net v2.0 issues.


Sincerely,

IP


Could not load file or assemple...incorrect format

$
0
0

My application runs well in debug mode.   When I moved it to the server (SBS 2011), it failed with the above error.   I have installed VS 2012 and copied all my files to thewwwoot folder on the server and it works in debug mode on the server.   I am stumped.   I have found lots of folks with similar problems, but I can't ascertain which dependency is missing or the issure with format.   The program is written in asp.net and vb.net.

The only thing unusual is that I was utilizing the VS login and was having to many problems with SQL express; so, I removed all of the references to it and built my own login page.  

Thanks...

Server Error in '/ranch Inventory' Application.
--------------------------------------------------------------------------------


 Could not load file or assembly 'Ranch Inventory' or one of its dependencies. An attempt was made to load a program with an incorrect format. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.BadImageFormatException: Could not load file or assembly 'Ranch Inventory' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Source Error: 




An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Assembly Load Trace: The following information can be helpful to determine why the assembly 'Ranch Inventory' could not be loaded.





WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
 

Stack Trace: 





[BadImageFormatException: Could not load file or assembly 'Ranch Inventory' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
   System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
   System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +210
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +242
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +17
   System.Reflection.Assembly.Load(String assemblyString) +35
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +122

[ConfigurationErrorsException: Could not load file or assembly 'Ranch Inventory' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +12761078
   System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +503
   System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +142
   System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +334
   System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath) +203
   System.Web.Compilation.BuildManager.ExecutePreAppStart() +152
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +1151

[HttpException (0x80004005): Could not load file or assembly 'Ranch Inventory' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12881540
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12722601


mscorlib Sort ERROR

$
0
0

The following ERROR occurs win trying to run the following code as it appears in the Pro C# 2010 and the .NET 4 Platform 5th Edition from Apress on page 357. I have the .NET 4.5 installed in Windows 7 Ult. Version. Is this the wrong place to be asking this question? Should I be looking at the Errata for the book? Has the "Sort" Method been mover to another Library?

Array.Sort(myAutos);

Below is the InvalidOperationException Details ->{"Failed to compare two elements in the array."}

Why is this error occuring? Do I have a corrupt file and if this is the case where can I get a new file?

System.InvalidOperationException was unhandled
  HResult=-2146233079
  Message=Failed to compare two elements in the array.
  Source=mscorlib
  StackTrace:
       at System.Collections.Generic.ArraySortHelper`1.Sort(T[] keys, Int32 index, Int32 length, IComparer`1 comparer)
       at System.Array.Sort[T](T[] array, Int32 index, Int32 length, IComparer`1 comparer)
       at System.Array.Sort[T](T[] array)
       at ComparableCar.Program.Main(String[] args) in C:\Users\Mark\documents\visual studio 2010\Projects\ComparableCar\ComparableCar\Program.cs:line 29
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.ArgumentException
       HResult=-2147024809
       Message=At least one object must implement IComparable.
       Source=mscorlib
       StackTrace:
            at System.Collections.Comparer.Compare(Object a, Object b)
            at System.Collections.Generic.ObjectComparer`1.Compare(T x, T y)
            at System.Collections.Generic.ArraySortHelper`1.SwapIfGreater(T[] keys, IComparer`1 comparer, Int32 a, Int32 b)
            at System.Collections.Generic.ArraySortHelper`1.DepthLimitedQuickSort(T[] keys, Int32 left, Int32 right, IComparer`1 comparer, Int32 depthLimit)
            at System.Collections.Generic.ArraySortHelper`1.Sort(T[] keys, Int32 index, Int32 length, IComparer`1 comparer)
       InnerException:

Get the title of aspx page in code using reflection?

$
0
0
Hi, I was wondering, I want to get the titles of all the pages in my assemblies using reflection. I already know I can get the files in the assembly, but is there any better way to do this than a search for the string Title=" inside of the page? It seems to me that searching for the string Title=" may not be the best way to do this. If anyone knows of a better way, please let me know. If you are convinced that a search for the string is the only way to do it, also let me know if that ts the case. Thanks

how to provide system.diagnostics.performancecounter impersonation through c#?

$
0
0
i have used the following code,
static void Main(string[] args)
{

PerformanceCounterCategory cat = new PerformanceCounterCategory("Processor", "172.16.2.171");
List<PerformanceCounter> counters = new List<PerformanceCounter>();
foreach (string instance in cat.GetInstanceNames())
counters.Add(new PerformanceCounter("Processor", "% Processor Time", instance, "172.16.2.171"));
for (int i = 0; i < 10000; i++)
{
foreach (PerformanceCounter counter in counters)
Console.Write(counter.NextValue() + " ");
}

}

it results the "Access is Denied Error", the remote system has the credentials suchas domainname, username, password . how can i provide credentials in performancecounter class to obtain the remote system performance

How to deal with events/callbacks from something that appears to be on an MTA thread.

$
0
0

I am writing code with Visual Studio 2010 in VB.net with a WPF project.  I have added references to MSHTML and SHDocvw as I am automating an Internet Explorer window.  Note I am not hosting the webbrowser on a form.  I am currently using the Shdocvw.InternetExplorer class to do this.

Irrespective of whether it is this class or another I assume my questions is a Managed Code / unmanaged code problem.

I am using WithEvents for my events.  The problem is that I must use an STA thread to for example do anything with MSHTML but the events that come back from Internet Explorer are MTA threads.  To work around this I have used a dispatcher, but this is not I think the best solution and I am thinking there must be a better way.  This whole COM / Managed / Unmanaged code is a little bit hard to come to grips with as there are too many options.

So what is the correct way of dealing with the events raised?


impersonateValidUser works well when using administrator account but,for non administrator account ,saying "Access to the path 'xxx' is denied."

$
0
0

hi.

    i am using impersonateValidUser(i will paste my code in the following) to access a folder.i've FINISHED DEVELOPMENT OF PROGRAM and i've DEPLOY and INSTALL on some people's PC.

   for some "good" PC it works well,but for some "bad" PC,only if i login with administrator's account it works well,otherwise  "Access to the path 'xxx' is denied." is told.but for impersonateValidUser part it works works well. for these "bad" PC,if i dont use impersonateValidUser it works,it can access the folder.

   i would like to ask ur help how could i fix the problem.thank u very much for u r kindness help in advance.

my code is:       
        public const int LOGON32_LOGON_INTERACTIVE = 2;
        public const int LOGON32_PROVIDER_DEFAULT = 0;
        WindowsImpersonationContext impersonationContext;
        [DllImport("advapi32.dll")]
        public static extern int LogonUserA(String lpszUserName,
            String lpszDomain,
            String lpszPassword,
            int dwLogonType,
            int dwLogonProvider,
            ref IntPtr phToken);
        [DllImport("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)]
        public static extern int DuplicateToken(IntPtr hToken,
            int impersonationLevel,
            ref IntPtr hNewToken);
        [DllImport("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)]
        public static extern bool RevertToSelf();
        [DllImport("kernel32.dll", CharSet = CharSet.Auto)]
        public static extern bool CloseHandle(IntPtr handle); 
        private void undoImpersonation()
        {
            impersonationContext.Undo();
        }
        private bool impersonateValidUser(String userName, String domain, String password)
        {      
            WindowsIdentity tempWindowsIdentity;
            IntPtr token = IntPtr.Zero;
            IntPtr tokenDuplicate = IntPtr.Zero;         
                if (RevertToSelf())
                {
                    if (LogonUserA(userName, domain, password, LOGON32_LOGON_INTERACTIVE,
                        LOGON32_PROVIDER_DEFAULT, ref token) != 0)
                    {
                        if (DuplicateToken(token, 2, ref tokenDuplicate) != 0)
                        {
                            tempWindowsIdentity = new WindowsIdentity(tokenDuplicate);
                            impersonationContext = tempWindowsIdentity.Impersonate();
                            if (impersonationContext != null)
                            {
                                CloseHandle(token);
                                CloseHandle(tokenDuplicate);
                                MessageBox.Show("return true");
                                return true;
                            }
                        }
                    }
                }
                if (token != IntPtr.Zero)
                    CloseHandle(token);
                if (tokenDuplicate != IntPtr.Zero)
                    CloseHandle(tokenDuplicate);   
            return false; 
        }

        private void button1_Click(object sender, EventArgs e)
        {            
            if (impersonateValidUser("username", "domain", "psw"))
            {               
                if (!Directory.Exists(rootComplete))
                {               
                        Directory.CreateDirectory(rootComplete);                   
               
                }     
                File.Copy(filePath, doc, true);              
                undoImpersonation();
            }
            else
            {
                MessageBox.Show("impersonateValidUser,fail login.");               
            }
        }

Viewing all 1710 articles
Browse latest View live


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