Click here to Skip to main content
15,912,069 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionASP.Net Default Provider Login and Registration help needed! Pin
Rob__Dean21-Aug-08 3:22
Rob__Dean21-Aug-08 3:22 
QuestionTarget .NET 2.x without SP1 Pin
Paul Selormey20-Aug-08 23:31
Paul Selormey20-Aug-08 23:31 
AnswerRe: Target .NET 2.x without SP1 Pin
Wendelius29-Aug-08 7:47
mentorWendelius29-Aug-08 7:47 
QuestionVB Pin
karthigachawla20-Aug-08 18:53
karthigachawla20-Aug-08 18:53 
AnswerRe: VB PinPopular
Christian Graus20-Aug-08 19:28
protectorChristian Graus20-Aug-08 19:28 
AnswerRe: VB Pin
Vasudevan Deepak Kumar21-Aug-08 12:04
Vasudevan Deepak Kumar21-Aug-08 12:04 
AnswerRe: VB Pin
Paul Conrad21-Aug-08 17:06
professionalPaul Conrad21-Aug-08 17:06 
QuestionCustom AppDomain - dll init problem Pin
Ryan Leckey20-Aug-08 15:14
Ryan Leckey20-Aug-08 15:14 
Okay, I am posting this here because it involves both C# and C++/CLI.

First off, I am implementing a plugin system in .Net. It works fine and I am able to load classes through interfaces in an assembly then reload that specific assembly (through an appdomain). Yet, when the DLL that I am loading is a C++/CLI dll with the following code (a minor hack to allow a DLLMain in .Net)...

private class DllMain
{
public:
      DllMain();
      ~DllMain();

};

DllMain g_DllMain;

DllMain::DllMain()
{
       // My DllMain code goes here, its just me registering classes
       // with their own dynamilcally generated class in order to create
       // a factory-style system.
}


Anyway, the problem is the DllMain::DllMain() executes properly yet when it goes to registers each class it fails silently (see the code below).

public static ref class Forge<T> // Allows dynamic generation of a type-dictionary
{
public:
       static void Register(ISmith<T> smith)
       {
              m_Smith = smith; // The problem is here... m_Smith stays NULL.
       }

private:
       static ISmith<T> m_Smith;
}


When I call on my C++/CLI library from the default AppDomain (without the plugin system [see the next code example]) the library works as expected.

AppDomainSetup setup = new AppDomainSetup();
setup.ShadowCopyFiles = "true";
setup.SandboxInterop = true;
setup.PrivateBinPath = "Bin/";

string domainName = input.Substring(input.LastIndexOf('\\') + 1);
domainName = domainName.Substring(0, input.LastIndexOf('.'));
domainName += " Domain";

AppDomain domain = AppDomain.CreateDomain(domainName, null, setup);

string typename = AssemblyName.GetAssemblyName(input).FullName;
typename = typename.Substring(0, typename.IndexOf(','));
typename += ".Plugin";

IPlugin plugin = (IPlugin)(domain.CreateInstanceFromAndUnwrap(input,   typename));

plugin.Initialize(domain);

return plugin;


Any suggestions would be appreciated. As it is I'm banging my head against a wall, and this project is cement.
QuestionRe: Custom AppDomain - dll init problem Pin
Mark Salsbery20-Aug-08 15:28
Mark Salsbery20-Aug-08 15:28 
QuestionRe: Custom AppDomain - dll init problem Pin
Ryan Leckey20-Aug-08 15:51
Ryan Leckey20-Aug-08 15:51 
AnswerRe: Custom AppDomain - dll init problem Pin
Mark Salsbery21-Aug-08 6:02
Mark Salsbery21-Aug-08 6:02 
QuestionGet Owner Name Pin
codepro7120-Aug-08 8:04
codepro7120-Aug-08 8:04 
RantRe: Get Owner Name Pin
Manas Bhardwaj21-Aug-08 4:41
professionalManas Bhardwaj21-Aug-08 4:41 
GeneralRe: Get Owner Name Pin
led mike21-Aug-08 7:42
led mike21-Aug-08 7:42 
GeneralRe: Get Owner Name Pin
Manas Bhardwaj21-Aug-08 8:07
professionalManas Bhardwaj21-Aug-08 8:07 
QuestionPritning on dot matrix printer from ReportViewer - problem Pin
iva_koleva120-Aug-08 2:56
iva_koleva120-Aug-08 2:56 
Questionadding a custom dialog in Setup .NET 2005 Pin
saneng18-Aug-08 23:34
saneng18-Aug-08 23:34 
AnswerRe: adding a custom dialog in Setup .NET 2005 Pin
Paul Selormey20-Aug-08 23:23
Paul Selormey20-Aug-08 23:23 
QuestionBest way for bulk data Pin
osaleem18-Aug-08 20:02
osaleem18-Aug-08 20:02 
AnswerRe: Best way for bulk data Pin
AhsanS18-Aug-08 20:13
AhsanS18-Aug-08 20:13 
GeneralRe: Best way for bulk data Pin
osaleem18-Aug-08 20:20
osaleem18-Aug-08 20:20 
GeneralRe: Best way for bulk data Pin
Mark Salsbery19-Aug-08 8:10
Mark Salsbery19-Aug-08 8:10 
GeneralRe: Best way for bulk data Pin
led mike19-Aug-08 9:00
led mike19-Aug-08 9:00 
GeneralRe: Best way for bulk data Pin
Mark Salsbery19-Aug-08 9:08
Mark Salsbery19-Aug-08 9:08 
GeneralRe: Best way for bulk data Pin
led mike19-Aug-08 9:47
led mike19-Aug-08 9:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.