3

I am doing some R&D in ASP.NET Core Rendering SDK, Whenever I make the changes in .cshtml file, I need to run this command docker-compose restart rendering cm to reflect the changes. Is this the right way to see the changes?

As per my understanding, this is a connected mode so we don't have to do anything. changes will automatically trigger and push to the CM environment.

I am using the default template project of

dotnet new sitecore.aspnet.gettingstarted -n MyProject

Here is the logs

watch : Killing process 1612
watch : Process id 1612 ran for 121995ms
watch : Exited
watch : File changed: C:\solution\src\rendering\Views\Shared\Components\SitecoreComponent\Demo.cshtml
watch : Modifying command to use --no-restore
watch : Started 'C:\Program Files\dotnet\dotnet.exe' 'run --no-restore --no-launch-profile' with process id 2988
watch : Running dotnet with the following arguments: run --no-restore --no-launch-profile
watch : Started
C:\Program Files\dotnet\sdk\5.0.400\Sdks\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Sdk.Razor.CurrentVersion.targets(750,5): 
warning MSB3026: Could not copy "C:\solution\src\rendering/obj/container/Debug\netcoreapp3.1\MyProject.Views.dll" to "C:\solution\src\rendering\bin\container\Debug\netcoreapp3.1\MyProject.Views.dll". 
Beginning retry 5 in 1000ms. The process cannot access the file 
'C:\solution\src\rendering\bin\container\Debug\netcoreapp3.1\MyProject.Views.dll' because it is being used by another process. [C:\solution\src\rendering\RenderingHost.csproj]
watch : Waiting for a file to change before restarting dotnet...
The build failed. Fix the build errors and run again.
watch : Exited with error code 1
2
  • Can you share the logs from your rendering container? Any errors? You should see it recompiling there on any changes. Aug 26 '21 at 13:38
  • @nickwesselman: I have updated the question and provided the logs of the rendering project. Aug 26 '21 at 15:27
1

This appears to be a bug in a recent update to Docker Desktop or Windows. I'm able to reproduce the issue in a simple Dockerized ASP.NET Core application. It appears others may be witnessing similar behavior.

I've reported the issue to Docker moby. In the meantime you can change your rendering container to use a dotnet run instead, though that will still require a build and up with each change. You can also use dotnet watch outside of Docker, for example:

dotnet watch --project .\src\rendering\ run

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.