Does anybody know if there are problems loading and assembly using the static 'Assembly.Load' or similar from a .NET COM+ component?
I have found that doing it my component wait as if it was in an infinite loop. I read only a line in the help about using the dinamic 'AppDomain.Load' inside these components. I did it and it works fine.
A second question would be now if it is possible load from the GAC using AppDomain.Load, providing an assembly partial name.
It's possible I didn't explain myself well: Inside an Enterprise Services component I need to invoke, using reflection, a .NET class. The class I'm instanciating has not a COM Wrapper so has not a ProgId, so I can't load it using GetTypeFromProgID.
Using the static method Assembly.LoadWithPartialName, I don't need to care about version, culture, etc. The problem is it stops my COM+ component (an Enterprise Service class), as if it was in an infinite loop.
Then I found AppDomain.Load. This method is not static, so I use AppDomain.CurrentDomain in order to call the method. And it works! . From Microsoft documentation about this method it says: "This method is defined for interoperability callers who cannot call the static Load method." However, is the only reference I've found all around about this topic.
If it works, why am I asking for? Cause I can't load assemblies with partial name using this method
I hope you're not being bored with my explanation!
I have installed the .NET framwework SDK. But whenever I try to manually compile code it can't find csc.exe. Is there some way to register it so i can use it right from a command prompt? I can only get it to work if i am running it from it's root directory.
I guess that, because you haven't installed the VS.NET IDE, you don't have the vcvars32.bat which sets all paths.
Here it is, just in case :
---- BEGINS HERE ----
@rem Root of Visual Studio common files.
@if "%VSINSTALLDIR%"=="" goto Usage
@if "%VCINSTALLDIR%"=="" set VCINSTALLDIR=%VSINSTALLDIR%
@rem Root of Visual Studio ide installed files.
@rem Root of Visual C++ installed files.
@echo Setting environment for using Microsoft Visual Studio .NET tools.
@echo (If you also have Visual C++ 6.0 installed and wish to use its tools
@echo from the command line, run vcvars32.bat for Visual C++ 6.0.)
@REM %VCINSTALLDIR%\Common7\Tools dir is added only for real setup.
@echo. VSINSTALLDIR variable is not set.
@echo SYNTAX: %0
---- ENDS HERE ----
Replace the FrameworkVersion variable with the appropriate value. Since you seem not to have the VS.NET IDE, in fact only a fraction of those variables are useful. For csc.exe, what's important to have is the PATH variable.
My recommendation is to directly add the appropriate paths in your user environment variables, from the OS config panel.
The best way is to use the "Visual Studio.NET (2003) Command Prompt" in your Tools menu under "Start/Program Files/Visual Studio.NET". This will launch a command (cmd) window with all of the paths set etc. The nice thing is that they only exist for that session so you don't end up with masses of system or user path settings which is a bit Win95ey!!! (IMHO!!)
leppie wrote: It doesnt add the path by default (god knows why).
The old VS6 installation used to ask you if you wanted this to happen. I'm surprised they took this out in VS7 (I don't remember seeing that option in the install either...). But there's always the "Visual Studio Command Prompt" shortcut that VS.NET creates. I've put it on my shortcut bar for easy use
As for the .NET FrameworkSDK, it provides a 'corvars.bat' in the FrameworkSDK/bin directory that sets PATH to allow for easy usage of the compilers and tools that come with the SDK.
leppie wrote: Windows operating systems still needs a reboot for PATH variables to take effect (no-one knows why).
The NT line doesn't require an OS reboot under these circumstances. When a new process starts, it gets its own copy of the current environment. This means that just the process will need to be restarted - not the whole OS. For instance, if you change PATH, all command lines you currently have open will continue to use the old PATH, but new ones you open will use the new PATH. You can force explorer to recognize new environment variable changes be using TaskManager to shut it down and restart it.
"Have you gone mad Frink? Put down that science pole!"
You can use Start -> Programs -> Microsoft Visual Studio .NET -> Visual Studio .NET Command Prompt
(That will set all path variables necessary for .NET applications). Perhaps I think this is a batch file. We can copy necessary values and put them onto System Path as well. I have'nt tried that anyway, but should work too.
I'm working on a project using both clr and non clr-Modules. I try to load a C#-assembly dxnamically from a c++Module translated with the clr option. For that I'm using the .Net-Assembly class (System.Reflection.Assembly). In some cases I cannot call the function I'd like to. That depends on wheter some Objects are instantiated whithin it or not.
Here the code of the function I try to call via Reflection:
This works :
public void Init()
//Doc.Document doc = new Doc.Document
String txt = "hello";
public void Init()
Doc.Document doc = new Doc.Document;
String txt = "hello";
In case the critical line is there, I cannot even debug into the function, making it hard to find the error. Any Ideas ?
You're right, but I just wrote it down wrong from my memory, so the paranthesises are not the problem. The assemblies/modules all compile properly, so it's not a syntactical error. The assemblies/modules just do not work with each other. pitty
You're right, but I just wrote it down wrong from my memory, so the paranthesises are not the problem. The modules all compile properly, so it's not a syntactical error. The modules just do /do not work with each other depending on the code in the function called across the modules. pitty
How can I start a process under a profile different thant the one logged in? I know you can use the 'runas' utility, but there's no parameter for the password. I suppose I could launch 'runas' via Process.Start, redirect it's standard input, then send the password myself, but isn't there an easier way?
Thanks in advance.
Kyosa Jamie Nordmeyer - Cho Dan
Portland, Oregon, USA
The new OS in development at Microsoft does not have a registry, it is all database driven!.
No I am not talking about server 2003, I think the codename is sledgehammer or something like that.
So the answer to your question is it is going to disappear as we know it.
Is there a way in the framework to search for a string/phrase inside of a file on the filesystem. I need similar functionality to Windows Search. I was going to write a class to read file streams and search that way, but I figured that if the framework provided that functionality, why reinvent the wheel? So if you know of a function call inside of the framework that can accomplish this I would appreciate it.
Last Visit: 31-Dec-99 18:00 Last Update: 21-Sep-23 12:38