Click here to Skip to main content
15,885,309 members
Please Sign up or sign in to vote.
1.00/5 (1 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

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).
 
Share this answer
 
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.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900