2017-08-29 07:54:12 +08:00
< a name = "scaffold" > < / a >
### Scaffold the Movie model
2018-01-20 02:21:16 +08:00
* Run the following from the command line (in the project directory that contains the *Program.cs* , *Startup.cs* , and *.csproj* files):
2017-08-29 07:54:12 +08:00
```console
2018-05-30 07:47:52 +08:00
dotnet restore
2017-08-29 07:54:12 +08:00
dotnet aspnet-codegenerator razorpage -m Movie -dc MovieContext -udl -outDir Pages\Movies --referenceScriptLibraries
```
2018-01-20 02:21:16 +08:00
2017-11-16 06:03:32 +08:00
If you get the error:
```
No executable found matching command "dotnet-aspnet-codegenerator"
```
2018-03-23 08:47:21 +08:00
The preceeding error happens when you are in the wrong directory. Open a command shell to the project directory (The directory that contains the *Program.cs* , *Startup.cs* , and *.csproj* files), and then run the preceeding command.
2017-08-29 07:54:12 +08:00
If you get the error:
```
2018-01-24 23:27:24 +08:00
The process cannot access the file
'RazorPagesMovie/bin/Debug/netcoreapp2.0/RazorPagesMovie.dll'
2017-08-29 07:54:12 +08:00
because it is being used by another process.
```
2018-01-20 02:21:16 +08:00
Exit Visual Studio and run the command again.