|
Please remove one of these entries. You only need to ask the question once.
|
|
|
|
|
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?
|
|
|
|
|
Hi,
I'd like to know how I can find out which language
the operating system has from which my application is started.
For example, someone starts the application on a German Windows PC,
the app should be in german and if started on an English Windows PC,
it should be English.
I know how to use the Resource Files for this, but usally I'm doing this
by choosing the language manually and not automatically.
Thanks in advance
greetz pdluke
|
|
|
|
|
Hi,
have a look at CultureInfo class
also Application.CurrentCulture and Thread.CurrentCulture
|
|
|
|
|
Pls clarify
I created an assembly and deployed it automatically setted in windows\system directory.
while i restarting the machine .its showing error and dotnet cannot able to load. we can set the separate directory to the assembly with our code files
kankeyan
|
|
|
|
|
You might want to provide a bit more information :P
Whats the assembly supposed to do, whats the extact error message, wtf do you mean by:
kankeyan wrote: we can set the separate directory to the assembly with our code files
|
|
|
|
|
Hi,
I think that you need to create strong name for your assembly and install it to GAC. I belive that this will solve your porblem.
|
|
|
|
|
Hi friends,
How i can make a pdf file using c# with out using any 3rd party products?
Please advice me..
Thanks
Nithin
|
|
|
|
|
Learn the PDF file format. Write code that generates it. That's basically your only option, if something was built in, the third party products would not exist.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
ITextSharp -- Opensource PDF solution.
|
|
|
|
|
I've been wrestling with the idea of defaulting member variables, not necessarily in the constructor, but in their accessor properties. For example:
private string _name;
public string Name
{
get
{
if (this._name == null) this._name = String.Empty;
return this._name;
}
set { this._name = value; }
}
This way, I know that, no matter what, whenever I access MyObject.Name, I'll be getting a valid string object and never a null, so that when I go to do MyObject.Name.Trim(), I'll never get a null object exception. This saves me time and lines of code in my application.
My question is, is this good practice? Is it better to let the exception occur and check for null elsewhere?
|
|
|
|
|
I think generally you want to avoid get accessors that have a "side effect" like this. The better way would be to ensure that the variable is set to the appropriate default in the constructor (or when it is declared) and then restrict the allowable values in the set accessor.
For your example, it would look something like this:
private string _name;
public string Name
{
get
{
return this._name;
}
set
{
if (value == null)
{
throw new ArgumentNullException("value");
}
if (value == null)
{
value = String.Emtpy;
}
if (String.Compare(this._name, value, StringComparison.InvariantCultureIgnoreCase) != 0)
{
this._name = value;
}
}
}
The call to String.Compare isn't required but it prevents the backing variable from being changed unnecessarily.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
So in this example, what is use of preventing assignment of the member object to null? I'd still have to be prepared for null values to come back from the Name property, so if I'm prepared for that in my code, why would I then prevent the ability to set it to null? Though it seems like your example now tells the user that there was an attempt to write to the member object at some point because it is no longer null, whereas in mine, you never know if anyone tried to set it.
|
|
|
|
|
The example I provided assumes that _name has already been set to it's default value (presumably of String.Empty ) in the constructor.
With the variable already having it's default value and restricting it from being set to null in the set accessor, you should never return a null value from the get accessor.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
That makes sense, and I appreciate your taking the time to answer, Scott.
This seems functionally equivalent to what I described, which is great, but I'm quite not certain what this method buys me. Predictability? What is your reasoning for doing this? I really want to understand.
|
|
|
|
|
No problem. I'm glad I was able to clarify the example.
It is very similar functionaly to your original example. The benefit here is that you guarantee that accessing a property does not change the internal state of your object, generally termed a "side effect". In your example, the internal state could possibly change when the property is accessed.
In order to achieve your result of guaranteeing that the property is not null when it is accessed, the backing variable should be set to some appropriate default (in this case, String.Emtpy ) as early as possible and then the property should prevent someone from explicitly setting it to null.
The choice is yours to decide how to restrict setting it to null and depends on your desired behavior. I have written properties using both methods and they both have their place, you just need to decide which is appropriate for your context.
A lot of properties (particularly in the CLR itself) raise property change events when the value of the property changes. These events are not "smart" so they are always raised. The call to the String.Compare method prevents the property from being set to the same value it currently holds, which prevents the property change events from being raised.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
I do understand it now. From a functional perspective, they're no different, but from a conceptual and practice perspective, it keeps the acts of Setting and Getting separate from one another.
Thanks again, Scott.
|
|
|
|
|
Glad to help.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
Another point to add.
Your original method, initializing the member field to a valid value when accessed, is a technique called "lazy initialization" and is good for initializing objects that may have a heavy penalty such as in time or memory usage. For example, if your object contains a large collection that is not used in say 50% of the cases, you can put off initialization until it is needed. Or if that collection may take time to initialze, may be populated from a database, you can put it off until after the object has been created.
only two letters away from being an asset
|
|
|
|
|
Hi,
I have got a public key token, and want to remove/unregister all assemblies from GAC having that public key token, does any one know about it?
Best Regards,
Mushq
Mushtaque Ahmed Nizamani
Software Engineer
Ultimus Pakistan
"English is my second language, so please don't mind if i do some grammatical or spelling mistakes in my messages."
|
|
|
|
|
Hi,
I don't know easy solution, because Gacutil can't uninstall assembly by PublickKeyToken (or may be I don't know how to do this). I think you can prepare script (on Python, for example), which will start 'gacutil /l' command and take list of all assemblies in GAC. After that you can parse these results, because they contain Assembly name and Public key token, and take list assemblies' names. You can use this list to call 'gacutil /u' for removing of all these assemblies.
|
|
|
|
|
hi frnds,
i am using OS win2k with sp4 and installed Visual studio 2005 successfully. My system is under BLAHBLAH domain if i login with the domain name then my dotNet is hang at the Initializing Toolbox and End to not responding,
but
if i am login with the local admin then it will run well N good,
to trap this error i have format my system and reinstall each and everything
then also same problem continue,
Please help...Is there any setting in WIN 2k to run the .net under domain ????
where i am wrong...????
this condition not happened with XP.
Is it my RAM problem...????
THANKX IN ADVANCE
regards,
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
.Net framework will work perfectly in the higher version of windows 2003 and above.
If you want to work on the .Net Framework please install Vista or XP that will be be safe.
And also check the RAM if you have 1gb Min it will be good.
Regards,
Satips.
|
|
|
|
|
Satips wrote:
If you want to work on the .Net Framework please install Vista or XP that will be be safe.
Works just fine on my Windows 2000 guinea pig box with 256mb ram, .net 2.0 and sql 2005.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
quite Interessting.
only 256mb ram. if you should have installed the Proffessional edition of Asp.Net2.0 the Minimum requirement is 512 mb or above.
Regards,
Satips.
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Walk beside me, and just be my friend. - Albert Camus
|
|
|
|