473,796 Members | 2,875 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.485 0.0, Culture=neutral , PublicKeyToken= 302009412214000 a.

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.Diagnost ics;

namespace xxx
{
public sealed class TraceLog
{
private static TraceLog _traceLog;

private FileStream fileStream = null;
private TextWriterTrace Listener textWriterTrace Listener = null;

public enum TraceLogTyp
{
CustomError,
FatalError,
Check,
}

private TraceLog()
{
fileStream = new FileStream(AppD omain.CurrentDo main.BaseDirect ory +
"trace.txt" , FileMode.OpenOr Create);
textWriterTrace Listener = new TextWriterTrace Listener(fileSt ream);
Trace.Listeners .Add(textWriter TraceListener);
}

public static TraceLog GetInstance()
{
if (_traceLog == null)
{
_traceLog = new TraceLog();
}

return _traceLog;
}

public void WriteTraceLog(s tring namespaceName,
ArgusNet.Fifa.W ebFast.Business Facade.TraceLog .TraceLogTyp traceLogTyp,
string logMessage)
{
StackTrace stackTrace = null;

try
{
stackTrace = new StackTrace();
string methodeName =
stackTrace.GetF rame(1).GetMeth od().Name.ToStr ing();

string message = String.Concat(D ateTime.Now.ToS tring(), " -
",traceLogT yp, " - ", namespaceName, " - ", methodeName, ": ",
logMessage);
Trace.WriteLine (message);
Trace.Flush();
textWriterTrace Listener.Flush( );
}
catch(Exception ex)
{
int i = 11;
//destroy excepetion
}
finally
{
stackTrace = null;
}
}
}
}

If I call TraceLog.GetIns tance().WriteTr aceLog("aaa",
xxx.TraceLog.Ch eck, "ccc");

Does anyone have any idea!!
Many thanks in advance
Franz
Nov 18 '05 #1
1 1548
You sould post this in the Remoting newsgroup.

"Franz" <gu******@bluem ail.ch> wrote in message
news:df******** *************** ***@posting.goo gle.com...
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.485 0.0, Culture=neutral , PublicKeyToken= 302009412214000 a.

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.Diagnost ics;

namespace xxx
{
public sealed class TraceLog
{
private static TraceLog _traceLog;

private FileStream fileStream = null;
private TextWriterTrace Listener textWriterTrace Listener = null;

public enum TraceLogTyp
{
CustomError,
FatalError,
Check,
}

private TraceLog()
{
fileStream = new FileStream(AppD omain.CurrentDo main.BaseDirect ory +
"trace.txt" , FileMode.OpenOr Create);
textWriterTrace Listener = new TextWriterTrace Listener(fileSt ream);
Trace.Listeners .Add(textWriter TraceListener);
}

public static TraceLog GetInstance()
{
if (_traceLog == null)
{
_traceLog = new TraceLog();
}

return _traceLog;
}

public void WriteTraceLog(s tring namespaceName,
ArgusNet.Fifa.W ebFast.Business Facade.TraceLog .TraceLogTyp traceLogTyp,
string logMessage)
{
StackTrace stackTrace = null;

try
{
stackTrace = new StackTrace();
string methodeName =
stackTrace.GetF rame(1).GetMeth od().Name.ToStr ing();

string message = String.Concat(D ateTime.Now.ToS tring(), " -
",traceLogT yp, " - ", namespaceName, " - ", methodeName, ": ",
logMessage);
Trace.WriteLine (message);
Trace.Flush();
textWriterTrace Listener.Flush( );
}
catch(Exception ex)
{
int i = 11;
//destroy excepetion
}
finally
{
stackTrace = null;
}
}
}
}

If I call TraceLog.GetIns tance().WriteTr aceLog("aaa",
xxx.TraceLog.Ch eck, "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
12480
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) explicitly make the arbitrary class's constructor and destructor private b) declare the Singleton a friend of the arbitrary class
1
2453
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 template <class T> class Singleton : public T { public: static T * Instance();
3
2500
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 what sort of problems/issues should be considered? Also, I see that a singleton needs to be set up with certain data such as file name, database URL etc. What issues are involved in this, and how would you do this? If someone knows about the...
2
3915
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 pointer. isn't child should have access to parent protected destructor? thank you. class CMachineFactory
4
1430
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 each time the dll. The problem is that when i do this i cannot debug my project at all, but the project runs perfect with no error. The hashtable is filled correct! Notice i don't want to debug the function of the hashtable which cannot be done. I...
4
5075
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() { private static T singleton = new T();
5
21164
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
5541
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 like this: template< class Type > class Singleton
12
3120
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 only ever ONE instantiation of this class, and this outside method in a separate thread has to access it. How do i do this?
0
9527
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10223
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7546
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6785
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5441
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.