#if DEBUG

Yea. Sadly, that’s probably the best that can be done for now. It’ll work fine for code you write but might not pick up something in another borrowed library. Another good rule would be to do a solution wide search for “Debug” before final release just to be sure…

If you’ve seen that in my webserver code, you might also have seen this:


 #if DEBUG
using Microsoft.SPOT;
 #endif

I know Debug will not be executed in Release. But by defining it that way I can remove the Microsoft.SPOT reference to reduce the footprint when building a release version of the library without removing all the Debug statements. That’s why…

ifdefing using statement doesn’t change anything. You still have the assembly in your reference list.

@ Architect: Notice the word remove :slight_smile:

My bad. :smiley:

@ Wouter Huysentruit, you wouldn’t happen to have a example of the webservercode that pulls files from an SD card would you ?

I am starting to try to take your example and the “PANDA BASED WEB SERVER” and try to put them together.

Yes I have. But it uses my SD-card detection class, you can find that one here: http://code.tinyclr.com/project/241/sd-card-detection/

Init code:


// Subscribe to SD-card Insert / Eject events
card.Insert += card_Insert;
card.Eject += card_Eject;

webServer.DenyAll = true;
if (card.Available && card.Volume.IsFormatted)
    webServer.AddVirtualDirectory("/", card.Volume.RootDirectory + "\\WebService", true);

Insert event:


private static void card_Insert(object sender, Microsoft.SPOT.IO.MediaEventArgs e)
{
   webServer.AddVirtualDirectory("/", e.Volume.RootDirectory + "\\WebService", true);
}

Eject event:


private static void card_Eject(object sender, Microsoft.SPOT.IO.MediaEventArgs e)
{
    webServer.RemoveAllFiles();
}

Not that hard as you can see :slight_smile:

LOL, ya for a master like yourself, for me as a baby not that simple.
where do i stick thoes things in at, and should i then comment out


server.AddEvent("/", new WebServer.EventCallback(sendForm));
server.AddEvent("/form", new WebServer.EventCallback(analyseForm));


in the original code ?

If you have the time to walk me though it, of course. If not i understand.

This is really off the original topic of this thread. You might want to start a new one.

Idd, though we were talking in the webserver topic :slight_smile:

thought i would get dinged for doing that.
Wish they had private messaging here.

here is the post title
WEBSERVER EXTENSION FOR FEZ COBRA using SD Card help