Open JohanLarsson opened 6 years ago
Works fine on Win 10.
Updated VS on another Win 7 machine and it builds fine. Closing this as it is probably some weird issue on my machine.
I managed to repro this when installing 3DxWare 10 for Windows (64-bit) 10.5.8 from here: https://www.3dconnexion.eu/service/drivers.html
After install & reboot I got the issue on the other machine but only once out of maybe 20 rebuilds.
I used procmon and nothing is locking the snk which is weird if the driver is the culprit. Renaming the snk works so not locked.
Your repro project works on my machine, but I didn't try it many times. Looking at the Roslyn repo (since the compiler itself is throwing this error), I see some possibly-related reports: https://github.com/dotnet/roslyn/issues/17812 and https://github.com/dotnet/roslyn/issues/26232. Do you think you could add some information to them?
I agree that that driver would be a confusing culprit. Are you running antivirus? That can sometimes cause confusing file-locked issues.
I tried it on three machines today.
One fails on every rebuild of the repro project. Build works.
I tried setting MSBUILDDISABLENODEREUSE=1
but still 100% failures.
I updated VS and installed the driver on another machine and got one repro for maybe 50 attempts today.
Both are Win 7 with the same antivirus.
I can't disable antivirus on the computers ate work, at least I don't know how to do it but I do know I'm not supposed to :)
And yes, the issues you linked look like the same issue.
On a win 10 machine without antivirus and no driver it has worked every time. @eyalsk cloned the repo and ran a large number of builds using a script with 100% successrate.
I used Autodesk Inventor today, first time in a long time. Used it on the machine with 100% failing rebuilds. Only used it in the morning and did many reboots during the day.
Just for the record I ran this with the following configuration:
The powershell script I used is this: (initially ran it up to 50 times)
Clear-Host
For ($i = 0; $i -le 1000; $i++) {
Start-Process "msbuild" -ArgumentList "/t:rebuild /m" -NoNewWindow -Wait
}
This https://developercommunity.visualstudio.com/content/problem/138889/vs2017-strong-name-signing-issue-with-antivirus-cs.html looks like the same issue but we are using McAfee
If I change to new project format rebuild works.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net461</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>SignRepro.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
</Project>
My current suspicion is that installing the VS 15.7.5 update messed up my machine somehow. Been having this issue after the restart the day after the update.
Steps to reproduce
https://github.com/JohanLarsson/SignRepro
Actual behavior
I'm getting ^ when doing rebuild from visual studio. Have rebooted and getting it on two real slns that worked yesterday. Updated Visual Studio yesterday.
Environment data
msbuild /version: 15.7.180.61344
Windows 7 64.