- Home /
(Solved) ArgumentException - Assembly System.web is referenced by log4net
I am trying to export my project for web and now getting the following error. I am running Unity Pro (4.1.5f1) on Mac.
Googled the issue, looked around the forum but couldn't find a practical solution. There is a similar question i found but wasn't helpful.
Build issue not finding .NET libraries and the suggested solution was
Any and all libraries that are .Net that you want to have with your project that Unity doesn't know about, simply place them in your Assets folder somewhere on some level, maybe Resources, however, that doesn't mean it will be allowed to be used even if it does exist, especially for the web player.
I don't know about the .Net libraries. I am using Mac and making use of Unity's default .Net libs.
Any help is greatly appreciated.
ArgumentException: The Assembly System.Web is referenced by log4net. But the dll is not allowed to be included or could not be found.
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2 cache, BuildTarget target)
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2 cache, BuildTarget target)
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2 cache, BuildTarget target)
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2 cache, BuildTarget target)
UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String[] paths, System.String[] foldersToSearch, BuildTarget target)
UnityEditor.HostView:OnGUI()
Answer by Varaughe · Dec 06, 2016 at 05:25 AM
Have you tried out , in PlayerSettings , Api Compatibility Level , to switch to .Net 2.0 (instead of .Net 2.0 Subset) ?
Answer by Graham-Dunnett · Jun 12, 2013 at 08:04 PM
When you build for a webplayer, there is a restriction on what Mono .Net DLLs are allowed to be included. There is a very long, slow to load html page here that tells you what is, and isn't supported. System.Web is shown at the very bottom of this page, and it's documented as not supported. Your game may not be using this directly, however, the build process has found that log4net uses System.Web features. If you don't know that you are using log4net
then life might get complicated. If you are using this, then simply use platform conditional compilation, and don't use log4net
when building for the web.
Thank you Graham for your reply. $$anonymous$$akes sense now. I think the issue is that I am using WWW for a browse functionality within my application. To look up a texture file selected by the user.
This most likely is the problem. I would like the user to be able to browse, grab a texture from local files. How would I address this issue?
I can't build it to a $$anonymous$$ac application either it gives out the same problem. So I need to go around the browse functionality somehow.
Update ... It did not have anything to do with WWW. See my answer for final solution.
Answer by IPI · Jun 12, 2013 at 09:52 PM
Got it working finally... Yaaay!
So for people who might get across this.
Graham was right, it was log4net problem. I had a asset resource (plugin) that was using log4net. I removed it from my solution. I wasn't even using it. I imported it to test for something.
The plugin in my case was MotionKit. It doesn't work on Mac either.
Anyways one way you could fine this is to search for log4net in your whole solution and see where it is. Fine the relevant source code and deal with it accordingly.
Hope this helps, Ash
That's like removing your leg because you have issues putting your socks on lol
Your answer
Follow this Question
Related Questions
unity is not creating build on .NET 2.0 SUBNET and getting ArgumentException. 1 Answer
Visual Studio 2010 Professional, Missing System.Web assembly reference 0 Answers
Can I use .NET 4.5 assembly as external library? 1 Answer
XML Deserializer from xml from a web server 0 Answers
BindingList could not be found? 2 Answers