On an online course I tasked with an exercise, it was the pretty simple exercise, but I have made it difficult to complete…
- I have created GitHub repository, with Readme.md file and nothing more: https://github.com/frostysh/EXERCISE03_YPARKHOMENKO_CSHARPPRO_HILLEL.git
- The I have cloned my remote repository to local machine, and created a new branch in which I wanted to do all work, and then merge it into a main branch on remote repository via Pull-Request.
On local machine I created some files “Program.cs”, “User.cs”, and so on. And I have discovered that my automatic syntax error checks is no works. More than that, project refuses to build… So I copypasted and modified files from some other projects to this project starts to work properly.
- project.assets.json file from /obj/ in the root directory (I created obj-drectory too)
{
"version": 3,
"targets": {
"net8.0": {}
},
"libraries": {},
"projectFileDependencyGroups": {
"net8.0": []
},
"packageFolders": {
"C:\Users\F021\.nuget\packages\": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\Users\F021\source\repos\HILLEL_PRIVATE_SCHOOL_CSHARPRO_EXERCISE03_CONSOLE_PROGRAM_WITH_OBJECTS\EXERCISE03_YPARKHOMENKO_CSHARPPRO_HILLEL.csproj",
"projectName": "HILLEL_PRIVATE_SCHOOL_CSHARPPRO_EXERCISE03_CONSOLE_PROGRAM_WITH_OBJECTS",
"projectPath": "C:\Users\F021\source\repos\HILLEL_PRIVATE_SCHOOL_CSHARPRO_EXERCISE03_CONSOLE_PROGRAM_WITH_OBJECTS\EXERCISE03_YPARKHOMENKO_CSHARPPRO_HILLEL.csproj",
"packagesPath": "C:\Users\F021\.nuget\packages\",
"outputPath": "C:\Users\F021\source\repos\HILLEL_PRIVATE_SCHOOL_CSHARPRO_EXERCISE03_CONSOLE_PROGRAM_WITH_OBJECTS\obj\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\Users\F021\AppData\Roaming\NuGet\NuGet.Config",
"C:\Program Files (x86)\NuGet\Config\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\Program Files\dotnet\sdk\8.0.204/PortableRuntimeIdentifierGraph.json"
}
}
}
}
- I created *.csproj file manually too.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
- I also created *.sln file with help of console program dotnet new sln –name MySlnName
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
- My project’s root directory looks like that:
RootFolder
But the project only works in this mode – *.csproject selected in debug menu (screenshot from MSV Studio): StartWithoutDebug *.csproj
And the project does not work in this mode – *.sln selected in debug menu: StartWithoutDebugging *.sln
I think if I will finish the work, and a teacher will clone my remote repository and try to build and launch the project, it will not work. HOW to fix it?
Thank to all for the future answers.