- Newest
- Most votes
- Most comments
Hello Viikas,
In the PowerShell script sections, such as starting and stopping IIS, it's good to check and set the execution policy if needed
- name: Stop IIS
run: |
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
Start-Process -FilePath "iisreset" -ArgumentList "/stop" -Verb RunAs
Let me know if this solves your issue.
Thanks
Hello Abhinav,
Thanks for the response. but still I'm facing the issue pwsh command is getting executed but IIS server is not getting stop/start.
gitHub Action response :
Run Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass Start-Process -FilePath "iisreset" -ArgumentList "/stop" -Verb RunAs shell: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.EXE -command ". '{0}'" env: DOTNET_ROOT: C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\dotnet NUGET: C:\actions-runner_work_tool\nuget.exe\6.9.1\x64/nuget.exe
Error :
C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\dotnet\sdk\7.0.406\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(267,5): error MSB3021: Unable to copy file "obj\Release\net7.0\Fujiq.Api.dll" to "C:\inetpub\atarifujiq\publish\Fujiq.Api.dll". The process cannot access the file 'C:\inetpub\atarifujiq\publish\Fujiq.Api.dll' because it is being used by another process. [C:\actions-runner_work\AtariFusionRepo\AtariFusionRepo\AtariScraper\Fujiq.Api.csproj] Error: Process completed with exit code 1.
Relevant content
- Accepted Answerasked 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated a year ago
Hello Abhinav,
Thanks for the response. but still I'm facing the issue pwsh command is getting executed but IIS server is not getting stop/start.
gitHub Action response : Run Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass Start-Process -FilePath "iisreset" -ArgumentList "/stop" -Verb RunAs shell: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.EXE -command ". '{0}'" env: DOTNET_ROOT: C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\dotnet NUGET: C:\actions-runner_work_tool\nuget.exe\6.9.1\x64/nuget.exe
Error : C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\dotnet\sdk\7.0.406\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(267,5): error MSB3021: Unable to copy file "obj\Release\net7.0\Fujiq.Api.dll" to "C:\inetpub\atarifujiq\publish\Fujiq.Api.dll". The process cannot access the file 'C:\inetpub\atarifujiq\publish\Fujiq.Api.dll' because it is being used by another process. [C:\actions-runner_work\AtariFusionRepo\AtariFusionRepo\AtariScraper\Fujiq.Api.csproj] Error: Process completed with exit code 1.