Join 34,000+ subscribers and receive articles from our
blog about software quality, testing, QA and security.

SmartInspect for UWP apps in C#: System.Drawing needed?


#1

I have an empty (= only 1 empty form) Universal Windows Platform (UWP) application made in C# 6 using Visual Studio 2015.

I’m using Windows 10, 64 bit, and SmartInspect 3.3.7

As soon as I want to run this application with code targeting SmartInspect, I get a ‘System.IO.FileNotFoundException’. It’s looking for System.Drawing, Version=2.0.0.0, but can not find that file.

In UWP applications, System.Drawing seems not to be available.

How can I use SmartInspect within a UWP application?


#2

Hello Hans,

Thanks for your posting! While SmartInspect was not designed for UWP, the full version of SmartInspect comes with the full source code of the libraries and you can remove the System.Drawing dependency in a custom build. The libraries already have as few dependencies as possible but due to the amount of log methods that are supported, some dependencies cannot be ruled out completely unfortunately. But creating a custom version of the libraries and removing certain log methods and the required DLLs works well and other customer use this approach as well.

I hope this helps!

Cheers,
Tobias


#3

Hi Tobias,

First I tried to make a UWP library of SmartInspect. At some point, I needed to start changing Socket code and Threads, so I stopped that route.

Then I made a new library of SmartInspect (don’t remember the type anymore). I managed to get it compiled (by removing some using statements and methods), but when I tried to use SmartInspect during runtime, I got other low level error messages about missing methods in the system libraries used by SmartInspect.

So I will try to use some other logging mechanism for now.

Hopefully waiting for an official SmartInspect from Gurock suitable for UWP.


#4

Hello Hans,

Thanks for your feedback. We don’t have experience with UWP, so it’s difficult to say what would be required to implement a UWP compatible build/library unfortunately. That said, the underlying SmartInspect protocol is really simple (both for log files and TCP/named pipes) and you can find our detailed documentation here:

http://www.gurock.com/smartinspect/smartinspect-log-formats-and-protocols.a.html

I hope this helps!

Cheers,
Tobias


#5

There is an open source project that replaces System.Drawing with a version that does not use Windows API stuff. I worked great when I was porting SmartInspect SDK to run on Mono. I tried to find the link for it but a couldn’t. Just google around a bit and you will find it.

HTH
Jim


#6

Thanks, Jim! It’s alternatively also possible to omit/remove the drawing related log methods completely and they would only be useful for UI related applications/code anyway.

Cheers,
Tobias