Dotnet-new 1.02 raises exception

I’m trying to create a new template with dotnet-new version 1.02

the command is:

dotnet-new templates-webapp

results in

  return binding.rename(pathModule._makeLong(oldPath),

Error: EPERM: operation not permitted, rename 'D:\Source\Test\ss2\NetCoreTemplates-templates-webapp-c5443d2' -> 'D:\Source\Test\ss2\MyApp'
    at Error (native)
    at Object.fs.renameSync (fs.js:810:18)
    at C:\Users\Marco\AppData\Roaming\npm\node_modules\@servicestack\cli\src\dotnet-new.js:326:20
    at ZipFile.<anonymous> (C:\Users\Marco\AppData\Roaming\npm\node_modules\@servicestack\cli\node_modules\extract-zip\index.js:40:11)
    at emitNone (events.js:86:13)
    at ZipFile.emit (events.js:185:7)
    at FdSlicer.<anonymous> (C:\Users\Marco\AppData\Roaming\npm\node_modules\@servicestack\cli\node_modules\yauzl\index.js:182:10)
    at FdSlicer.g (events.js:291:16)
    at emitNone (events.js:86:13)
    at FdSlicer.emit (events.js:185:7)

Try disabling Windows Anti Virus real-time protection:

1 Like

Is there a way to add an exclusion to the real-time protection to ensure this works without the need to temp. disable real-time protection? If so, what should we exclude?

There’s no workaround I know of other than to wait a while for the real-time protection to run its course and verify the downloaded files are OK.

The latest .zip version of the selected template are first saved to the folder cache at:

$ C:\Users\{User}\.servicestack\cache

Which are then uncompressed and renamed in your current directory, I’ve added wait/retry logic with the latest version which may help, which you can install/upgrade with:

$ npm i -g @servicestack/cli@latest