SonarQube binding does not work VisualStudio - c#

I am trying to link a local ASPNET Core application to SonarQube through the team explorer connection.
My ASPNET.Core project has been recently updated to the latest version of dotnet core and also has a .csproj file. I am developing in Visual Studio 2017 with the latest version of C#.
Whenever I try to bind to my SonarQube instance (v6.1) I am prompted to authentication which I provide. Once logged in an attempt to download the compatible projects fails with the error
I also get the following output in sonarLint window
Any ideas on how I can make SonarQube recognise this project so I can bind it?

SonarLint Connected Mode is not yet available for .Net Core projects, you can track progress on GitHub issue #151 .

Related

Publish wizard doesn't have Single File Executable Option

i am using visual studio 2017 with .net 4.8 and when i hit publish the option for Self-Contained app or Single File option doesn't show and i tried opening the project with Visual Studio 2020 and still the option doesn't show.
this is a WPF application
Publish Wizard Screenshot
Publish Wizard Screenshot
Publish Wizard Screenshot
Publish Wizard Screenshot
According to the official documentation.
This deployment model has been available since .NET Core 3.0 and has been enhanced in .NET 5. Previously in .NET Core 3.0, when a user ran your single-file application, the .NET Core host first extracted all the files into a directory before running the application.
.NET 5 improves this experience by running the code directly without extracting files from the application.
So the answer to that question is, you can't use single file publishing under .net 4.8.

Cannot build .NET Framework web app targeting 4.7.2 with VS 2022 installed on a docker container

I can't successfully build basic ASP.NET web app targeting framework 4.7.2.
I built a docker image with a base image for Windows Server Core 2019. On this image I installed VS 2022 Enterprise and took Azure development, .NET desktop development, ASP.NET and web development modules, including recommended ones.
For dotnet core solutions everything works fine, but for dotnet framework I am getting such errors:
packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props(31,5): Error MSB3758: An error has occurred during compilation. error CS0014: Required file 'alink.dll' could not be found
packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props(31,5): Error MSB4175: The task factory "CodeTaskFactory" could not be loaded from the assembly "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\Microsoft.Build.Tasks.Core.dll". The task factory must return a value for the "TaskType" property.
I additionally installed .NET Frameworks: 4.5, 4.6, 4.6.1, 4.7.1, 4.8, but it didn't help.
Locally, I am able to build it without any problems. I checked the image if VS 2022 was installed without any issues and it looks fine as well. All environment variables are also in place. I thought the issue was related with some missing .NET Frameworks with SDKs, but it still persists.
Installing Redistributable C++ 2012-2022 didn't help as well. I am using MSBuild 17.
What I still might be missing?
I want to create an agent for Azure DevOps and as a reference I use the Dockerfile from Microsoft documentation. One difference is that before the start script, I run my custom script to silently install the VS 2022 with the modules I specified earlier.
I use Azure DevOps pipelines to build the solution, and the VSBuild#1 task.
I was finally able to solve the problem I had. It turned out that the base windows server core image didn't contain all of the needed prerequisites nor Visual Studio. Solution was to use extended windows server core image with sdk 4.8. This is strange, because Visual Studio already delivers everything for sdk 4.8. I think the extended image must have had something else that didn't come with the VS installation.

Getting "NETSDK1045 The current .NET SDK does not support .NET Core 3.0 as a target" when using Blazor Asp.NetCore hosted template

I've installed the preview of .NetCore 3.0 and tried to run the blazor template Blazor (ASP.NET Core hosted) in Visual Studio 2019:
The error that occured, was the following:
NETSDK1045 The current .NET SDK does not support .NET Core 3.0 as a target. Either target .NET Core 2.2 or lower, or use a .NET SDK version that supports .NET Core 3.0.
During these days I had to overcome this issue on a number of different development machines/containers: eventually, I found no less than 6 different reasons that could cause this kind of error:
Missing .NET Core 3 SDK (x86 or x64)
.NET Core SDK preview support not enabled in VS2019
VS2017 instead of VS2019
Wrong SDK path in PATH environment variable(s)
Wrong SDK path in MSBuildSDKsPath environment variable(s)
Wrong SDK version in the project's global.json file
The workarounds for those scenarios are pretty easy to understand, you basically have to either install the proper SDK or remove the "offending" SDK reference(s). However, I did my best to document them all in this post on my blog.
Following this comment, I managed to resolve the problem by installing the x86 version of the .NET Core 3.0 additionally to the x64 version. The build worked after restarting Visual Studio (2019).
for me the solution was removing a path variable MSBuildSDKsPath - Because of exploring preview sdks's i at some point declared that variable to fix another sdk bug - seems like that force sets the used version. So in my case it was set to 3.0.100 and resulted in errors when attempting to use 3.1.300
I got the same error and resolve it with checking the option "Use previews of the .NET Core SDK (requires restart)".
Open Tools > Options and try looking at "Preview Features" or ".Net Core" depending of your Visual Studio version.
Watch out of VS updates, they can disable it.
This is a very hacky-feeling solution but at least it worked. Let's say you've installed the SDK for 3.0.100-rc1-014190. It shows up in dotnet --list-sdks as expected but still doesn't seem to be detected by Visual Studio, and you get the same NETSDK1405 error when trying to build or test anything from the dotnet CLI.
Look in your dotnet SDK install directory (usually C:\Program Files\dotnet\sdk). You should see your preview SDK in there. Either create a copy or rename the existing folder to remove the preview version suffix. For example 3.0.100-rc1-014190 would instead become 3.0.100, like so:
Doing this made .Net Core 3 preview support finally work in VS2019 Preview 4 and the dotnet CLI for me.
For me it was as simple as enabling the preview in Visual Studio 2019. Unfortunately most posts that show how to do this are I believe out of date. I finally came across this stack overflow post How to enable .NET Core 3 preview SDK in VS2019? They moved the check box and it was not on by default for me.
This was a frustrating issue to track down and after doing all of the updates to VS and still not being able to install I tracked it down to an environment variable. Try removing MSBuildSDKsPath and see if that fixes your issue.

Updating Visual Studio and Core 2.0

I am trying to update my project to .net core 2. But I am facing issues I have no option in the target framework to change to
I installed the .net core 2 sdk from the download site
I also tried the suggestion here but did not work for me
.NET Core 2.0 missing from my Visual Studio
But when I try to modify visual studio to install release 3 i get the following
this happens even if I click the installer and i DO NOT no why I tried various suggestions Including delete this folder
Try deleting %LocalAppData%\Microsoft\VisualStudio\Packages_Channels
But it does not exist on my pc I am running windows ten by the way
As I can see there is global.json file in your project. Try changing sdk version to 2.0.0

Web Api Core dependency error

I am trying to open this project on my visual studio 2015:
http://www.codeproject.com/Articles/992208/Angular-JS-Application-with-MVC-Web-API-ASPNET-and
When I open the project I get the following message:
DNX SDK version '....1.0.0-beta4-11566' is required by your solution
but is not installed on this machine. Do you want to install it now?
If you select No, '...1.0.0-rc1-update1' will be used as the solution
DNX SDK Version for this session.
I choose Yes and it failed to install the DNX SDK version so it uses version 1.0.0-rc1-update1.
Then, I get this error:
The dependency Microsoft.AspNet.WebApi.Core 5.2.3 in project ... does
not support framework DNXCore, Version=v5.0.
I am running the most recent version of Visual Studio 2015 and Windows 10. I have tried updating everything, everything is up to date. I don't know why I keep getting this annoying error. I tried using different versions of the WebApi.Core from the most recent to the first version.
It's also important to mention that I am new to the whole ASP.NET 5 concept, I'm used to work with MVC 5 and under.

Categories

Resources