-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System.UnauthorizedAccessException when running Stryker #272
Comments
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:
|
@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 Stryker trying to generate in this folder, resulting to I set it to true and unit test dll was generated into I think that stryker should look for this property and use |
Ah interesting! To be honest I was not aware of the 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 👍 |
If present and true or absent, build generate files to bin/Mode/targetFramework (ex: /bin/Deug/netcoreapp2.0) Is set to false, build generate file to bin/Mode (ex: bin/Debug) this fix the issue when AppendTargetFrameworkToOutputPath is set to false resulting to an System.UnauthorizedAccessException Fix stryker-mutator#272
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
The text was updated successfully, but these errors were encountered: