0

Early on in my project I created a project "Console App" but later on needed to change over to a "Console App (.Net Framework)".

I've changed the output type to Class Library in my new Console App (.Net Framework), which was found to be a general problem resulting from this process

I've attempted to look into the references and comparisons with an earlier project with no errors when compiling. However, the references folder under my User Interface (TrackerUI) is beyond my current knowledge scope.

The errors are resulting from LibraryTracker not existing in the current context.

I've provided an image of the errors sub-folder "LibraryTracker" - "Program.cs" file.

Does anyone have any suggestions as to what the issue might be resulting from?

The project is part of the "Create a C# Application from Start to Finish - Complete Course"

enter image description here

1 Answers1

0

Click on the TrackerUI node in the solution explorer to view the xml for the .csproj directly

You should have something like this formally defining the reference. Make sure it is present and pointing at the correct path.

  <ItemGroup>
    <ProjectReference Include="..\LibraryTracker\LibraryTracker.csproj" />
  </ItemGroup>
Chris Welton
  • 104
  • 8
  • Thank you so much, could I just ask you be a little more specific as to what location I could expect to find the call to the .csproj file? – Theo Wallace Bailey Sep 06 '21 at 11:59
  • It's in the .csproj file. Click on the name "TrackerUI" in the solution explorer. (Above the word "Properties", below "GlobalConfig.cs") It is an XML file, and it will show the XML in the left hand window when you do. – Chris Welton Sep 06 '21 at 12:03
  • So apparently, the issue was resulting from my TrackerUI being set to "Class Library" opposed to Console Application. Not sure when that happened, but I never would have managed to solve it without your support and pushing me in the right direction. Thank you man, have a wonderful day :) – Theo Wallace Bailey Sep 06 '21 at 15:19
  • What are the target frameworks of your two applications? This may be caused by the incompatibility of the .Net framework version between the two projects. Please check this thread:https://stackoverflow.com/questions/4764978/the-type-or-namespace-name-could-not-be-found – DanielZhang-MSFT Sep 07 '21 at 05:18