- Home /
The type or namespace name `Web' does not exist in the namespace `System'
what is the problem?
using System; using System.Collections.Generic; using System.Text; using System.Net; using System.IO; using System.Web; using System.Web.Script.Serialization;
The type or namespace name `Web' does not exist in the namespace 'System'. Are you missing an assembly reference?
help me..
Answer by Keld lykke · Apr 18, 2011 at 10:36 PM
Check your player settings.
If you use restricted 2.0 (for web player) then namespaces with system access classes (potentially dangerous) are unavailable.
If you use unrestricted (for standalone) then everything supported by mono is available.
$$anonymous$$eld lykke's comment should be marked as the correct answer. I keep forgoting about this, and found his comment helpful more than once :)
For those of us who are less familiar with Unity settings, it'd be helpful if this answer could be elaborated upon with instructions on where to find the settings $$anonymous$$eld is referring to.
If you Google "Unity Player Settings" you get this manual page as the top hit, which tells you all you need to know....
https://docs.unity3d.com/$$anonymous$$anual/class-PlayerSettings.html
Thanks, tanoshimi. I'm guessing then that $$anonymous$$eld means to use ".Net 2.0" rather than ".Net 2.0 Subset" for the Api Compatibility Level.
Interestingly, on my instance of Unity (v5.3.5f1 on OS X), the settings cannot be changed for Web Player.
Standalone:
Web Player:
Answer by xmedeko · Jan 22, 2019 at 11:32 AM
Put files in the Assets
folder: mcs.rsp
and csc.rsp
and both have same content:
-r:System.Net.Http.dll -r:System.Web.dll
Then close and open Unity. Your VisualStudio project should have System.Web
in the References
now.
Worked for me. Do not place these files in any subfolders and user .net 2.0
Answer by Eric5h5 · Dec 06, 2010 at 04:58 AM
There is no System.Web in Unity.
Are you sure? I've got System.Web.dll in unity\3.1\Data\$$anonymous$$ono\lib\mono\2.0.
Considering that trying to use the System.Web namespace results in an error message about it not existing, I'm pretty sure.
Your answer
Follow this Question
Related Questions
Which namespaces are supported in each platform? 1 Answer
Editor assembly 2 Answers
Folder for non-editor dll 0 Answers
System.Data.dll Assembly reference problem when built as webplayer 2 Answers
Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers