Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Game Development How to Make a Video Game Score, Enemies, and Game State Monitor Player Health

i am getting a error Unhandled Exception: System.UnauthorizedAccessException: Access to the path "C:\Users\Media Server\

using UnityEngine; using System.Collections; using UnityEngine.UI;

public class ScoreCounter : MonoBehaviour {

public static int score;
private Text scoreCounterText;

// Use this for initialization void Start () {

    score = 0;
    scoreCounterText = GetComponent<Text>();

}

// Update is called once per frame void Update () { scoreCounterText.text = score + " Flies"; } }

Unhandled Exception: System.UnauthorizedAccessException: Access to the path "C:\Users\Media Server\Desktop\new game\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 <filename unknown>:0

at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean isAsync, Boolean anonymous) [0x00000] in <filename unknown>:0

at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access) [0x00000] in <filename unknown>:0

at Mono.CompilerServices.SymbolWriter.MonoSymbolWriter.WriteSymbolFile (Guid guid) [0x00000] in <filename unknown>:0

at Mono.CSharp.SymbolWriter+SymbolWriterImpl.WriteSymbolFile () [0x00000] in <filename unknown>:0

at Mono.CSharp.SymbolWriter.WriteSymbolFile () [0x00000] in <filename unknown>:0

at Mono.CSharp.CodeGen.Save (System.String name, Boolean saveDebugInfo, Mono.CSharp.Report Report) [0x00000] in <filename unknown>:0

at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0

at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0

1 Answer

Andres Badilla
Andres Badilla
4,692 Points

Are you using McAfee?

Looking it up online, it seems that this error may be related to your virus scanner. You may refer to this link for more information about this error.