- Home /
Internal Compiler Error
So my game runs the way it should in unity. But when i build it i get this error
Internal compiler error. See the console log for more information. output was: Unhandled Exception: System.UnauthorizedAccessException: Access to the path "C:\Users\Marshall\Documents\New Unity Project\Temp\Assembly-CSharp-firstpass.dll.mdb" is denied.
at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in :0
at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean isAsync, Boolean anonymous) [0x00000] in :0
at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access) [0x00000] in :0
at Mono.CompilerServices.SymbolWriter.MonoSymbolWriter.WriteSymbolFile (Guid guid) [0x00000] in :0
at Mono.CSharp.SymbolWriter+SymbolWriterImpl.WriteSymbolFile () [0x00000] in :0
at Mono.CSharp.SymbolWriter.WriteSymbolFile () [0x00000] in :0
at Mono.CSharp.CodeGen.Save (System.String name, Boolean saveDebugInfo, Mono.CSharp.Report Report) [0x00000] in :0
at Mono.CSharp.Driver.Compile () [0x00000] in :0
at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in :0
Im guessing it had something to do with unity compiling the scripts but i have no idea how to fix it. This is the script that might be causing the problem
using UnityEngine;
using System.Collections;
public class NetworkManager : MonoBehaviour
{
public Camera standbyCamera;
spawnSpot[] spawnSpots;
void Start ()
{
connect();
spawnSpots = GameObject.FindObjectsOfType<spawnSpot>();
}
void connect()
{
PhotonNetwork.ConnectUsingSettings("poop v1.0.0");
}
void OnGUI()
{
GUILayout.Label( PhotonNetwork.connectionStateDetailed.ToString() );
}
void OnJoinedLobby()
{
PhotonNetwork.JoinRandomRoom();
}
void OnPhotonRandomJoinFailed()
{
Debug.Log ("Failed to Join a Room");
PhotonNetwork.CreateRoom (null);
}
void OnJoinedRoom()
{
Debug.Log ("Successfully Joied Room");
spawnMyPlayer();
}
//section that is most likely causing the problem
void spawnMyPlayer()
{
if(spawnSpots == null)
{
Debug.LogError ("WTF?!?!?!");
}
spawnSpot mySpawnSpot = spawnSpots [Random.Range (0, spawnSpots.Length)];
GameObject myPlayerGO = (GameObject)PhotonNetwork.Instantiate ("PlayerController", mySpawnSpot.transform.position, mySpawnSpot.transform.rotation, 0);
standbyCamera.enabled = false;
((MonoBehaviour)myPlayerGO.GetComponent("FPSInputController")).enabled = true;
myPlayerGO.GetComponent<MouseLook> ().enabled = true;
}
}
when i say might be causing the problem I mean that is my best guess
Are you running any anti-virus software? Are you executing unity as an ad$$anonymous$$istrator?
You can go and delete the symbols file(the .mbd file) in "C:/Users/$$anonymous$$arshall/Documents/New Unity Project/" and see if that helps, if it's not there, something is blocking writing to that folder.
If it's there an tell you it can't be deleted(try again dialog) then something has a hook on the file. Save, close down applications, restart computer and give it another go.
i know both unity and monodevelop are allowed through windows firewall
We aren't talking about firewalls(application/hardware blocking/opening ports for communication), we're talking about the file system and I/O
Answer by Krizzen · Jan 02, 2015 at 01:03 PM
Seems you're having write permission issues, which really shouldn't happen in your Documents folder. You could have more than one user account on your computer and you (or Unity) is trying to save it in another user's Documents folder.
Make sure your user account has administrator permissions in Windows. Start->Control Panel->User & Accounts.
Alternative solutions (more than I want to post right now) are to right-click your Documents folder and make sure you have write permissions, or disable UAC.
Your answer
![](https://koobas.hobune.stream/wayback/20220613175417im_/https://answers.unity.com/themes/thub/images/avi.jpg)