c# .net build error due to strawberry shake graphql client error - "access to the path 'obj\\berry' is denied"

2.1k Views Asked by At

Recently I updated my visual studio to the latest version of 17.5.1 and my target sdk version is NET 7.0 SDK (v7.0.102). Now I have a build error stating that "access to the path 'obj\berry' is denied". Anyone got the same error and suggestion to fix this issue?

2

There are 2 best solutions below

1
On

No idea if this is still an issue for you or not. I just had the problem this morning & couldn't figure it out. Tried closing studio & reopening it "as an admin" & that resolved the issue. It looks like the v17.5.x releases have added extra security ‍♀️

0
On

This is a problem when using v12 of StrawberryShake with later versions of VS2022. I can be worked around by adding the following line to a PropertyGroup in your .csproj file

<StrawberryShake_State>$(MSBuildProjectExtensionsPath)berry</StrawberryShake_State>

This has been fixed in v13, and is no longer necessary. I should mention there are however other issues in v13, that's not present in v12 with regards to the client. So I would urge you to have a look at the Github Issues list before upgrading to fix this minor issue.