Readonly conflicts with Perforce source control when building WASM #13172
-
We have a project that has a WASM (non-ASP.NET hosted) head alongside a Windows WinUI 3 head. We also (unfortunately) use Perforce as our source control. For anyone not familiar with Perforce, it uses readonly attributes on files to keep control of non-checked out files. Building our Windows WinUI 3 project is fine. No problems there. However when building our WASM head, I am constantly running into this build error: C:\Users\user.nuget\packages\uno.wasm.bootstrap\7.0.3\build\Uno.Wasm.Bootstrap.targets(310,3): error MSB3061: Unable to delete file "bin\Debug\net7.0\dist\package_78503626218a4156eba72b45e5a4a456aeaf1cfd\Assets\SplashScreen.png". Access to the path 'C:\Depots\MySolution\MyProject\MyProject.Wasm\bin\Debug\net7.0\dist\package_78503626218a4156eba72b45e5a4a456aeaf1cfd\Assets\SplashScreen.png' is denied. My understanding is that because SplashScreen.png is under source control, it has a readonly attribute applied to it. When it gets copied to the build folder on the initial build, it gets copied with this readonly attribute still applied. When a subsequent build tries to delete the old build artifacts, it's running into this error because of the readonly attribute. As it is now, I can only perform subsequent builds if I go in and manually delete the bin folder. Some things I have tried or considered:
(I am running Visual Studio 2022 17.6.5, BTW, and am on a Windows 10 x64 operating system.) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Ah, I just realized that I can fix this by removing the readonly attributes during the post-build event. That way, when the next build starts, it doesn't have to deal with any readonly attributes. The commands, BTW, are
Not sure if removing the attributes from the obj folder is necessary, but I have it there just in case. I will mark this as the answer. However, if anyone has a better way to resolve this, I'd be interested to hear. |
Beta Was this translation helpful? Give feedback.
Ah, I just realized that I can fix this by removing the readonly attributes during the post-build event. That way, when the next build starts, it doesn't have to deal with any readonly attributes. The commands, BTW, are
attrib -r bin\*.* /s
attrib -r obj\*.* /s
Not sure if removing the attributes from the obj folder is necessary, but I have it there just in case.
I will mark this as the answer. However, if anyone has a better way to resolve this, I'd be interested to hear.