Closed GoogleCodeExporter closed 8 years ago
Actually it's quite easy to make it work. One just have to implement a few
URLencode and decode functions. And looking at the source you have already
included this functionality from mono, for WINCE. So if you update to the
latest version of HTTPUtility, there is no need to depend on System.Web, and we
can run on client profile instead.
Original comment by anders.rune.jensen
on 15 Sep 2010 at 6:07
Attached is a patch removing the -r:System.Web.dll dependency, and updating
src/Core/HttpUtility.cs from Mono, adding the UrlEncode method needed elsewhere.
This patch is important to Linux distributions as it will reduce the dependency
burden of apps (such as Banshee) using gdata-sharp.
Original comment by gabriel....@gmail.com
on 29 Oct 2010 at 5:26
Attachments:
Issue 406 has been merged into this issue.
Original comment by ccherub...@google.com
on 30 Jan 2011 at 8:35
I'm not sure we can just copy and paste that code taken from Mono.
I saw you added the following line:
"Taken from
http://github.com/mono/mono/tree/master/mcs/class/System.Web/System.Web.Util/"
Is it enough according to Mono license?
Original comment by ccherub...@google.com
on 7 Feb 2011 at 1:41
It looks like the MIT license, which says:-
// subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
Therefore, I'm guessing you would need to add the copyright statement and the
license text?
Original comment by hyper...@gmail.com
on 7 Feb 2011 at 1:46
The copyright statement and license are already in that file, see
http://code.google.com/p/google-gdata/source/browse/trunk/clients/cs/src/core/Ht
tpUtility.cs
The "taken from" part is just extra courtesy to anybody reading the code so
they know where to contribute back if they want.
Original comment by gabriel....@gmail.com
on 7 Feb 2011 at 3:00
Patch committed in rev.1069, please advise of any new issues.
Original comment by ccherub...@google.com
on 7 Feb 2011 at 5:33
Not sure what happened, but when this was committed some weirdness happened
with the line endings, breaking the build for me. The attached patch fixes it.
Original comment by gabriel....@gmail.com
on 7 Feb 2011 at 7:38
Hrm, that patch didn't work, I guess svn diff & patch can't handle line endings
too well either. I'm attaching the HttpUtility.cs file that works for me.
Original comment by gabriel....@gmail.com
on 7 Feb 2011 at 7:41
Attachments:
What errors do you get with the file I committed?
Original comment by ccherub...@google.com
on 7 Feb 2011 at 7:42
$ make
src/core/HttpUtility.cs(962,54): error CS1525: Unexpected symbol `else'
src/core/HttpUtility.cs(965,53): error CS1519: Unexpected symbol `break' in
class, struct, or interface member declaration
src/core/HttpUtility.cs(967,30): error CS1518: Expected `class', `delegate',
`enum', `interface', or `struct'
src/core/HttpUtility.cs(975,36): error CS0116: A namespace can only contain
types and namespace declarations
src/core/HttpUtility.cs(1042,38): error CS0116: A namespace can only contain
types and namespace declarations
src/core/HttpUtility.cs(1088,9): error CS8025: Parsing error
Compilation failed: 6 error(s), 0 warnings
make: *** [Google.GData.Client.dll] Error 1
This is because in HttpUtility some #if #else statements are messed up, like
this one:
#if TARGET_JVM^M if (s [i] > 159 && s [i] < 256) {^M#else
Original comment by gabriel....@gmail.com
on 7 Feb 2011 at 7:45
Please, reconsider the latest update to source code. IMHO it's not a good idea
to "overwrite" .NET framework classes. What happens if I need the google dll
and the framework dll in the same project? I get a collision.
I test that in a asp.net web application (NET 2.0). I added the
Google.GData.Client.dll. Now I'm not able to use the System.Web.HttpUtility.
The compiler give me:
Error 1 The type 'System.Web.HttpUtility' exists in both
'D:\..mypath...\MixDll\_dll\Google.GData.Client.dll' and
'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.dll' D:\..mypath...\Mi
xDll\WA2\Default.aspx.cs 13 35 WA2
Consider to use another namespace for you custom HttpUtility.
Fabrizio
PS: Mono does the right thing because mono is a framework. It reqrites all MS
dlls. You will never recerence mono dlls *and* MS Net dlls.
Original comment by fht...@gmail.com
on 8 Feb 2011 at 7:14
Fabrizio,
I completely agree with you, however that approach was decided before I joined
this project.
Even if I'll be very happy not to overwrite .NET framework classes for the
reasons you describe, I don't think I'll have time in the near future to write
that patch.
Contributions by external developers are always welcome, though :)
Claudio
PS: I replaced the file with the wrong line endings in rev.1070
Original comment by ccherub...@google.com
on 8 Feb 2011 at 9:17
Original issue reported on code.google.com by
anders.rune.jensen
on 14 Sep 2010 at 11:01