473,320 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Could not load type .... (assebley in GAC, with new singleton class)

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
Nov 18 '05 #1
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

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
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)...
1
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 ...
3
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...
2
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...
4
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...
4
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() {...
5
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() {
2
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...
12
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...
0
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...
0
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...
1
isladogs
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...
0
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...
0
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...
1
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)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
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....
0
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

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.