Contents tagged with C# Article
-
Extracting EXIF metadata from JPG images
Drew Noakes has written a great EXIF metadata extractor for JPG images in Java which was ported to C# by Ferret Renaud. This allows you to pull out the EXIF data like camera model & date taken. You can also access the width & height of the image without loading it into a .NET image object.
-
C# compiler as a service
Having the C# compiler as a service is an interesting new feature in Mono that was announced by Miguel de Icaza in his blog. Miguel leads the Mono project for Novell. This new feature supports the following scenarios:
-
Json.NET Dynamic Extensions
I've been working with RavenDB and Json.NET lately. RavenDB has some interesting schema-less capabilities using JSON documents. When interacting with the API, you either get serialized objects or JSON.NET classes. These are great, but it seemed like mixing in the Dynamic features of C# 4.0 would make things interesting.
-
DynamicDuck: Duck Typing in a Dynamic World
When dynamics came to C#, I hoped that we'd be able to use interfaces to bridge the gap between dynamic & static typing.
-
Embedding XSP (Mono.WebServer) in your application
First off, I've contributed some code to the Mono guys to make XSP its own library. You can get it as part of the 1.1.8 release. I'm still working on getting a few more additions to the library, but it has all of the basics to get you going.
Download the install from http://www.mono-project.com/Downloads and get the Mono.WebServer.dll in the Mono-1.1.8\lib\mono\1.0 directory.
With that in mind, here's some code:
int Port=8080;
string path="\\XSPSamples";
XSPWebSource websource=new XSPWebSource(IPAddress.Any,Port);
ApplicationServer WebAppServer=new ApplicationServer(websource);
//"[[hostname:]port:]VPath:realpath"
string cmdLine=Port+":/:"+path;
WebAppServer.AddApplicationsFromCommandLine(cmdLine);
WebAppServer.Start(true);
Console.WriteLine("Mono.WebServer running. Press enter to exit...");
Console.ReadLine();
WebAppServer.Stop();
The path should point at your ASP.NET files. That should do it...Enjoy!
NOTE: The API is probably not 100% stable, so you might need to "tweak" your application when a new Mono release comes out. -
Updated wsdl.exe with better data-binding support
My enhanced proxy generator has been updated with a few improvements.
- Fixed the the appsettingkey bug by merging in the Mono update:
http://bugzilla.ximian.com/show_bug.cgi?id=68795 - Added support for generating properties for arrays
The latest WSDL tool source & binary can be downloaded here. I've also added a test batch file that shows the differences between the .NET & enhanced wsdl.exe tools.
- Fixed the the appsettingkey bug by merging in the Mono update:
-
Data-Binding to Web Service Proxies
As I was preparing to post this code, I ran across Brad Adams very timely post:
Nikhil fires up the age old debate again…Data-binding to public fields... yes or no? -
Using web services locally
Aug 2, 2004 Update: Download the sample project for this post.
I am currently working on a system that utilizes asmx-based SOAP methods for inter-server communication. While it needs to work in a distributed environment, it also have needs to be installed on a single server. In this configuration, the web services could be installed on the server under different virtual directories. However, this adds overhead and addition setup requirements to the web application. While I realize that remoting already support switching between local and remote objects, I need to do it in an asmx world.