Closed royto closed 5 years ago
I haven't seen this error before. It looks like the file could be locked or your console doesn't have the correct rights to open the file. Could you try to run stryker from a console with administration rights? Or try to clean the solution and rerun?
If the error keeps occuring we'll look further into this.
Same error with cmd in Admin mode.
I have tried with another project on the same machine and it works ...
I'll try to ask somebody else if he add the same issue on this project
I have tried on my colleague machine and he has the same issue ...
Could it be that the file is somehow marked as readonly?
I found in the documentation for System.IO.File.Create that this exception can only come from:
The caller does not have the required permission.
-or-
path specified a file that is read-only.
@royto Any update? I would like to close the issue if it was indeed a readonly property.
We could add a warning log that hints users to check for permissions and read-only propertys on the file the exception occurs on. But I would like to know for sure if this was the issue first.
I found the issue. \o/
It was relative to a configuration in my csproj.
I had this line :
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
When it is set to false, the dll are generated into bin/debug
and the folder netcoreapp2.0
was empty.
Stryker trying to generate in this folder, resulting to access denied
error.
I set it to true and unit test dll was generated into bin/Debug/netcoreapp2.0
.
I do not have the error anymore and stryker working well ...
I think that stryker should look for this property and use bin/Debug
or bin/Debug/FrameworkVersion
depending of the AppendTargetFrameworkToOutputPath property value.
Ah interesting! To be honest I was not aware of the AppendTargetFrameworkToOutputPath
property for projects. We should indeed take this into account.
Could you create a PR for this? Or should we create an issue for others to pick up.
I'm working on it. PR will be created soon I hope ...
Awesome! Looking forward to it 👍
Version: 0.7.0 (beta)
On running dotnet stryker on my unit test project (.NET Core 2.0), I encountered the following issue
I have multiple project reference (in .NET Standard 2.0) and I specify one of them with the
--project-file
optiondotnet stryker --project-file=..\..\Services\Services.csproj