|
|
I don't know; I have some ideas though:
1.
can you avoid file:///G:\MSE\VisionC... and try a simple G:\MSE\VisionC...
2.
I've never called (T)requestedType.GetConstructors()[0].Invoke(null);
I tend to go with Activator.CreateInstance for historic reasons.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
|
I have code that creates a type, then instantiates it, so it basically consists of:
TypeBuilder typeBuilder = modBuilder.DefineType("Hello", TypeAttributes.Public, typeof(object), new Type[] { typeof(IHello) });
Type type = typeBuilder.CreateType();
...
IHello hello = (IHello)Activator.CreateInstance(type);
hello.SayHello("...");
Historic reasons typically are: that is how I did it the first time, it worked for me, and I continued doing it that way.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
|
I don't load DLLs in this context, I create the types I'm interested in on the spot. With lots of ILGenerator.Emit(). Sorry.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
|
When using reflection, I suggest you use interfaces as much as possible. When the dynamic types implement a static interface, it becomes a lot easier to call the methods that are part of said interface.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
|
I mean non-dynamic, known from day one, included in your EXE, hassle-free, aka "normal".
PS: a base class could offer the same advantages of course.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
|
You're welcome.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Hi
How to read values from ParameterInfo?
public void OnThreadException(object sender, ThreadExceptionEventArgs t)
{
MethodInfo aaa = ((MethodInfo)(t.Exception.TargetSite));
ParameterInfo[] sss = aaa.GetParameters();
//how to get values of sss array list?
LogTrace.LogMessage(t.Exception.ToString());
}
Thanks
Anand
|
|
|
|
|
|
I've written a client with common send/receive code for interaction with RESTful services. The code works, but I have a strange problem in one case. When POSTing to a REST service with HTTP body content of type application/xml the request gets to the server but does not include the session cookie. Yes, I have a common CookieContainer that is attached to the request before sending...logging proves that the cookie is in place.
Server traces show all other requests, both GET and POST, working successfully WITH the session attached. If I remove the body from this specific POST then server traces show the request WITH the session and then I receive an invalid content error (as I would expect). This is the only POST in the app at this point that carries body content.
Now for the really weird part...when debugging, if I break at the GetResponse() method and wait for 8-10 seconds before executing, it works...the server traces show the request WITH the session.
Any ideas? Is there a bug in the HttpWebRequest code? Why in the world would it work after pausing?
|
|
|
|
|
i am not able to connect ftp using ssl.i am getting following error,
The underlying connection was closed: The server committed a protocol violation.
i have searched a lot but not getting any solution. please help me
|
|
|
|
|
By binging your error message I have found two solutions,
I am not sure whether it is working or not.
Just try it out...
1. Add following statement to your code
myftpRequest.EnableSsl= true;
2. Add following code to your config file.
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing="true" />
</settings>
</system.net>
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
Hi all.
I'm about to start enhancing/debugging a VS2008 solution (am contracting at the moment and this is an urgentzzz (lol) jhob)
Does anyone know of a free application that will take a project and create a map of calling/called classes/methods? Basically so I don't have to trawl through and create my own.
Cheers
PS am a UK programmer, not an Indian university student with some homework to do.
|
|
|
|
|
The puppy you are looking for is NDepend[^].
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Thank you - looks good.
I take it you use it yourself?
|
|
|
|
|
Oh yes. We use it to quality check our code.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
hi All,
I have an issue for which i need some guidance/help. I've tried to be concise but please excuse me if you do not find it so.
I have a windows service which interacts with ms-office (and other) applications using their API.
I usually switch-off interactivity support if provided by the library/API so that no messagebox's are thrown during execution.
However, occasionally due to an unforeseen situation, we get a msgbox pop-up which blocks the service thread.
Given the nature of the application, its difficult to identify if the thread is blocked due to a message box or due to some processing overhead in the 3rd party application.
one of the solutions i thought of is as follows - implement a monitoring thread to check if the office app does not return control. if control is not returned within a given interval, kill the app and exit the task(which is not best but feasible most of the times)
however this seems more of a brute-force approach and it doesnt tell me what the issue is.
In some of the cases the issue may not be reproducible immediately.
Is there a more graceful approach?
has anyone resolved such an issue earlier on how to identify the above situation?
Thanks in advance
Kalyan
|
|
|
|
|
Yes, don't directly access the office applications themselves at all in services and this will not happen.
Any time you make calls to an application you run the risk of a dialog box coming up because those apps are made to interact at the UI layer with people.
Sorry, that's just the way it is.
Apps are made for PEOPLE to use... not services
|
|
|
|
|
Thanks Ray.
Unfortunately, my application will have to live with it for now.
Thanks for your reply.
|
|
|
|
|
another problem for me.. i recently read that in .net it supports 16 bytes maximum for a value type as it's capacity, so what happen if the structure exceed this limit , i know that there will be a performance issue due to pass by value, but i want to know how the stack reacts for this kind of situation.
|
|
|
|