|
Hi all,
is dynamic loading of appDomains also work in compact framework .net ?
I have run example in dynamic loading in .net framework,
but since compact framework dont have AppDomainSetup Class,
so what can I do ?
The code in dynamic loading in .net framework is in
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp05162002.asp
but when the port the code to compact framework, the code doesn't work coz AppDomainSetup Class is missing in .net CF.
Can anyone point to sample code or articles on it ?
Thanks
|
|
|
|
|
Can somebody point me on an info, how to integrate smart tags into a visual studio editor?
Thanks,
Boni
|
|
|
|
|
Hi, this ia a simple question:
I want to popup a window (a Form derived class) and leave the Focus where it is. When I call "Show" on a Form with no parent, this Form gets the Focus and removes the Focus from the currently focussed Form, which results in the activ caption of my application becomming inactive. There is no problem, when the Form is a child window of some other Form or Control in my application, but then it is bound to the ClientRect of its parent. But I need it to show anywhere. The ToolTip class exactly behaves like I want my Form to behave, so there must be a way. I try to set the Focus back to where it was, but I cannot find out where it was and even if I could it makes the caption flicker.
Any Ideas?
Gerhard
|
|
|
|
|
I’m dabbling with some of .Nets reflection features and am running into the following problem…
I have the following code,
Assembly myAssembly = AppDomain.CurrentDomain.Load("MyAssembly");<br />
<br />
Type myType = localDataAssm.GetType("MyNameSpace.MyType", true, true);<br />
<br />
Object myObjectInstance = Activator.CreateInstance(myType);<br />
<br />
myType.InvokeMember("MyProperty", System.Reflection.BindingFlags.SetProperty , null, myObjectInstance, new object[] {"blah"});
The InvokeMember step fails with “Member Not Found”, even though the said property does indeed exist.
This seems to be straight forward to me so what am I missing??
Woke up this morning...and got myself a blog
|
|
|
|
|
Some things to check:
1) Is your property ReadOnly?
2) Is is private?
3) What does the QuckWatch window say when you open it for "myObjectInstance" ?
Regards,
Serge (Logic Software, Easy Projects .NET site)
|
|
|
|
|
Hi Serge, thanks for replying. The property is not readonly or private, it looks like this...
public string MyProperty<br />
{<br />
get<br />
{<br />
return _myPropertyValue;<br />
}<br />
set<br />
{<br />
_myPropertyValue = value;<br />
}<br />
}
However, the quickwatch window gives me what I expect to see. All the fields and properties are initialized to null or 0 (strings and ints)
Woke up this morning...and got myself a blog
|
|
|
|
|
Hi again,
Noticed one thing - you get a reference to the assembly to the var called "myAssembly" but you get a particular type with the following line (localDataAssm):
Type myType = localDataAssm.GetType("MyNameSpace.MyType”, true, true);
Object myObjectInstance = Activator.CreateInstance(myType);
I'll give an example on how I instantiate objects via Reflection:
<br />
' persistedType should be a full type name, e.g. "MyNamespace.MyClass"<br />
function myCreateObject(persistedType as string)<br />
return AppDomain.CurrentDomain.CreateInstanceAndUnwrap("HereGoesAssemblyFriendlyName", persistedType)<br />
end function<br />
Regards,
Serge (Logic Software, Easy Projects .NET site)
|
|
|
|
|
Thanks Serge, I didn't know about that particular method. In any case, it turns out I wasn't casting my parameter to the correct type and that was the problem.
Thanks for your help Serge, I appreciate it
Woke up this morning...and got myself a blog
|
|
|
|
|
|
I'm trying to use ExecuteCommand method of
System.ServiceProcess.ServiceController in my C# service controller app to
make a custom call to my service. I'm getting this exception and my service
never gets my custom message code? What's wrong?
Permissions?
Can ServiceControllerPermission help somehow? I'm lost a little.
Thanks a lot!
|
|
|
|
|
I would like to use Reflection to retreve the method in the dll.
Is the compact framework support it?
Because it throw an exception of with this message:
"An unhandled exception of type 'System.NotSupportedException' occurred in mscorlib.dll
Additional information: NotSupportedException"
with executing this code:
// loading a assembly
Assembly assembly = Assembly.LoadFrom("\\Program Files\\addintest\\calculate.dll");
// Invoking a method which is called "sum"
"foreach (Type type in assembly.GetTypes ())
{
object ibaseObject = Activator.CreateInstance (type);
object[] arguments = new object [] {10, 17.11};
object result = type.InvokeMember ("sum",
BindingFlags.Default,
null,
ibaseObject,
arguments);
this.textBox1.Text = result.ToString();
}"
|
|
|
|
|
Hi,
How do I get the installation path that the user selects while installing ?
If I had to copy a specific file from a folder in the local machine under the path where the application is installed , How do I do it ?(for eg : if I have a file named aaaa.dll which is tend to change frequently in the same folder as I have the setup.exe , if the installation path selected is C: and I have created 2 folders bin & data under it using File system editor in setup .How can I copy aaaa.dll to bin & data folder at runtime).
Thankx in advance
Priya
|
|
|
|
|
You already asked this and it was answered. Please refer to your previous post for replies.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
I recently encountered an installer which checks if the .NET Framework is installed on the target PC before installing the application itself. If the .NET Framework is not installed, it automatically installs the .NET Framework.
Any idea how this was done? I assume that the "Setup Project" was used for this because the application was created using MS Visual Studio .NET.
also:
How can I call a DOS command after the installer copies the files onto the installation directory?
For example:
After copying the files ("Copying Files: 100%"), can I call the executable "CABARC.exe" to extract some Cabinet (*.cab) files which were copied on the installation directory?
Thanks and God Bless.
Rafferty ![Big Grin | :-D](https://www.codeproject.com/script/Forums/Images/smiley_biggrin.gif)
|
|
|
|
|
No, VS.NET's setup project does not do this. You have to use a bootstrapper (an executable that performs certain checks - like checking for a particular version of the .NET Framework - before starting another setup, like the Windows Installer package created by VS.NET).
Microsoft does already have a solution for this. Read Creating a Single Setup Project to Install a .NET Framework Application and Dotnetfx.exe[^] in the .NET Developers Guide for more information.
There are also a couple bootstrappers that users have written here on CodeProject. One in particular can also install other components like MDAC. Just trying searching CodeProject if you're interested.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Can you give me more information about this bootstrapper?
From what I understood, the bootstrapper is the Setup.exe included (when you build the Setup Project) along with the ProjectSetup.msi. And that the bootstrapper is configured by modifying the Settings.ini correct? ![D'Oh! | :doh:](https://www.codeproject.com/script/Forums/Images/smiley_doh.gif)
|
|
|
|
|
Yes, it's all discussed in the link I gave you. It's pretty straight forward.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
|
For .NET Remoting in .NET 1.1, there were some changes made that could lead to the problems you're seeing. Read Automatic Deserialization in .NET Remoting[^] for more information.
Also, while it's typically not needed, you may need to add a URL membership condition (use -url for caspol.exe, or select Url in the drop-down if using the Microsoft .NET Framework Configuration MMC snap-in) with the necessary permissions.
If either possibility does not prove effective, please provide the exception type and message, otherwise it's practically impossible to accurately determine the problem.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I have a COM component that exposes a collection class. When I try to iterate the collection via interop using the c#.net code below, I get "QI for IEnumVARIANT failed on the unmanaged server." on the foreach line. Is my code correct? It compiles without problems but fails at runtime. The result count returned, however is correct.
ZyDocuments ZyDocs; // IEnumerable
ZyDocs = ZySearch.GetResults();
TextBox1.Text = "Result count: " + ZyDocs.Count;
foreach( ZyDocument z in ZyDocs)
ResultList.Items.Add( z.FileName );
Any ideas what this error means?
|
|
|
|
|
Hi all,
I would like to ask a question as below,
My software is composed of a main C# program with some other c# dll as components. In the first round, I will install all the stuff on the machine.
Then after sometime, I need to install some additional dll to work with
the main C# program. How can I do that ? Is that possible in C#.Net framework ?
The scenario is similiar to install Microsoft Office Suite, at the first time, I only install MS WORD with the MS Office main framework, but later I install also MS Excel (just like i install another DLL in my application)
onto the MS Office Main program on the PC.
Thanks
|
|
|
|
|
Sorry I wanna ask another question but it is related with ur subject i hope u can reply me
My app is a C# app .
I made the setup project to the app and i installed the .Net framework to make it run in win 8\98 environment but it is failed
Do u know what else the C# app needs to run in WIN 98 Environment ?
|
|
|
|
|
I am using vs. net
and there is no problem
|
|
|
|
|
When i developed in VB I created my own trace capability. It maintained recent trace entries in memory. I wonder if i can do the same with the Net Trace/Debug classes. Example, application will retain the last 100 trace entries in memory; when exception occurs, central error handler dumps trace information and creates error report. Can this scenario work with the Net Trace/Debug classes? Or do i need to write my own code? Can someone enlighten me on the How To? Coming from a VB background, the Net framework is a little over-whelming right now. I have read the Microsoft books and documentation but it appears the classes only do simple streaming using a "Listener" and cannot maintain a fixed-size collection/array or similar that will never hold more than a finite number of Trace/Debug entries.
Any advice is appreciated as i have exhausted my own research.
|
|
|
|
|
Extend the TraceListener class and register it using either the <trace> configuration section (under the <system.diagnostics> section) or add it programmatically to the Trace.Listeners and/or Debug.Listeners collection properties.
Your implementation of the TraceListener will work with the Trace and Debug class members and can do whatever it wants, from saving information in memory (caution, though - because of stack traces this can use a tremendous amount of memory) to writing to an XML Web Service and more.
Keep in mind the .NET tracing functionality in the .NET FCL really isn't very good. Whether your listener will use the information or not, it's still passed to your listener. I would recommend reading about the Exception Management Application Block for .NET[^] in the MSDN Patterns and Practices section.
Microsoft MVP, Visual C#
My Articles
|
|
|
|