I have made a desktop based SMS system in C# Dotnet 2.0 and integrate it with an old enterprise solution build in VB6.0. On Runtime, the Vb6.0 exe is running from local machine and after loading it reads the system registry and extract a remote path to call all the other dll's from a remote location. The benefit is that all the executables is resides on a single remote location and you just have to distribute an exe to all the clients and set the value of remote path in their registry. A simple 3 tier architecture Where you have a client which is a vb6.0 exe say client.exe and an application server which holds the middle tier or all the executables and a database server. The location of the database server, password to connect, userid's and location of the application server is saved in Registry through a utility. This means that all the exe's and dll's are loaded from a remote location which is a shared resource in a network. Now my problem is that. When my sms exe say sms1000.exe written in c# dotnet 2.0 is called by this client.exe it gives this error in application log and not running. Faulting application sms1000.exe, version 1.0.0.0, stamp 468dbd07, faulting module kernel32.dll, version 5.2.3790.3959, stamp 45d70ad8, debug? 0, fault address 0x0000bee7. I must include here that all of my executables and dll's are strong name assemblies and sice it's loaded from a network location I've changed the intranet group to a Fulltrust through this command CasPol.exe -chggroup 1.2 FullTrust I've tested it on Windows 2000, Windows XP and Windows 2003 machines and it's running fine. However currently I'm deploying this application from a remote desktop to client located outside my country. On some of their machines running windows 2003 it's running fine However it's not running fine on a few of them which runs windows 2003 as well giving this error in System Application Log. Faulting application sms1000.exe, version 1.0.0.0, stamp 468dbd07, faulting module kernel32.dll, version 5.2.3790.3959, stamp 45d70ad8, debug? 0, fault address 0x0000bee7. Source of event says: .Net 2.0 Runtime error. Any one has any resolution?
Syed Muhammad Kamran
Posts
-
Problem in calling a dotnet exe from VB 6.0 exe -
Suggestion requiredBut guys what about these Video training sites? any suggestion on that or any good site you wanna share.
-
Suggestion requiredI'm new in the field of software engineering and feel kinda like depressed over the rapid change and introduction of new technologies, trends etc in this field. I know that no other training methdologies can replace the learning from a good book. However to acquire knowledge from book you gotta have a good amount of time. Unfortunately due to uncertainity of my job timing I'm unable to attend any class regularly. So I though there are few sites which offers online video trainings. Can u guys quote me a good site where I can find good amount of videos trainings etc. Like learnvisualstudio.net what do you guys suggest. Offcourse I'm willing to spend some money. Thanks.
-
ArrayList with restricted accessIn C# you can't mark reference types as readonly. However you can Encapsulate ArrayList inside a class and provide restricted access to it through methods, properties. You mentioned that speed is an issue otherwise you could have simply returned a clone to it.
-
Make forms unmovableSorry i didn't noticed you mentioned Windows Mobile CE application.. However you can use the same strategy there as well... Just use Mouse_Move event and check if the Left mouse Button is pressed when the Mouse_Move event has raised... If yes then reassign the location property.
-
Make forms unmovableDeclare an instance variable of Type Point name it say loc. In the end of your Form_Load event Handler write this line of code this.LocationChanged += new System.EventHandler ( this.FormName_LocationChanged ); this.loc.X = this.Location.X; this.loc.Y = this.Location.Y; And in the LocationChanged Event Handler private void DbDeploy_LocationChanged ( object sender , EventArgs e ) { this.Location = this.loc; }
-
Exit a WinForm application at initializationnamespace blahblah { public partial class MainForm : Form { static bool startUpCheckValue = false; static MainForm (){ startupCheckValue = StartupCheck(); } public MainForm() { if (!startupCheckValue) { Dispose(); this.Close(); Application.Exit(); // exitProgram(); } etc etc etc private static bool startupCheck() { // make sure database file exists // [code works fine] }
-
faqWhat do you mean by not Firing... It's not meant to fire auto... You are required to do it explicitly.
-
Exit a WinForm application at initializationWhy not do it in Form's Constructor.... It's run b4 Initialization. You can call dispose from there. Or even better you can use a static constructor try to set a static boolean variable and check it's value b4 instantiating... Any Static Construct is the first thing which is run After class loading.
-
ok, now how do i add six " " into a string by multiplying itint count = 6; char space = ' '; StringBuilder st = new StringBuilder("Your String"); st.Append(space, count);
-
Setup project: Icon for the desktop does not appear on Win 2000add a ICON file by using Add>> File to your Application Folder then on the properties of your shortcut specify the icon property with the icon you have just added.
-
Directory structure for solutionCreate a common folder.... Where... do you mean solution folder or a folder in each project? Change the project settings for these... How... you mean using Project Properties>> Built>>> Output Path?? Do I have to use an absolute or relative path to Common?? Please need a little more clarification on this. SMK
-
Regarding TriggersI am developing an sms messaging app (Let say app A) with backend in SQL2K. This app depends on a schema of an already deployed application (Let say app X). I have also created a schema of my own application which may reside on any other machine. Whenever app X done a transaction on some of the tables I am initiating a trigger from there. After doing some operations on the inserted record in the trigger I am inserting that record to my own schema generated for App A by the link server to my Schema. I have made a windows service, whenever a new rocord is inserted in my tables through schema I'll compose and send an SMS message to my client. My problem is since triggers runs in an implicit transaction whenever the inserting triggers fails the transaction which was inserted by App X is also got failed. Which I don't want. How to cope with this... I don't know about error handling. How to implement fail save recovery in this scenario. SMK
-
Directory structure for solutionI have a solution in C# which has 6 projects Say A, B, C, X, Y, Z Where A, B, C generates exe's and X, Y, Z is of type Class library (DLL) 1) Executables A and B both hold a reference to Projects X, Y, Z (dll). 2) Where Executable C holds a reference to Dll X only. X,Y,Z are private assemblies and not candidates for GAC. Now since they are private assemblies when I add a reference it'll be copied to the project output directory locally. And if I'll set the property "Copy Local = false" then it'll not get copied and the exe's fails when. What I wanna impose is a directory structure for my solution to avoid multiple copies of dll's when deploying. LetSay it'll copy all the files in... \AppRoot ......... A.exe ......... B.exe ......... C.exe \AppRoot\Lib .............. X.dll .............. Y.dll .............. Z.dll And have them work correctly. I'm new to Dotnet and perhaps to programming.. Please help how to impose this kind of directory structure for my app. Thanks. SMK
-
Registry problemYou can use Encoding.[UTF7/UTF8/etc].GetByte(String param) and viceversa Encoding.[UTF7/UTF8/etc].GetString(byte[] b) to convert method to/from byte to string and viceversa than save it in registry.
-
Getting reference of calling Assembly.There are ways to even crack this..... You mean like this??
Assembly asm = Assembly.GetAssembly ( Type ( MyRestrictedAssembly ) );
byte[] b = asm.GetName ().GetPublicKey ();
this.GetType ().Assembly.GetName ().SetPublicKey ( b );
TypeFromRestrictedAssembly temp = new TypeFromRestrictedAssembly ( this.GetType ().Assembly );SMK
-
Getting reference of calling Assembly.How can I get a reference of the calling Assembly at Runtime? I've an assembly (RestrictedAssembly) and I want to ristrict access to it means no user who fullfills my criteria (in my case not having my desired public key token for assembly) can instantiate any type from my assembly. For better understanding, this is what I am trying to do. I've generated a public/private keypair file for myself, then I use it to sign all those assemblies which I want to allow Access to my RestrictedAssembly. On Runtime before instantiating any type from RestrictedAssembly, in constructor I am asking the caller to provide a Type object from which he's initiating a call to constructor. For example.
/**
* Constructor of public sealed class RestrictedType1
* Cotains in RestrictedAssembly.
* Caller is required to pass a type object
* o is the Type who wish to instantiate this class.
*/
public RestrictedType1(Type o) {
Type t = this.GetType ();
byte [] t1Token = o.Assembly.GetName().GetPublicKeyToken();
byte [] t2Token = t.Assembly.GetName().GetPublicKeyToken();
AccessNotAllowedEx ex = new AccessNotAllowedEx("Not Allowed");if(t1Token != null && t2Token != null) {
if(t1Token.Length == t2Token.Length) {
for(int i = 0; i< t1Token.Length; i++) {
if (t1Token[i] == t2Token[i])
continue;
else
throw ex;
}
// If get here successfullyDone;
ex = null;
} else
throw ex;
} else
throw ex;
}I am checking, if the public key tokens for both the calling and called assemblies are identical and if they are, then I am allowing the caller to instantiate my RestrictedType other wise I raise an exception. Now the problem with this approach is that, suppose I've an Assembly CallerOfRestrictedAssembly and I've signed it with my public/private key pair. Now from CallerOfRestrictedAssembly it is valid to do the following. Since both assemblies have same public key token.
RestrictedType1 res = new RestrictedType1(this.GetType);
However, suppose if some one initiate a call to RestrictedType1 constructor
RestrictedType1 res = new RestrictedType1(typeof(TypeFromCallerOfRestrictedAssembly));
This will cheat the constructor. Thus, I don't want caller to Pass Type argument into Constructor. and depend on it. What I am looking for is to get a refere
-
Getting reference of calling Assembly.How can I get a reference of the calling Assembly at Runtime? I've an assembly (RestrictedAssembly) and I want to ristrict access to it means no user who fullfills my criteria (in my case not having my desired public key token for assembly) can instantiate any type from my assembly. For better understanding, this is what I am trying to do. I've generated a public/private keypair file for myself, then I use it to sign all those assemblies which I want to allow Access to my RestrictedAssembly. On Runtime before instantiating any type from RestrictedAssembly, in constructor I am asking the caller to provide a Type object from which he's initiating a call to constructor. For example.
/**
* Constructor of public sealed class RestrictedType1
* Cotains in RestrictedAssembly.
* Caller is required to pass a type object
* o is the Type who wish to instantiate this class.
*/
public RestrictedType1(Type o) {
Type t = this.GetType ();
byte [] t1Token = o.Assembly.GetName().GetPublicKeyToken();
byte [] t2Token = t.Assembly.GetName().GetPublicKeyToken();
AccessNotAllowedEx ex = new AccessNotAllowedEx("Not Allowed");if(t1Token != null && t2Token != null) {
if(t1Token.Length == t2Token.Length) {
for(int i = 0; i< t1Token.Length; i++) {
if (t1Token[i] == t2Token[i])
continue;
else
throw ex;
}
// If get here successfullyDone;
ex = null;
} else
throw ex;
} else
throw ex;
}I am checking, if the public key tokens for both the calling and called assemblies are identical and if they are, then I am allowing the caller to instantiate my RestrictedType other wise I raise an exception. Now the problem with this approach is that, suppose I've an Assembly CallerOfRestrictedAssembly and I've signed it with my public/private key pair. Now from CallerOfRestrictedAssembly it is valid to do the following. Since both assemblies have same public key token.
RestrictedType1 res = new RestrictedType1(this.GetType);
However, suppose if some one initiate a call to RestrictedType1 constructor
RestrictedType1 res = new RestrictedType1(typeof(TypeFromCallerOfRestrictedAssembly));
This will cheat the constructor. Thus, I don't want caller to Pass Type argument into Constructor. and depend on it. What I am looking for is to get a reference of Calling Assembly into my Restrict