SonarLint on Visual Studio does not show warning in Error pane - sonarlint-vs

Visual Studio 2017 (15.7.4) with SonarLint 4.1.0.3539 extension installed.
Loaded ASP.NET Core 2.0 solution, which consists of projects, targeting either .Net Framework 4.7.1 or .Net Standard 2.0. Csproj files are new "minimal" version with added this
<CodeAnalysisRuleSet>..\..\..\custom.ruleset</CodeAnalysisRuleSet>
Visual Studio Options => Text Editor => C# => Advanced => Enable full solution analysis is checked (enabled).
Problem: Running Rebuild or Run Code Analysis for whole solution does not show any Sonar warnings in Errors pane.
At same time in code editor there are those squirly underlines pinpointing Sonar found problems in code.
Q: Are there any additional configurations necessary to make it work or ASP.NET Core and .Net Standard projects are not yet supported for this?
P.S. SonarLint is not connected to any SonarQube server.

Once changing to "Build and Intellisense" in the Error List, the errors showed up here. A rebuild is of course also required after setting up the SonarLint connection.

Related

.net core visual studio publish is including runtimes

I'm currently using a .net core visual studio publish, and its including the runtime dlls in the output. I do not want these files, but would like to use the hosting bundles on the server.
This is a new thing, it didn't use to include these dlls with a publish. I think it might have been triggered by a visual studio update, but I am not positive why its happening.
Here's my settings:
The Deployment Mode is not set to "Self-Contained" which I think is the setting that should force the runtime to be included.
I've done tons of googling but can't seem to find any other configuration that would be related to this. Any guidance would be greatly appreciated!
Posting an answer, just in case anyone else ends up here. I found the answer mostly because of Lex Li comment.
The most recent upgrade to visual studio / .net core seems to require you to specificity a target runtime in your Publish Profile. In order to make this work, you will be forced to upgrade your project to 2.1 or higher. Otherwise visual studio will choose portable by default, and include the runtime dlls in the publish.

Visual Studio 2017 project reference support between .net standard and .net core

I have a .Net standard 2.0 project in a Visual Studio solution that contains some Azure functions. In the same solution, I've created a .Net Core 2.0 Unit Test project. I've added a project reference from the .Net Core Unit Test project to the .Net standard 2.0 library.
Despite the project reference, Visual Studio is behaving like I'm referencing a dll instead of the project. For example, if I try to use F12/Go to reference, it brings me to a 'From metadata' file instead of the actual code file in the other project. Additionally, codelens features like 'Tested by' (and even just 'referenced by') and the Live Unit testing icons in the .Net Standard project aren't working, since they don't seem to be aware of the Unit Test project at all.
Is there some way to get this integration working between the two projects? My Visual Studio is up to date (15.5.3 enterprise), and I'm not using any tools like Resharper or anything like that.
I'm also facing the same issue but so far the project reference vs dll reference is not the case. I believe this is an existing issue with Azure function projects. There is a thread in Microsoft community regarding this issue. The last comment from Visual Studio is as follows:
I'm closing this report, because in the last 90 days there was no internal developer activity and very small number of new votes or comments. Sorry, we would like to look at this further, but we just don’t have the time right now. Our goal in closing older issues such as this one is to keep customers informed on which issues are currently being pursued by Visual Studio teams. If you still have trouble with our latest version, please report it as a new problem.

How to debug a project file in MSBuild 14.0 / VS2015?

How to debug a project file in MSBuild 12.0 / VS2013? has an answer, but apparently that method is not supported in Visual Studio 2015/MSBuild 14. Does anyone know a way to perform MSBuild debugging in Visual Studio 2015/MSBuild 14? Bonus points for scoop about Visual Studio 2017.
The MSBuild debugger was never officially supported and was cut from MSBuild in favor of cross-platform support in the VS 2015/MSBuild 14 timeframe.
There are many ways to debug the behavior of a build. The combination of a Verbosity=Diagnostic build log and the preprocessed project (msbuild /pp:preprocessed.xml path\to\the.csproj creates a file containing all of the build logic for a given project) is extremely powerful. You may also be interested in the UI that the MSBuildStructuredLog provides, which helps pare down the massive output produced by a diagnostic log.
It really works well in old VS version:
But if I use the VS2015, I got the same issue as yours, it could recognize the /debug command line.
I report this issue to the product team here:
https://connect.microsoft.com/VisualStudio/feedbackdetail/view/3120913/how-to-debug-a-project-file-in-msbuild-14-0-vs2015
You could check the latest update from it, of course, please also vote and add your comment there:)

cannot build in release only in debug

I have a project built in VS 2013, for some reason I cannot build in release mode only debug mode. If I build in release mode I get a bunch of errors that doesn't really seem relavant. Anyone got any suggestion on where to begin looking for errors?
From your error I can guess that you're using an external library, either through NuGet or locally.
You have to set up the environment to use this library in both release and debug mode. That means installing it on either one through NuGet or setting up the correct include/library paths in the project settings.
In my case it was an unrelated Nuget package that had a higher .Net Framework version than my project.
I had a similar problem, with the same error of Invalid pointer, and it turned out that I had uninstalled Telerik from machine.
1. Make sure that you have Telerik installed , on my machine it is under "C:\Program Files (x86)\Telerik\UI for ASP.NET AJAX Q3 2015\"
The file "Telerik.Web.UI.dll" is available in the Bin[nn]-folders, select the one you want (perhaps the latest version).
2. In visual studio; if your reference to "Telerik.Web.UI" has a yellow warning triangle it indicates that Visual Studio cannot locate the dll file.
Add new reference by browsing your Telerik Bin[nn] folder and selecting the file "Telerik.Web.UI.dll" (and repeat this for all projects using the Telerik components in your solution)

While Creating setup showing Error in visual studio

I am working on visual studio 2010. I am trying to Rebuild my setup project but I am getting these 3 error(s):
1: An error occurred generating a bootstrapper: Unable to finish updating resource for C:\Users\IBS Support\Desktop\Evalet Without Printer & Stored Procedrure\1\EVallet-Desktop\EvaletSetup\Debug\setup.exe with error 80070005
2: General failure building bootstrapper
3: Unrecoverable build error
I am using MS Visual Studio 2010, version 10.0.30319.1
(.Net FrameWork Version 4.5.50709)
This post should help you.
Quote from the post:
This happens because The .NET framework version required by the setup project is different than the .NET framework version targeted by the application.
To verify this:
In Solution Explorer, select the setup project.
On the View menu, point to Editor, and then click Launch Conditions. Click .NET
Framework.
In the Properties window, change the Version property to the version of the .NET Framework that you want the setup project to check for and install.
Hope this helps?

Resources