Hello NG
I added a new tracelog class in a existing assebley witch is located
in GAC.
If I try to access a methode of this new class I'll get an
errormeassage like this: Could not load type xxxx from assembly xxxx,
Version=1.0.4850.0, Culture=neutral, PublicKeyToken=302009412214000a.
I searched in ng and found some tasks, like 'do not use enums' or
'make sure you rebuild asembley before creating a new msi', 'check
namespace', 'reboot' and so on. But I still get the same error.
My class is a singleton an look like this:
using System;
using System.IO;
using System.Diagnostics;
namespace xxx
{
public sealed class TraceLog
{
private static TraceLog _traceLog;
private FileStream fileStream = null;
private TextWriterTraceListener textWriterTraceListener = null;
public enum TraceLogTyp
{
CustomError,
FatalError,
Check,
}
private TraceLog()
{
fileStream = new FileStream(AppDomain.CurrentDomain.BaseDirectory +
"trace.txt", FileMode.OpenOrCreate);
textWriterTraceListener = new TextWriterTraceListener(fileStream);
Trace.Listeners.Add(textWriterTraceListener);
}
public static TraceLog GetInstance()
{
if (_traceLog == null)
{
_traceLog = new TraceLog();
}
return _traceLog;
}
public void WriteTraceLog(string namespaceName,
ArgusNet.Fifa.WebFast.BusinessFacade.TraceLog.Trac eLogTyp traceLogTyp,
string logMessage)
{
StackTrace stackTrace = null;
try
{
stackTrace = new StackTrace();
string methodeName =
stackTrace.GetFrame(1).GetMethod().Name.ToString() ;
string message = String.Concat(DateTime.Now.ToString(), " -
",traceLogTyp, " - ", namespaceName, " - ", methodeName, ": ",
logMessage);
Trace.WriteLine(message);
Trace.Flush();
textWriterTraceListener.Flush();
}
catch(Exception ex)
{
int i = 11;
//destroy excepetion
}
finally
{
stackTrace = null;
}
}
}
}
If I call TraceLog.GetInstance().WriteTraceLog("aaa",
xxx.TraceLog.Check, "ccc");
Does anyone have any idea!!
Many thanks in advance
Franz 1 1527
You sould post this in the Remoting newsgroup.
"Franz" <gu******@bluemail.ch> wrote in message
news:df**************************@posting.google.c om... Hello NG
I added a new tracelog class in a existing assebley witch is located in GAC. If I try to access a methode of this new class I'll get an errormeassage like this: Could not load type xxxx from assembly xxxx, Version=1.0.4850.0, Culture=neutral, PublicKeyToken=302009412214000a.
I searched in ng and found some tasks, like 'do not use enums' or 'make sure you rebuild asembley before creating a new msi', 'check namespace', 'reboot' and so on. But I still get the same error.
My class is a singleton an look like this:
using System; using System.IO; using System.Diagnostics;
namespace xxx { public sealed class TraceLog { private static TraceLog _traceLog;
private FileStream fileStream = null; private TextWriterTraceListener textWriterTraceListener = null;
public enum TraceLogTyp { CustomError, FatalError, Check, }
private TraceLog() { fileStream = new FileStream(AppDomain.CurrentDomain.BaseDirectory + "trace.txt", FileMode.OpenOrCreate); textWriterTraceListener = new TextWriterTraceListener(fileStream); Trace.Listeners.Add(textWriterTraceListener); }
public static TraceLog GetInstance() { if (_traceLog == null) { _traceLog = new TraceLog(); }
return _traceLog; }
public void WriteTraceLog(string namespaceName, ArgusNet.Fifa.WebFast.BusinessFacade.TraceLog.Trac eLogTyp traceLogTyp, string logMessage) { StackTrace stackTrace = null;
try { stackTrace = new StackTrace(); string methodeName = stackTrace.GetFrame(1).GetMethod().Name.ToString() ;
string message = String.Concat(DateTime.Now.ToString(), " - ",traceLogTyp, " - ", namespaceName, " - ", methodeName, ": ", logMessage); Trace.WriteLine(message); Trace.Flush(); textWriterTraceListener.Flush(); } catch(Exception ex) { int i = 11; //destroy excepetion } finally { stackTrace = null; } } } }
If I call TraceLog.GetInstance().WriteTraceLog("aaa", xxx.TraceLog.Check, "ccc");
Does anyone have any idea!! Many thanks in advance Franz This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Tim Clacy |
last post by:
Is there such a thing as a Singleton template that actually saves
programming effort?
Is it possible to actually use a template to make an arbitrary class a
singleton without having to:
a)...
|
by: Jim Strathmeyer |
last post by:
So I'm trying to implement a singleton template class, but I'm getting a
confusing 'undefined reference' when it tries to link. Here's the code
and g++'s output. Any help?
// singleton.h
...
|
by: Alicia Roberts |
last post by:
Hello everyone, I have been researching the Singleton Pattern. Since the
singleton pattern uses a private constructor which in turn reduces
extendability, if you make the Singleton Polymorphic...
|
by: yccheok |
last post by:
hello, in a singleton design, i trying to make my parent class having
protected constructor and destructor. however, the compiler give me
error when my child, trying to delete itself through parent...
|
by: Amar |
last post by:
Hi,
I have created a singleton object that has a hashtable which holds
all the functions loaded from a dll in order to have access to these
functions every time i want without having to open...
|
by: Ole Nielsby |
last post by:
Here comes a generic class with a static property.
Let's say they are exotic singleton pets.
abstract class Pet {...}
abstract class SharedPet<T>: Pet
where T: SharedPet<T>, new()
{...
|
by: Damien |
last post by:
Hi all,
I'm using a pretty standard C++ Singleton class, as below:
template <typename T>
class Singleton
{
public:
static T* Instance()
{
|
by: Dave Rudolf |
last post by:
Hey all,
So I have a template class whose only template parameter is a type that the
class is to manage. It's actually an implementation of the common Singleton
design pattern. The class looks...
|
by: titan nyquist |
last post by:
I have a class with data and methods that use it. Everything is
contained perfectly
THE PROBLEM: A separate thread has to call a method in the current
instantiation of this class. There is...
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
| | |