Is there a framework which can be used in your application, to make it expose internal objects on some port for inspection.
for.e.g. after i start my application in this case a GUI Application, and then say launch http://localhost:9100 then it should show me the statistics of the app.
I played a bit with HttpListener accepting connections and then outputting raw HTML, it works fine for simple tasks, but there is too much worked involved if i have make a proper object browser.
Thanks in Advance.
No, there aren't really any libraries that I'm familiar with. You would want something like visual studio implemented with it's runtime debug objet browser. That however is not an exposed API so you'd have to make your own.
As far as exposing the endpoint, you can use WCF to easily expose a TCP service (or whatever else, but NetTcp is just so easy) as an entrypoint into the functionality you are describing.
You can use Fiddler as a framework and write your own plugins in .net!
Check it out
http://www.fiddler2.com/Fiddler2/extensions.asp
Not sure if this is what you want, its not a framework, but a tool, but you can use .Net Memory Validator to see which objects (and how many of them) are allocated in your application. You need to look at the Objects tab.
You need to launch your app with DNMV - you can't view an already running process.
Related
Yesterday I asked about what technology should I use to create dynamic web content here:
PHP, AJAX and Java
The suggested methods were JSP, JQuery, etc. But I thought maybe because I'm a .Net developer and I don't have any experience in web development but I have experience in WPF and C#, maybe I should go with Silverlight but the main problem here would be how can I communicate with the core part of my system which is implemented in Java?
So the main question would be: What is the best [and easiest to learn] method to send a piece of data to the Java part, get the result and use it in silverlight? A tutorial or simple example would be nice.
Thanks a lot in advance.
You should use Java Web Services as stated. Use WCF to invoke the Java WS by adding a Service Reference in Visual Studio by its url, then use the proxy classes generated automatically (located in Reference.cs) to invoke the WS. This is easy but remember SilverLight WS invocations are always asynchronous, so you must cath the OnCompleted event to get the results of the invocation. WS are slow but if the machines are in the same LAN, invocation could take a few milliseconds.
I think pipes are not your solution as SilverLight executes in a Sandbox and have many restrictions on what you can do.
This will depend on many factors, however a relatively easy approach would be to use Java Web Services. On the .NET side, WSDL will be picked up and transformed into proxy class by WSDL.exe from the Windows SDK. If, however, these two systems are on the same server (and intend on staying this way), you may decide to use pipes.
I'm thinking about creating an application (or refactoring other in-house software) which could work effectively on a TS server (which from my knowledge means that every instance shares the core code/data in memory). Does the .NET framework actually support it or would I need to use some technique/technology/toolkit?
You don't need to do anything special to run under Terminal Services.
Just make sure that your program can run under multiple users simultaneously, and that it looks good at lower color depths.
I'm not sure if is possible, but perhaps you can try to ensure that only one instance of your application is running system-wide and from within you're code, try to seperate different user-instances. Can anyone elaborate on this?
I'm writing a windows service to do some daily processing, and I want to have a user-friendly way to interact with it. I'll just be doing basic things like checking its status and viewing logs, though I may decide I want to throw in a function call or two as well. After doing some research, it sounds like I need a separate application to perform these functions, since the service will run independently of any user that's logged into the host machine. My idea is to have this application interact with the service through some kind of interface, but I'm not sure where to begin.
What would be the simplest way to have an application communicate with a separate service? Would I use COM, WCF, a message queue, or something else entirely? I know there are probably a few ways to do this, so I would love to hear some pros and cons if possible.
Edit: The service and the application will both be running on the same machine.
Use WCF with NetNamedPipeBinding (allows only IPC on the same machine) or .NET Remoting. If you want to do it quickly choose the technology you are more familiar with. If you are not familiar with any of these technologies choose WCF because it is newer one and you will more probably use it again in the future - so exeprience with it will be useful.
Ideally you would create a separate application and use WCF to communicate between your service and this application.
But there is a 'cheaper' way which is to implement your own simple Web server using HttpListener. See http://msdn.microsoft.com/en-us/magazine/cc163879.aspx
This makes it easy to accept a few simple commands and you can send them using any web browser.
For viewing logs why not just tail the log files (using e.g. baretail)?
Skip WCF, and just use plain .NET Remoting. So much easier. Why they call it deprecated, God knows.
Edit: Seeing it runs on the same PC, the transport would be Named Pipes, IIRC WCF supports this too.
I have been doing ASP.NET / C# development for several years now. I have recently been offered a project that will need to be a winforms application (I am assuming .net 2.0).
Specs:
Winforms applicaton
Application will
have "testing for understanding
questions"
Must support flash and camtasia
files (these are "lessons")
I have done winforms development before, although nothing that is this involved. As there is a potential need for this application to be generic enough to apply to multiple different "disciplines", I would like to make the application generic enough to be easily configurable. The caveat here is that the application will need to be run from a CD-ROM and that I cannot rely explicitly on an internet connection. I was thinking of using something like SQL-Lite to support the configuration of the application. There will not be the need for updating the application as it will not be updated (at least I don't think, I guess there is the possibility of the application calling a webservice and configuring its-self based upon returned values).
With the requirements of supporting Flash and Camtasia, along with making this application generic enough to support different "disciplines", and my self being an ASP.NET developer, does anyone have an recommendations or tips/ tricks to look out for? Has anyone done something like this before?
Thanks in advance.
I'd start by writing a user control that can be used to either display a video file (presumably the output from Camtasia) or a Shockwave app. Once you have that user control, I'd then move on to look at the overall app.
If you're using Winforms, and the software is supposed to run from the CD (instead of merely be installed from CD) you'll need to have the DotNet framework already on the computer I think - but then I'm not an expert in deployment.
I find the application model in Winforms to be a lot easier than WebForms, but then I was "raised" in thick clients, so I suppose I would.
I would also, whilst agreeing to WinForms if needs really must, encourage the client to give consideration to using WPF instead - which opens up the idea that you could also provide access over the web using a simlar interface using Silverlight...
Just a few thoughts anyway - good luck with it...
I'm looking for a small and fast library implementing an HTTP server in .NET
My general requirements are:
Supports multiple simultaneous connections
Only needs to support static content (no server side processing)
HTTP only, HTTPS not needed
Preferably be able to serve a page from an in memory source. I want to integrate it into another app to be able to make changing data available via a browser, but I don't want to have to write it to a file on disk first. For example, just pass it a C# string to use as the current page content.
Preferably open source so I can modify it if needed
Definitely needs to be free... it's for a personal project with no budget other than my own time. I also want to be able to release the final product that would use this library freely (even if that means complying to the particular OSS license of that library.
Edit: To clarify some more, what I need can be REALLY simple. I need to be able to serve essentially 2 documents, which I would like to be served directly from memory. And that's it. Yes, I could write my own, but I wanted to make sure I wasn't doing something that was already available.
Use Cassini.
Free, Open Source.
It would take trivial hacking to serve from memory.
Well, how complicated of a HTTP server do you need? .NET 2.0 has the HttpListener Class which you can use to roll your own basic library. Since this is for a personal project and you are willing to invest the time, it would also make for a good learning experience as you you would get to learn how to work with the class. Additionally, according to the MSDN documentation, it has an asynchronous mode that gives each request its own thread.
Getting a basic HTTP server with the class up and running isn't too difficult either, you should be able to get it done in only a couple hundred lines of code.
Check out Kayak.
Note: kayak doesn't seem to be maintained anymore - though it deserves to be so
LightHTTP is an open-source library I've created that does exactly what you need.
It can be used in testing and mocking, or other scenarios where a lightweight HTTP server is preferred.
It works asynchronously.
Supports simultaneous connections.
It can serve anyway you'd need, since it's based on HttpListener.