- Home /
Problem in bulding exe for web player
Hi all, I have made a game which uses Mouse and Wii consoles as controllers. I am able to build exe for PC and Mac Standalone successfully. Now, when i try for web player, it is throwing following execptions.
ArgumentException: The Assembly Microsoft.VisualC is referenced by UniWii. 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) (at C:/BuildAgent/work/842f9557127e852/Editor/Mono/AssemblyHelper.cs:52)
UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String[] paths, System.String[] foldersToSearch) (at C:/BuildAgent/work/842f9557127e852/Editor/Mono/AssemblyHelper.cs:87)
UnityEditor.HostView:OnGUI()
Error building Player: Extracting referenced dlls failed.
UnityEditor.HostView:OnGUI()
Exception: Error building Player: Extracting referenced dlls failed.
UnityEditor.BuildPlayerWindow.BuildPlayerWithDefaultSettings (Boolean askForBuildLocation, BuildOptions forceOptions) (at C:/BuildAgent/work/842f9557127e852/Editor/Mono/BuildPlayerWindow.cs:367)
UnityEditor.BuildPlayerWindow.GUIBuildButtons (Boolean enableBuildButton, Boolean enableBuildAndRunButton, Boolean canInstallInBuildFolder) (at C:/BuildAgent/work/842f9557127e852/Editor/Mono/BuildPlayerWindow.cs:972)
UnityEditor.BuildPlayerWindow.ShowBuildTargetSettings () (at C:/BuildAgent/work/842f9557127e852/Editor/Mono/BuildPlayerWindow.cs:953)
UnityEditor.BuildPlayerWindow.OnGUI () (at C:/BuildAgent/work/842f9557127e852/Editor/Mono/BuildPlayerWindow.cs:726)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/BuildAgent/work/842f9557127e852/Editor/Mono/GUI/DockArea.cs:225)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/BuildAgent/work/842f9557127e852/Editor/Mono/GUI/DockArea.cs:218)
UnityEditor.HostView.OnGUI () (at C:/BuildAgent/work/842f9557127e852/Editor/Mono/GUI/DockArea.cs:119)
One solution i found is to change the optimization in player settings to .Net 2.0. But in my editor optimization tab is disabled.
Please help me in fixing this problem. Thank you.
Answer by Eric5h5 · Jun 12, 2012 at 07:17 AM
The error message already clearly answered that: "the dll is not allowed to be included". You can't use dlls in web players for security reasons.
Thanks for your answer Eric. Is there any other way i can overcome this porblem?
just as @Eric5h5 said, remove the dll and write your own code to ins$$anonymous$$d.
In other words you can't offer Wii control support in the webplayer unless it's recognised by the system as a default game controller. In this case you can just use the Joystic axis in Unity.
As far as i can tell the only way to access / read the Wii controller is by native code. So you could try to find a wrapper that creates a true gamecontroller for the operating system and advise the user to install it if he want Wii controller support.
But there's no way to include any native code in a webbuild (thanks god...)
edit
I've added this information to the wiki page ;)
Your answer
![](https://koobas.hobune.stream/wayback/20220613072643im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
WebPlayer and .exe not working? 1 Answer
Which well-known household-name brands are using Unity? 2 Answers
Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers
Webplayer not recognized in IE and Facebook 1 Answer
ChangeLog unity webplayer 3.4.2f3 1 Answer