All Questions
Tagged with .net-core visual-studio 
            
            1,230
            questions
        
        
            2893
            votes
        
        
            13
            answers
        
        
            426k
            views
        
    What are the correct version numbers for C#?
                What are the correct version numbers for C#? What came out when? Why can't I find any answers about C# 3.5?
This question is primarily to aid those who are searching for an answer using an incorrect ...
            
        
       
    
            340
            votes
        
        
            8
            answers
        
        
            192k
            views
        
    Equivalent to AssemblyInfo in dotnet core/csproj
                Since dotnet core moved back to the .csproj format, there is a new autogenerated MyProject.AssemblyInfo.cs which contains, among others:
[assembly: AssemblyCompany("MyProject")]
[assembly: ...
            
        
       
    
            271
            votes
        
        
            15
            answers
        
        
            228k
            views
        
    Non-nullable property must contain a non-null value when exiting constructor. Consider declaring the property as nullable
                I have a simple class like this.
public class Greeting
{
    public string From { get; set; }
    public string To { get; set; } 
    public string Message { get; set; }
}
Strangely I get the ...
            
        
       
    
            156
            votes
        
        
            2
            answers
        
        
            8k
            views
        
    If (false == true) executes block when throwing exception is inside
                I have a rather strange problem that is occurring.
This is my code:
private async Task BreakExpectedLogic()
{
    bool test = false;
    if (test == true)
    {
        Console.WriteLine("Hello!");
 ...
            
        
       
    
            148
            votes
        
        
            21
            answers
        
        
            104k
            views
        
    Auto Versioning in Visual Studio 2017 (.NET Core)
                I have spent the better part of a few hours trying to find a way to auto-increment versions in a .NETCoreApp 1.1 (Visual Studio 2017).
I know the the AssemblyInfo.cs is being created dynamically in ...
            
        
       
    
            138
            votes
        
        
            5
            answers
        
        
            231k
            views
        
    Where is NuGet.Config file located in Visual Studio project?
                I am wondering where is NuGet.Config file located in Visual Studio 2017 project? I tried to create my own NuGet.Config file in the root of the project, but I didn't find any new repositories (NuGet ...
            
        
       
    
            112
            votes
        
        
            32
            answers
        
        
            88k
            views
        
    Project file is incomplete. Expected imports are missing
                After format my computer I reinstalled Vs 2017 V 15.6.3
and install ASP.Net Core SDK from Microsoft 2.1.4
But when I create new asp core application VS failed with error
  "Project file is ...
            
        
       
    
            102
            votes
        
        
            5
            answers
        
        
            55k
            views
        
    error CS8773: "Feature 'global using directive' is not available in C# 9.0" after downgrade from net6.0 to net5.0
                I have a project that was initially created for .NET 6 but then I needed to downgrade it to .NET 5.
I changed Target framework in Project Properties and tried to compile. As a result I received a ...
            
        
       
    
            100
            votes
        
        
            4
            answers
        
        
            54k
            views
        
    AssemblyVersion using * fails with error "wildcards, which are not compatible with determinism?"
                I can't use * in assembly version; when I do I get the following compilation error:
The specified version string contains wildcards, which are not
compatible with determinism. Either remove wildcards ...
            
        
       
    
            96
            votes
        
        
            4
            answers
        
        
            58k
            views
        
    Package version is always 1.0.0 with dotnet pack
                TLDR: Where is dotnet pack pulling the version information when it creates the nuget package for an assembly?  
I have a library, that I had transitioned from a .NET 4.6.1 project to a .NET Core ...
            
        
       
    
            75
            votes
        
        
            32
            answers
        
        
            105k
            views
        
    Unable to start process dotnet.exe
                I am attempting to setup a new work space and transfer all of my projects from my old computer to the new one.  However, I am getting this error when I try to run IIS Express: 
  Unable to start ...
            
        
       
    
            68
            votes
        
        
            3
            answers
        
        
            15k
            views
        
    No UseDatabaseErrorPage() extension method in Net Core 3.0
                I have created Net Core 3.0 app and following code that worked in 2.2 now is not.
app.UseDatabaseErrorPage();
Looks like in 3.0 class DatabaseErrorPageExtensions does not exist within Microsoft....
            
        
       
    
            64
            votes
        
        
            16
            answers
        
        
            141k
            views
        
    Failed to bind to address (already in use) error with Visual Studio Mac API
                I'm attempting to create a Web API via .Net Core. I'm just using the boilerplate ValuesController as a Hello World. When I run the project, I get the following error:
System.IO.IOException: "Failed ...
            
        
       
    
            64
            votes
        
        
            3
            answers
        
        
            44k
            views
        
    Should GetEnvironmentVariable work in xUnit tests?
                If I set environment variables for a .Net Core web project in Visual Studio 2017 using the project properties page, I can read the value of the variable using Environment.GetEnvironmentVariable; ...
            
        
       
    
            56
            votes
        
        
            8
            answers
        
        
            98k
            views
        
    The specified framework 'Microsoft.NETCore.App', version '2.2.0' was not found
                I am using Visual Studio 2019 Version 16.3.7. I assume it is the latest update.
When I try to compile a basic .NET Core 2.2 console application:
...I get the following error:
It was not possible to ...
            
        
       
    
            54
            votes
        
        
            2
            answers
        
        
            44k
            views
        
    What's the difference between <TargetFramework> and <RuntimeFrameworkVersion>?
                I have the following code in a csproj file:
<TargetFramework>netcoreapp1.0</TargetFramework>
In the NuGet package manager, it says that I have Microsoft.NETCore.App version 1.0.5
Now let'...
            
        
       
    
            46
            votes
        
        
            1
            answer
        
        
            34k
            views
        
    .Net Framework and .Net Core in same solution
                I have an application targeting .NET Framework, and now I need to develop a library in .NET Core.
I plan to put both projects in the same solution and add the .NET Core library as a reference in the ....
            
        
       
    
            44
            votes
        
        
            1
            answer
        
        
            16k
            views
        
    Setting custom <OutputPath> in .NET Core (stop adding framework target)? [duplicate]
                In traditional .NET applications, it was possible to set a custom <OutputPath> of an assembly in the .csproj file (or via the project properties dialog). A path of e.g. bin\$(Configuration)\$(...
            
        
       
    
            44
            votes
        
        
            20
            answers
        
        
            28k
            views
        
    Resource file "**/*.resx" cannot be found. (MSB3552) on VS for Mac
                We can't build solution on vs for Mac version but the same solution can build on vs for windows (vs 2017) and it's worked.
How to fix on this problem ? and can support on both (vs on windows & vs ...
            
        
       
    
            43
            votes
        
        
            4
            answers
        
        
            14k
            views
        
    How to disable Browser Link in ASP.NET Core (.NET 6, VS 2022)
                I have disabled Browser Link inside Visual Studio 2022, and I have also disabled all the Hot Reload functionality.
Even the Browser Link Dashboard indicates it should be disabled:
I also do not use ...
            
        
       
    
            41
            votes
        
        
            3
            answers
        
        
            46k
            views
        
    Change NuGet package folders used by Visual Studio
                There is no more packages solution folder in any csproj or project.json-based .NET Core project.
NuGet CLI gets the list of used cache folders:
nuget locals all -list
Response:
http-cache: C:\...
            
        
       
    
            41
            votes
        
        
            6
            answers
        
        
            42k
            views
        
    Running dotnet command line within Visual Studio
                The majority of .NET core tutorials online seem to use Visual Studio code, rather than Visual Studio (Full fat? Is there a proper term for the full version? I use Professional but there is also ...
            
        
       
    
            40
            votes
        
        
            5
            answers
        
        
            26k
            views
        
    Including referenced project DLLs in nuget package [.Net Core RC3 *.csproj file]
                I have a solution with two projects in it. First project is called Library1, which references project two called Referencelibrary. I am trying to embed the DLLs for ReferenceLibrary inside Library1's ...
            
        
       
    
            40
            votes
        
        
            1
            answer
        
        
            11k
            views
        
    What is the new GlobalSection in a VS2017 15.3 solution file?
                After upgrading to Visual Studio 2017 15.3.1 and ASP.NET Core 2.0, my solution file now has this at the end:
GlobalSection(ExtensibilityGlobals) = postSolution
    SolutionGuid = {...a GUID...}
...
            
        
       
    
            39
            votes
        
        
            4
            answers
        
        
            37k
            views
        
    How to force Visual Studio to re-create the SSL certificate for a .NET Core Web Application running Kestrel?
                When a web project is created, Visual Studio automatically generates a SSL certificate and prompts you to install it. Everything works fine.
That certificate has now expired and I cannot figure out ...
            
        
       
    
            38
            votes
        
        
            8
            answers
        
        
            49k
            views
        
    Should I install Visual Studio 2017 beside Visual Studio 2015 or should I first uninstall Visual Studio 2015 and then install Visual Studio 2017?
                I am currently using Visual Studio 2015 for programming ASP.NET Core applications. I have the following questions regarding installing Visual Studio 2017:
What is considered to be best practice and/...
            
        
       
    
            35
            votes
        
        
            9
            answers
        
        
            46k
            views
        
    VS 2017 15.3 Yellow Triangles on References
                This morning I upgraded to VS 2017 15.3 and now am getting yellow triangles for most of my references.  The project runs fine (build is good in CLI and VS and restore has been run multiple times) that ...
            
        
       
    
            33
            votes
        
        
            9
            answers
        
        
            37k
            views
        
    C# Predefined type 'System.Object' is not defined or imported
                In .NET core project, I changed the all projects name than after reloading all project that time many errors were showing approx 3225. And mainly all errors are related to system namespace like 
...
            
        
       
    
            32
            votes
        
        
            2
            answers
        
        
            23k
            views
        
    How do I actually create a .NET Core project in Visual Studio?
                Maybe this is super obvious and I just can't find it but how can I create a .NET Core project in Visual Studio (2015 or, preferably, 2013)? I just want to run a console application on a Linux machine. ...
            
        
       
    
            30
            votes
        
        
            1
            answer
        
        
            17k
            views
        
    Where is Create Unit Test in VS 2017?
                I understand that this question has been asked before on SO and it appears that this feature was removed from VS at some point. But I am looking at a Microsoft tutorial right now and that says there ...
            
        
       
    
            30
            votes
        
        
            5
            answers
        
        
            6k
            views
        
    Visual Studio update 3 installer is trying to install update 2 instead
                .NET Core 1.0.0 was released yesterday and it needs VS update 3 to be installed.
So I downloaded the installer from here and tried installing but this weird issue is happening:
It's as if the ...
            
        
       
    
            29
            votes
        
        
            1
            answer
        
        
            3k
            views
        
    How can I get Visual Studio to use Embedded Source code whilst debugging?
                I have embedded the C# source code into a portable PDB file using the <EmbedAllSources> element in the csproj file, and I have embedded the pdb into the assembly using the <DebugType>...
            
        
       
    
            28
            votes
        
        
            2
            answers
        
        
            16k
            views
        
    Building a .NET Core app via command line, so that it works on a machine without .NET Core installed
                My end goal is to create a cross-platform (non-web) console application, so I'm exploring .NET Core right now.
In my previous .NET projects, I did all the development inside Visual Studio, but I also ...
            
        
       
    
            28
            votes
        
        
            3
            answers
        
        
            38k
            views
        
    Migrate .NET Framework 4.8 to .NET 5
                Recently Microsoft has release .NET 5. If we want to upgrade .NET Framework 4.8 to .net 5 then how can we accomplish this task.
Please Note :
I had already upgrade Visual Studio 18.2 with all latest
...
            
        
       
    
            27
            votes
        
        
            1
            answer
        
        
            22k
            views
        
    Include Nuget dependencies in my build output?
                I am building a modular .NET core application that can load extensions at runtime using MEF. I have 2 projects, one is a library that I want to be able to load at runtime, then I have my main ...
            
        
       
    
            27
            votes
        
        
            2
            answers
        
        
            17k
            views
        
    Visual Studio 2017 only has offline Nuget Packages for .NET Core 2.x. How to get online packages?
                I want to get NuGet Packages from Nuget online, but Visual Studio is only giving me 'Microsoft Visual Studio Offline Packages' as an option. 
I have tried adding another package source using the ...
            
        
       
    
            26
            votes
        
        
            1
            answer
        
        
            27k
            views
        
    How to change .NET Framework to .NET Standard/Core in Visual Studio?
                I have a solution in C# in Visual Studios. It was first created in .NET Framework. I want to convert the project to .NET Standard/Core. If I go into project --> properties I see the attached screen,...
            
        
       
    
            24
            votes
        
        
            9
            answers
        
        
            59k
            views
        
    The reference assemblies for framework .NETCore, Version=v5.0 were not found
                I have a UWP project that was created using Visual Studio 2017. It builds fine on this machine (machine 1).
However, when I copy the project over to a machine (machine 2) where I only have the Visual ...
            
        
       
    
            24
            votes
        
        
            10
            answers
        
        
            109k
            views
        
    HTTP Error 500: localhost is currently unable to handle this request
                I'm running into an HTPP Error 500 and I'm not sure why. When I start my service, I pop open a Chrome browser and navigate to http://localhost:5000, and the error pops up. The Chrome Developer Tools ...
            
        
       
    
            24
            votes
        
        
            2
            answers
        
        
            10k
            views
        
    Hide files in .csproj without excluding them from build
                Is it possible to hide files/folders in .net core csproj without excluding them from build? I have a folder containing generated files which I would rather see they are not visible inside Solution ...
            
        
       
    
            24
            votes
        
        
            6
            answers
        
        
            9k
            views
        
    Does .Net Core support User Secrets per environment?
                Let's say I have connection string for Development environment specified in appsettings.Development.json and connection string for the Staging environment specified in appsettings.Staging.json 
All I ...
            
        
       
    
            24
            votes
        
        
            1
            answer
        
        
            16k
            views
        
    Opening Visual Studio 2017 projects in Visual Studio 2015
                I've moved on to Visual Studio 2017 RC, but we still have people working on Visual Studio 2015. Currently when I create a project on 2017, it won't work on 2015. When the project is opened on VS2015 I ...
            
        
       
    
            24
            votes
        
        
            4
            answers
        
        
            39k
            views
        
    How to properly stop running dotnet core web application?
                In Visual Studio 2017 and 2019 on Windows, I run dotnet watch run in the Package Manager Console. It launched kestrel for a dotnet core app, automatically disabled text edit in the console, and ...
            
        
       
    
            23
            votes
        
        
            3
            answers
        
        
            26k
            views
        
    Visual Studio indentation set to two spaces instead of four space tab
                I have just opened an old project here at work.   Someone appears to have changed the indentation.   It's set to 2 spaces instead of four space tabbing.
What I have tried:
I tried doing a Ctrl + KD ...
            
        
       
    
            23
            votes
        
        
            3
            answers
        
        
            10k
            views
        
    Calculate Code Metrics for .NET Core Projects?
                I am playing arround with ASP.NET Core and .NET Core projects. For classic C# projects Visual Studio 2015 has got the feature to calculate code metrics. For .NET Core the support is missing in the ...
            
        
       
    
            22
            votes
        
        
            2
            answers
        
        
            91k
            views
        
    Form view designer is not working in Visual Studio 2019 with C# .NET Core 3.1 [duplicate]
                When I am opening a Visual Studio project with VB.NET then the Form view designer is automatically opened, but when I open a new project with C# .NET Core 3.1 with Windows Forms then it is showing ...
            
        
       
    
            22
            votes
        
        
            2
            answers
        
        
            9k
            views
        
    Missing visual studio 2019 blazor webassembly app template
                I updated my vs 2019 16.3.10 to 16.4 and .net core 3.0 to .net core 3.1 but the blazor web assembly application template is missing.
            
        
       
    
            22
            votes
        
        
            4
            answers
        
        
            40k
            views
        
    Use Visual Studio 2017 with .Net Core SDK 2.0
                Can i open a core 2.0 project in Visual Studio 2017?
I've installed the latest dotnet-core (2.0.0-preview2-005840) and created a core 2.0 console-app.
mkdir dn2cli
cd dn2cli
dotnet new console
...
            
        
       
    
            21
            votes
        
        
            6
            answers
        
        
            25k
            views
        
    .NET Core 2.0 missing from my Visual Studio
                So I've installed the official .NET Core 2.0 SDK and when I'm in Visual Studio i get heaps of errors and the target framework is not listed :( 
It's like .NET Core 2.0 isn't installed.
and here's ...
            
        
       
    
            21
            votes
        
        
            2
            answers
        
        
            43k
            views
        
    Unable to find package . No packages exist with this id in source. .NET core
                I am trying to use a project as nuget package in other solution. 
The project i want to use has 2 references to other projects in the solution he is at.
I am creating the .nupkg file using the cli ...