bytecodealliance / wasmtime-dotnet

.NET embedding of Wasmtime https://bytecodealliance.github.io/wasmtime-dotnet/
Apache License 2.0
409 stars 52 forks source link

Fix CI. #305

Closed peterhuene closed 4 months ago

peterhuene commented 4 months ago

This commit:

peterhuene commented 4 months ago

"The process cannot access the file 'C:\Users\runneradmin\AppData\Local\Temp\tmpbr2aoc.tmp' because it is being used by another process."

Oh, Windows, never change.

kpreisser commented 4 months ago

"The process cannot access the file 'C:\Users\runneradmin\AppData\Local\Temp\tmpbr2aoc.tmp' because it is being used by another process."

FYI, on Windows it depends on which FileShare is specified when opening the file. When using File.ReadAllText(), it seems .NET specifies FileShare.Read, meaning opening the file fails when other code has opened the file for writing. It should work if you manually specify FileShare.ReadWrite, which allows others to open the file for reading and writing, as long as they specify a Read file share (allowing us to open the file for reading).