none
Wierd error everytime that I try to create any file of any type in projects

    Question

  • Hi. I get this error all throughout my ms visual 2012 it says.

    The Process cannot access the file

    C:\Users\john\AppData\Local\Temp\bokr5pst.q22\Temp\WpfApplication4.csprogj' because it is being used by another process

    When Try to even add a new C# file for example to the project, it will say this error. Its not like Im creating files from the code, just right click on the project add new item, click anything, and it will say that error. This is happening for lots. I researched it and cant find it anywhere, also tried reinstalling an repairing but it wont work please help. Wasted 2 days already working on this now I am going to go mad.

    Also. For example. I just created new wpf project just as a test. And my designer shows me an error that says this for now reason, I didnt do any coding that made this error

    System.IO.IOException
    The process cannot access the file 'C:\Users\john\AppData\Local\Temp\tmpB210.tmp' because it is being used by another process.
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext, BlockingCall call, WaitHandle timeoutSignal)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalOutSynchronous(Action action, Int32 targetApartmentId, WaitHandle aborted, WaitHandle timeoutSignal)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalOut(Action action, Int32 targetApartmentId, WaitHandle aborted, CallSynchronizationMode syncMode, WaitHandle timeoutSignal)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TValue](RemoteHandle`1 targetObject, Action action, CallSynchronizationMode syncMode)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TResult,TValue](RemoteHandle`1 targetObject, Func`2 func, CallSynchronizationMode syncMode)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.CreateDesignerImpl(IHostSourceItem item, IHostTextEditor editor, RemoteCancellationToken remoteCancelToken)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.<>c__DisplayClass12.<Microsoft.Expression.DesignHost.IDesignerService.CreateDesigner>b__11(RemoteCancellationToken remoteToken)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.CallWithCancellation[TResult](CancellationToken cancelToken, Func`2 func)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.Microsoft.Expression.DesignHost.IDesignerService.CreateDesigner(IHostSourceItem item, IHostTextEditor editor, CancellationToken cancelToken)
       at Microsoft.Expression.DesignHost.IsolatedDesignerService.IsolatedDesignerView.CreateDesignerViewInfo(CancellationToken cancelToken)

    System.IO.IOException
    The process cannot access the file 'C:\Users\john\AppData\Local\Temp\tmpB210.tmp' because it is being used by another process.

    Server stack trace:
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext, BlockingCall call, WaitHandle timeoutSignal)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalIn(Action action, Int32 targetApartmentId)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalIn(IRemoteObject targetObject, Action action)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalIn[TResult](IRemoteObject targetObject, Func`1 func)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner(IRemoteHostSourceItem remoteItem, IRemoteHostTextEditor remoteEditor, IRemoteCancellationToken remoteToken)
       at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
       at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

    Exception rethrown at [0]:
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner(IRemoteHostSourceItem remoteItem, IRemoteHostTextEditor remoteEditor, IRemoteCancellationToken cancelToken)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.<>c__DisplayClass8.<CreateDesignerImpl>b__6(IRemoteDesignerService d)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass4`2.<MarshalOut>b__3()
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()

    System.IO.IOException
    The process cannot access the file 'C:\Users\john\AppData\Local\Temp\tmpB210.tmp' because it is being used by another process.
       at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
       at System.IO.File.InternalDelete(String path, Boolean checkHost)
       at System.IO.File.Delete(String path)
       at System.Windows.Input.Cursor.LoadFromStream(Stream cursorStream)
       at System.Windows.Input.Cursor..ctor(Stream cursorStream, Boolean scaleWithDpi)
       at Microsoft.Expression.Utility.FileResourceManager.GetCursor(String name)
       at Microsoft.Expression.DesignSurface.Tools.SelectionTool.CreateToolBehavior(ToolBehaviorContext behaviorContext)
       at Microsoft.Expression.DesignSurface.Tools.SelectionTool.CreateToolBehavior()
       at Microsoft.Expression.DesignSurface.Tools.Tool.Activate()
       at Microsoft.Expression.DesignSurface.Tools.ToolManager.set_ActiveTool(Tool value)
       at Microsoft.Expression.DesignSurface.Tools.ToolManager.UpdateHostTool()
       at Microsoft.Expression.DesignSurface.Tools.ToolManager.AttachHostListener()
       at Microsoft.Expression.DesignSurface.Tools.ToolManager.DocumentViewContext_ActiveViewChanged(Object sender, ViewChangedEventArgs e)
       at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
       at Microsoft.Expression.DesignSurface.DocumentViewContext.OnActiveViewChanged(ViewChangedEventArgs e)
       at Microsoft.Expression.DesignSurface.DocumentViewContext.SetActiveDocumentAndView(SceneView view, Item item, HostViewEventArgs e)
       at Microsoft.Expression.DesignSurface.DocumentViewContext.SetActiveView(SceneView view, HostViewEventArgs e)
       at Microsoft.Expression.DesignSurface.DocumentViewContext.CreateAndOpenView(ISourceItemContext sourceItem, CancellationToken cancelToken, Boolean activate, Boolean ensureOpenInHost, Boolean suppressUI)
       at Microsoft.Expression.DesignSurface.DesignerService.CreateDesigner(IHostSourceItem item, IHostTextEditor editor, CancellationToken cancelToken)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.<>c__DisplayClass10.<>c__DisplayClass12.<Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner>b__f(CancellationToken cancelToken)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.CallWithCancellation[TResult](IRemoteCancellationToken remoteToken, Func`2 func)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.<>c__DisplayClass10.<Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner>b__e()
       at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass16`1.<MarshalIn>b__15()
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()

    • Edited by john12122 Saturday, October 01, 2016 6:51 AM
    Saturday, October 01, 2016 6:39 AM

Answers

  • Hi John,

    Thank you for your post.

    Firstly, please open Task Manager to check which program uses the file. If used by Visual Studio, please create a pre-build action in your project with following steps.

    (1) Please close all third party processes or tools like anti-virus or others.

    (2) Please disable "Enable the Visual studio hosting process" in your project property, and view the output path in your project property too.

    (3) Clean the "Temp" folder, and then re-clean and build your project, test it again.

    (4)Please make sure that it is not the configuration manager issue:

    http://www.bytemedev.com/how-to-fix-visual-studio-error-the-process-cannot-access-the-file-because-it-is-being-used-by-another-process/

    Then, If possible, try to decide who owns access to a specific file and centralize access through a few well-known methods.

    Please refer to:

    http://stackoverflow.com/questions/26741191/ioexception-the-process-cannot-access-the-file-file-path-because-it-is-being

    If the repair and re-install still no help, how about using  http://aka.ms/vscollect to gather the installation logs. After using it, you will find vslogs.zip from %temp% folder. Please upload the file to  https://onedrive.live.com/ and share the link here

    Note: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you.

    Microsoft does not control these sites and has not tested any software or information found on these sites;

    Therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there.

    There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

    Click HERE to participate the survey.

    Tuesday, October 04, 2016 6:06 AM
    Moderator