dotnet-aspnet-codegenerator: Permission denied

Hi,

I am using 2024.3 EAP 2 (243.16718.44) on macOS Sonoma 14.5. 

In Rider I created a new Web App (Model-View-Controller), created my models and context class and then right-click on Controllers and select Add → Scaffold item → MVC Controller with views, using Entity Framework. After selecting the model and data context class, I click on Add and get the error: 

Running command: /Users/.../dotnet-aspnet-codegenerator --project /Users/.../WBCA.csproj --target-framework net6.0 --configuration "Debug" --no-build controller --controllerName WBController --relativeFolderPath "/Users/.../Controllers" --model WBCA.Models.WB --dataContext WBCA.Data.WBContext --useDefaultLayout --controllerNamespace WBCA.Controllers --useSqlite
Scaffolding 'MvcControllerEntityFramework' has finished with errors:
* Scaffold item command has failed with exception: An error occurred trying to start process '/Users/.../dotnet-aspnet-codegenerator' with working directory '/Users/.../S2P1'. Permission denied

In the Terminal, I changed to the obj folder of my project that contains dotnet-aspnet-codegenerator. I then ran the command again but instead of the absolute path for the --project option, I used a relative path --project ../S2P1.csproj and the scaffolding completed successfully. 

How can I get the scaffolding to work via the IDE?

0
1 comment

Hello Pkruger ,

Thank you for reaching Rider Forum. 

I could not reproduce the issue you are facing, nor in the 2024.2.5, neither in 2024.3.2EAP: 

Start checking required NuGet packages...
Checking 'Microsoft.VisualStudio.Web.CodeGeneration.Design' NuGet Package...
Building project 'WebApplication12'...
Check and install Code Generation tool...
Start scaffolding 'MvcArea'...
Running command: /Users/Anna.Morozyuk/RiderProjects/WebApplication12/WebApplication12/obj/dotnet-aspnet-codegenerator --project /Users/Anna.Morozyuk/RiderProjects/WebApplication12/WebApplication12/WebApplication12.csproj --target-framework net8.0 --configuration "Debug" --no-build area k
Finding the generator 'area'...
Running the generator 'area'...
RunTime 00:00:02.36
Scaffolding succeeded

Thus, could you please let me know the following: 

  1. Could you please share the settings you have after Add → Scaffold item → MVC Controller with views, using Entity Framework
  2. Please share logs from Help> Collest Logs and Diagnstic Data and attach them to our shared storage at https://uploads.jetbrains.com, then share the ID. 

Thank you in advance. 

0

Please sign in to leave a comment.