Why have I more spelling errors (CA1704 rule) in VSTS? - visual-studio-2017

I forced Code Analysis execution on VSTS (with Hosted2017 agent) to build a VS2017 solution using .NET framework 4.6.1. But I don't have the same spelling errors (CA1704 rule) on VSTS and on my machine with VS2017 Enterprise. On my machine, I fix all spelling errors. But on VSTS, I have more spelling errors !
MSBUILD : error CA1704: Microsoft.Naming : Correct the spelling of
How can I fix this problem ?

Ok, I found the problem. FxCop was executed in a different culture on my VS2017 (french) and on VSTS (english). I changed the language of my VS2017 in Options\Environment\InternationalSettings to English and restart VS2017. Now I get the same list of Code Analysis errors on VSTS and on my VS2017 !

Related

Visual Studio 2017: A fatal error has occurred and debugging needs to be terminated

When executing unit tests in debugging mode, I get the following error message:
A fatal error has occurred and debugging needs to be terminated. For more
details please see the Microsoft Help and Support web site.
HRESULT=0x8000ffff. ErrorCode=0x0.
So my steps to fix the issue,
1- [Preventive action]
Update the Visual studio 2017 , from the yellow flag notification or from
Tools >> Extensions & Updates >> Updates >> visual studio marketplace.
2- Search in your test solution for launchsettings.json file and remove it.
3- Clean the test solution .
4- Rebuild the project .
5- Make a cup of coffee ;).
Restarting Visual Studio solved this issue for me.
Cleaning the solution didn't work for me, and I couldn't find a launchsettings.json.
What eliminated the error for me: Changing the Startup project to a project other than the test project, as mentioned in this MSDN forum post.
Solution
Clean the solution and try again. See Visual Studio Forum for details. It helped in my case.
Try to check your depencency packages and references and try to ensure that all is ok. I fix this problem delete unnecessary and broke dependencies.
I had a similar issue and was because of the .Net Framework Target settings were wrong. It was set to .NET 5.0 which was not supported by VS2017. Opening the project in VS2019 solved the issue.

Warnings in VS2017 but all fine with VS2015

When load my .NET Frameowrk 4.6.2 solution in Visual Studio 2017, it gives me the following warning:
Severity Code Description Project File Line Suppression State
Warning Your project is not referencing the ".NETFramework,Version=v4.6.2" framework. Add a reference to ".NETFramework,Version=v4.6.2" in the "frameworks" section of your project.json, and then re-run NuGet restore.
Another:
Warning IDE0006 Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled. BigData 1 Active
However, loading in visual studio 2015 is totally fine with the exactly same solution files and structures.
Why is this and how I can solve it?
BTW, from what I read, in the latest updates, project.json is merged back to .csproj, why here it's still recommending something on project.json
I had this show up as an error when building shortly after migrating a solution from vs2015 to 2017, and then also doing some git restructuring. As it turns out, I think git was actually the culprit.
Regardless, manually deleting the bin & obj folders in the affected projects solved it for me. (Clean alone wasn't cutting it.)
Are you sure, you installed all needed packages for your project? It could be a not installed feature. Go in the launcher to modify and check, are there all dependencies installed?

Code Coverage for .NET Standard project

How do I get code coverage results for .NET Standard projects created with Visual Studio 2017?
I've tried using the feature that comes with Visual Studio (Menu → Test → Analyze Code Coverage → All tests). That gives me the following report:
This is not what I expect because:
None of my actual projects are listed, instead I'm only seeing test projects.
None of my code in those test projects are listed, instead I'm seeing something called AutoGeneratedProgram.
I've tried using dotCover. It just says that it doesn't support my projects.
I've tried using OpenCover. It says nothing is covered:
Now I've run out of things to try. Any help would be appreciated!
Problem solved by adding this to my csproj:
<DebugType>Full</DebugType>

SonarQube Visual Studio 2013 C++ Plugin

I have the following setup...
TeamCity 7.1.5
Visual Studio 2013
SonarQube 3.7.4
SonarQube C++ Community plugin 0.9.1
We have a number of Visual Studio C++ solutions / projects. They all process successfully through TeamCity - Compile, Unit Test, Nuget Package generation, etc. I am now trying to add the Sonar analysis of those project, using the C++ Community plugin.
Now I understand that the plugin itself does not perform any analysis, that must be done separately and the plugin only imports the results. The plugin is successfully able to identify and import all the Source files, I can seem them listed in within the SonarQube dashboard.
The actual build and analysis is done via Visual Studio / Visual C++ compiler using MSBuild. I have enabled Code Analysis via MSBuild and I can see that it is generating a list of issues. However, I cannot get SonarQube to import that list of issues.
For the MSBuild command I am using the following parameters...
/t:Build
/p:Configuration=Debug
/p:RunCodeAnalysis=True;CodeAnalysisRuleSet=AllRules.ruleset;verbosity=normal
/filelogger
/flp:verbosity=diagnostic
I have confirmed that a MSBuild.log file is being generated and it is finding issues.
The Sonar-Runner steps has the following options...
-Dsonar.language=c++
-Dsonar.projectKey=MYProject
-Dsonar.projectName=MYProject
-Dsonar.projectVersion=0.0.1
-Dsonar.sources=Src
-Dsonar.cxx.compiler.reportPath=*.log
-Dsonar.cxx.compiler.charset=UTF-8
-Dsonar.exclusions=**/packages/**/*
-Dsonar.cxx.includeDirectories=Src/Packages "
-Dsonar.cxx.compiler.parser='Visual C++'"
I have also tried using -Dsonar.cxx.compiler.reportPath=MSbuild.log
The Sonar appears to run fine, but just doesn't pick up the code analysis issues.
Could anyone please suggest what I could be doing wrong, or what else to try.
Any help would be greatly appreciated.
Thanks & Regards,
RG
try the last version of the plugin and make sure all compiler related rules are enabled in your profile. And check your compilation build log, if the paths are relative in there you need to pass /FC flag to the compilation

I get FatalExecutionEngineError when I am debugging unit test with Resharper on visual studio

I keep getting this error message when I am trying to debug through my project. The same code works on colleges machine. I currently use Windows 8.1 and resharper 8.2 and after initial few methods within a selenium test. I am also using VMware workstation 10.0.4
FatalExecutionEngineError occurred
Message: Managed Debugging Assistant 'FatalExecutionEngineError' has detected a problem in
'C:\Program Files (x86)\JetBrains\ReSharper\v8.2\Bin\JetBrains.ReSharper.TaskRunner.CLR45.x64.exe'.
Additional information: The runtime has encountered a fatal error.
The address of the error was at 0x7d608056, on thread 0xfb8. The error code is 0xc0000005.
This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code.
Common sources of this bug include user marshaling errors for COM-interop or PInvoke,
which may corrupt the stack.
Try with stopping the Re-Sharper plugin. If it start to work after disable of Re-Sharper from Visual Studio then uninstall and install re-sharper.
When i turn off breaking on all exceptions in VS (Ctrl+Alt+E), debugging becames available.