Download project from codeplex. gadgeteer-36144.zip
I copied the folder “GadgeteerCore” from "gadgeteer-36144.zip\Main" beside my own project
Open the solution from GadgeteerCore\ and do the described changes (i->j)
Right click the solution and do a rebuild
Closed the Solution
Replaced the files “Gadgeteer.WebServer.dll” & “Gadgeteer.WebServer.pdb” & “Gadgeteer.WebServer.xml” from “GadgeteerCore\Libraries\Core\WebServer43\bin\Debug” in “C:\Program Files (x86)\Microsoft .NET Gadgeteer\Core\Assemblies.NET Micro Framework 4.3”.
Opened my solution
Removed reference
Renew reference from “C:\Program Files (x86)\Microsoft .NET Gadgeteer\Core\Assemblies.NET Micro Framework 4.3\Gadgeteer.WebServer.dll”
and it didn’t work although it was the new file.
Next Try:
Opened my own solution
Added an existing project an opened the WebServer43.csproj from GadgeteerCore\Libraries\Core\WebServer43
There I checked the changes and they are still available
Removed the reference Gadgeteer.Webserver from my project
Added a project reference to the new project WebServer43
Now I rebuild my solution
Checked, whether the file is replaced in my project debug folder “bin\Debug” → yes
Now I started my project
I could not believe, I got the Response
When I moved the files from my debug folder to the Microsoft wolder it didn’t work as well?
Then I figured out, that you have to copy both directories “le” “be” and its content to the Microsoft folder by replacing all files, that hint was missing in the other post.
Now it works!!! Hopefully for you, too!!! Let me know.
If not, I can send you the files via mail.
Life saver!!! This worked!!!
I’m embarrassed to admit how long I looked at my code trying to figure this out.
I hope the bug gets fixed soon, but in the meantime THANKYOU for the workaround.
@ Mike
Thanks. I did see there this issue was noted a year ago at https://gadgeteer.codeplex.com/workitem/1861 and that the dll could be patched. However, since Gadgeteer 2.43.1 was released perhaps 6 months ago, I assumed that it had been addressed given all the interest in IoT.
I was surprised to see it was not.
It is a pitty that a know bug in Responder.cs (of Gadgeteer.Webserver) stays so long and has to be corrected by every user. For users like me, not a professional, it can be hard to correct it.
The post of “bin-blank” (https://www.ghielectronics.com/community/forum/topic?id=16330&page=1#msg162088) was very helpful but a little too complex for me.
Therefore a new try to explain what to do, hopefully it can help other users:
How to correct the Bug in responder.cs in order to work with webpages.
Copy zip file from Downloads to Library > documents (or another folder for that purpose).
Copy folder “GadgeteerCore” from "gadgeteer-36144.zip\Main" in the Documents folder. (First unzipping is not neccessary)
Open in VS 2013 Community the project gadgeteerCore.sln
Open responder.cs and scroll to the last method “Proteted Byte[] ReceivedListToByteArray(…)”
Change result[lastIndex + i] = data[j]; to result[lastIndex + j] = data[j]; (make from +i → +j)
At the top of the Solution Explorer right click Solution’CS_…'(1 project) and click Rebuild Solution. (Must end in succeded whithout errors)
Save and close the solution, close VS 2013 Community.
Open File Explorer and navigate in Documents to “GadgeteerCore\Libraries\Core\WebServer43\Bin\Debug”
10 Select all the directories and files and copy everything to “C:\Program Files (x86)\Microsoft.Net Gadgeteer\Core\Assemblies.Net Micro Framework 4.3”
11 If asked for administration level and replace existing file, accept and do it.
12 Make in VS 2013 Community a Webserver project exactly as the example in the Gadgeteer beginners book from GHI, chapter 14
13 Hit “Start” and the project wil be run. (If no compile errors occur, the Webserver should work)
14 Try out: Open a webbrowser and type the url http://192.168.x.x (e.q: http://192.168.0.15) and enter. (of cause fill in the IP address given to the module)
15 The HTML page should appear on the screen. The webserver works!
16 Type something in the text field and hit ENTER to respond. See on the board the changed state of the Led.
17 If everything works, make a backup copy of the folder: “C:\Program Files (x86)\Microsoft.Net Gadgeteer\Core\Assemblies.Net Micro Framework 4.3”
18 The backup copy can be used on other computers by replacing the original folder with the corrected one.
Remarks:
In References the reference Gadgeteer.Webserver should point to the corrected Gadgeteer.Webserver if not placed in the original folder:
“C:\Program Files (x86)\Microsoft.Net Gadgeteer\Core\Assemblies.Net Micro Framework 4.3”.
The corrected “.NET Micro Framework 4.3” has everything to work for all Gadgeteer projects.
Make a save backup Flashdisk of: “C:\Program Files (x86)\Microsoft.Net Gadgeteer\Core\Assemblies.Net Micro Framework 4.3”, needed in case of a new system setup.
Adendum to my Original post:
Ip addresses are not visible but the one from point 1 is: " https :// gadgeteer.codeplex.com/ SourceControl/ latest#Main/ GadgeteerCore/ Libraries/Core/ WebServer43/ Responder. cs (remove all the spaces) and can be founf on page 42, chapter 14, of the GHI manual “.NET Gadgeteer for Beginners” (https ://www.ghielectronics.com/downloads/Gadgeteer/NET_Gadgeteer_for_beginners. pdf).
I found it neccessary to add this, because it is basic info)
(the IP address of the module is of cause your chooice)
@ Gus - thanks Gus. And it would be great to explain it with some more details for beginners like me. Don’t hasitate to add more chapters in the Beginners book. It’s a great help!
Exception first-chance of type ‘System.IndexOutOfRangeException’ in Gadgeteer.WebServer.dll
I donwloaded the gadgeteer-36144.zip but the Webserver Responder.cs source code is now
ReceivedListToByteArray(ArrayList receivedList, int size)
{
byte[] result = new byte[size];
int lastIndex = 0;
foreach (byte[] data in receivedList)
{
int i = 0;
while (i < data.Length)
{
result[lastIndex + i] = data[i];
i++;
}
lastIndex = lastIndex + i;
}
// Debug.Print("raw array created " + result.Length + "-------------------------------------------------------------");
return result;
}
The mainboard I use is FEZ Spider I, the ethernet sheld is J11D 1.2.