Click here to Skip to main content
13,597,704 members
Rate this:
 
Please Sign up or sign in to vote.
whenever i try to add controllers no modeel class available is displayed. i tried adding models but error is popped
"the process cannot access file. C:\users\Sony\AppData\Local\Temp\owblaa1w.zf\Model1.tt because it is used by another process"
plz help
Posted 1-Jun-15 3:57am
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

If you created the file yourself, you forgot to close the stream. If Visual Studio is using it, restart your system there are a lot of underground processes that might be using the files, and even in Task Manager you would have no idea which of the process is using it. (I have no idea of doing this in Diagnostics[^] namespace)

So the only option left for you (for the second problem of adding a model) would be to close the Visual Studio and restart the machine. The solution to first problem is, when you are creating a new Controller, you are provided with a few options, try removing the Model selection at the time and see if that works.

If controller is created without using a Model, then the problem is indeed with that file. Using this method, you can after ways add the model to your views (Models are required in Views, and in controllers only for data validations and other check ups).
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

Hello,

I do not know what the title has to do with it, but about your question, if you have Avast anti-virus, never spend time searching about "because it is used by another process" before trying with Avast dis-activated.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web04-2016 | 2.8.180621.3 | Last Updated 24 Nov 2015
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100