skyrbunny
skyrbunny
Explore posts from servers
CC#
Created by skyrbunny on 5/6/2023 in #help
❔ System.Net.HTTP missing
Hey there, I'm writing something that needs HTTP requests, but when I try to use it, it says System.Net doesn't have the namespace: The type or namespace name 'Http' does not exist in the namespace 'System.Net' (are you missing an assembly reference?) [CSharpDll]csharp(CS0234) Is there a certain platform or version I need to target to get it to work? My CSProj begins like <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">, and I need to keep it like that. Do I have to find a workaround?
84 replies
CC#
Created by skyrbunny on 3/5/2023 in #help
❔ Type is Typeof Dictionary
I need to test if a System.Type t is a Dictionary of any kind, but when I do this check, it doesn't pass it. How do I test for this?
if (t == typeof(Dictionary<,>))
{
Debug.Log("Dictionary");
return $"{{{ConvertType(t.GenericTypeArguments[0])}:{ConvertType(t.GenericTypeArguments[1])}}}";
}
if (t == typeof(Dictionary<,>))
{
Debug.Log("Dictionary");
return $"{{{ConvertType(t.GenericTypeArguments[0])}:{ConvertType(t.GenericTypeArguments[1])}}}";
}
I did a log of the type.tostring after and it said
System.Collections.Generic.Dictionary`2[System.String,System.Object]
System.Collections.Generic.Dictionary`2[System.String,System.Object]
so I believe it is indeed a dictionary. Shouldn't it have passed the check?
17 replies