I read this article https://learn.microsoft.com/en-us/visualstudio/ide/develop-code-in-visual-studio-without-projects-or-solutions?view=vs-2019
It seems to indicate that you can now work in Visual Studio without .sln files.
I've had a lot of issues with .sln files while using git. So I was hoping to dispense with them. .csproj files generally are fine though.
Here is my .csproj file contents
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
</Project>
Here is my program.cs
using System;
namespace TestWithoutSln
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}
I have tried setting the .csproj file as start up and I get the following 'Error NETSDK1004 Assets file 'C:\Users\Blah\Desktop\Working Repositories\Projects\Test\obj\project.assets.json' not found. Run a NuGet package restore to generate this file.'
But I can't figure out how to run a package restore without the .csproj loaded. The Package Management Console has no projects listed.
after that how can I have one project reference another project?
Edit in Addition:
I have tried dotnet restore
from the Developer Command Prompt. I now have a new error when I run it after a successful build.
An unhandled exception of type 'System.IO.FileNotFoundException' occurred in Unknown Module.
Could not load file or assembly 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.