相关文章推荐

I’m no to unity and am working on my first game. But I can’t get the MonoDevelop to run in debug because I get these two errors but there is no info about it.

Error Error: System.IO.FileNotFoundException: Could not find file ‘C:\Users\Tim’. (Error: System.IO.FileNotFoundException) (Assembly-UnityScript)

Error File name: ‘C:\Users\Tim’ (File name) (Assembly-UnityScript)

I’ve searched the whole project and can’t find any reference of a file starting with ‘C:\Users\Tim’. Any thoughts or suggestions?

C:\Users\Tim is located outside of your project, in the C: drive.

Maybe you moved some files around after you imported some assets?

Anyways if you re-import the ones that are missing, it won’t have that error.

The issue has to do with the projects Assembly-UnityScript, Assembly-UnityScript-Editor-firstpass, and Assembly-UnityScript-firstpass. If I delete them from the solution, the game builds fine and connects to Unity. Then later while I’m debugging they magically show up again and have to be deleted before I can build again. A coworker of mine is making a different game and doesn’t even have those projects at all. What do they do?

I’ve got this exact same problem too. Anybody else got it resolved?

When I import a package (e.g. Character Controller) Monodevelop starts throwing up this problem. Remove the package and monodevelop compiles fine. You can actually compile with these errors - but it plays havoc with detection of real errors in scripts which only then show up in Unity.

Can’t work out if this is a Unity problem or a Monodevelop problem.

Incidentally if you scroll to the bottom here, other people are having the same problem:

http://blog.gmane.org/gmane.comp.gnome.mono.bugs?set_lines=100000

The poster suggests the problem is due to spaces in usernames? e.g. His username is “Kaze Enji” but he is getting the following error:

1.Error Error: System.IO.FileNotFoundException: Could not find file
‘C:\Users\Kaze’. (Error: System.IO.FileNotFoundException)
(Assembly-UnityScript)
2.Error File name: ‘C:\Users\Kaze’ (File name) (Assembly-UnityScript)

I’m on Windows 7, the same as this guy, and my username has a space in it.

Tim… does you username have a space in too? Are you on Windows 7?

This is pretty much stalling Unity development right in it’s tracks for me right now!

More findings.

This problem only happens when you try and compile Javascript.

I code in C# but obviously my project breaks the moment I import some packages that contain Javascript (most of the Unity default packages do so).

Again, this simply appears to be a case of Unity not properly handling Windows usernames with spaces in them. I have included a screenshot of the exact fail situation in an empty project, note that my windows username folder contains a space, e.g. “Jules Smith” yet it’s clearly stopping at the space and just picking up the name “Jules”, hence giving a file not found error.

This is simple stuff, requiring a simple fix, but infuriating and not encouraging for my first foray into Unity. Do I really want to switch my entire game development over to something like Unity which has such crippling unpatched bugs?

This might be a revival of an old thread / problem, and it might be fixed already, but I haven’t looked at the Patch Notes yet. I still want to post how I fixed the problem since this was the thread that most closely matched my query. I was getting this error after I clicked Build even though it was working just fine up until I changed the name of my Build file - Windows .exe to something long.

"FileNotFoundException: Temp\StagingArea\My-build-filename-that-was-much-longer-than-this-working_Data\Mono\etc\mono\1.0\DefaultWsdlHelpGenerator.aspx does not exist

System.IO.File.Copy (System.String sourceFileName, System.String destFileName, Boolean overwrite) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:107)“”

Then when launching the .exe, it would just crash.

It sounds similar to what the previous posts above suggested, so I changed the name of the file to something much shorter, and the Build worked and did not crash. Hope this helps!

Sorry to lift this topic up again, but I have a very similar issue:
Trying to build my first Onward Custom Map with Unity, I encounter this Error:
DirectoryNotFoundException: Could not find a part of the path “/Users/myname/Documents/Programming/Unity/Projects/FirstOnwardCustomMap/TempUnityBuild/thumbnail.png”.
I am working on a Mac and have already granted full disc access to Unity, but Unity is not able to create this directory TempUnityBuild.
As soon as I do it, it starts building indeed, thumbnail.png is create and some files more, but the next issue comes up by producing the following error:
FileNotFoundException: \Users\myname\Documents\Programming\Unity\Projects\FirstOnwardCustomMap\Assets..\TempUnityBuild\custom_Android.map does not exist
When you look into the directory, there is a file named custom_android.map, but not with a capital A as it is searching for. When I change that letter, the same error occurres.
Is there a solution to this annoying problem?
Thank you in advance!

I now shortened the path length by moving the project to a different folder. No changes.

Full error message, just in case it would be of help to solve this problem:

FileNotFoundException: \Users\myname\Documents\UU\FOCM\Assets..\TempUnityBuild\custom_Android.map does not exist
System.IO.File.Copy (System.String sourceFileName, System.String destFileName, System.Boolean overwrite) (at :0)
Onward.CustomContent.EditorTools.OnwardLauncher.g__Quest|16_1 () (at /Users/myname/Documents/Programming/Unity/Projects/FirstOnwardCustomMap/Assets/OnwardCustomContent/Internal/Scripts/Editor/OnwardLauncher.cs:167)
Onward.CustomContent.EditorTools.OnwardLauncher.OnGUI () (at /Users/myname/Documents/Programming/Unity/Projects/FirstOnwardCustomMap/Assets/OnwardCustomContent/Internal/Scripts/Editor/OnwardLauncher.cs:63)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[ ] parameters, System.Globalization.CultureInfo culture) (at :0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[ ] parameters, System.Globalization.CultureInfo culture) (at :0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[ ] parameters) (at :0)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at /Users/bokken/buildslave/unity/build/Editor/Mono/HostView.cs:381)
UnityEditor.HostView.Invoke (System.String methodName) (at /Users/bokken/buildslave/unity/build/Editor/Mono/HostView.cs:375)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at /Users/bokken/buildslave/unity/build/Editor/Mono/HostView.cs:351)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:407)
UnityEditor.DockArea.OldOnGUI () (at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:396)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at /Users/bokken/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:293)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at /Users/bokken/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:508)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at /Users/bokken/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:491)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at /Users/bokken/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:484)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus) (at /Users/bokken/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:477)
UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at /Users/bokken/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:449)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at /Users/bokken/buildslave/unity/build/Modules/UIElements/Events/EventHandler.cs:77)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at /Users/bokken/buildslave/unity/build/Modules/UIElements/Events/MouseCaptureDispatchingStrategy.cs:92)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at /Users/bokken/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:310)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at /Users/bokken/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:275)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at /Users/bokken/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:238)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at /Users/bokken/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:203)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at /Users/bokken/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:44)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at /Users/bokken/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:301)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at /Users/bokken/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:159)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at /Users/bokken/buildslave/unity/build/Modules/UIElements/Panel.cs:257)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at /Users/bokken/buildslave/unity/build/Modules/UIElements/UIElementsUtility.bindings.cs:404)
UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at /Users/bokken/buildslave/unity/build/Modules/UIElements/UIElementsUtility.bindings.cs:194)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:197)