Elvas Tower: problem with "using Orts.Common" - Elvas Tower

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

problem with "using Orts.Common" CS0234: Namespace "Common" does not exist in "Orts" Rate Topic: -----

#1 User is offline   Siebren 

  • Fireman
  • Group: Status: Active Member
  • Posts: 101
  • Joined: 16-November 22
  • Gender:Not Telling
  • Location:Ede, the Netherlands
  • Simulator:open rails
  • Country:

Posted 12 December 2022 - 03:28 AM

I need help with the OR software. I'm working with Microsoft Visual Studio Community 2022 version 17.4.2. Until now it worked like a charm.

But... Now I want to add a call to WorldLatLon().ConvertWTC in file Source\Orts.Formats.Msts\TrackDatabaseFile.cs. Therefor I need a:

using Orts.Common;


This is giving me an error message: CS0234: The type or namespace name 'Common' does not exist in the namespace 'Orts' (are you missing an assembly reference?)

I tried to add all kind of projects to various Projects Properties. But no luck. It either does not help or it is not allowed because of circular references.

Someone any idea what to do to solve this error?

#2 User is offline   cjakeman 

  • Vice President
  • PipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 2,882
  • Joined: 03-May 11
  • Gender:Male
  • Location:Peterborough, UK
  • Simulator:Open Rails
  • Country:

Posted 12 December 2022 - 10:46 AM

View PostSiebren, on 12 December 2022 - 03:28 AM, said:

I need help with the OR software.
Someone any idea what to do to solve this error?

Hi Siebren,

I'm puzzled by this.

If I look on GitHub for the source to the 'master' branch, I get:


Attached Image: 2022-12-12 18_42_12-openrails_TrackDatabaseFile.cs at master · openrails_openrails — Mozilla Firefox.jpg

So ORTS.Common is already available to that file.

Are you sure that you've started your work based on the 'master' branch?

#3 User is offline   Weter 

  • Member, Board of Directors
  • PipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 7,054
  • Joined: 01-June 20
  • Gender:Not Telling
  • Simulator:ORTS
  • Country:

Posted 12 December 2022 - 11:01 AM

Quote

using Orts.Common;

Quote

using ORTS.Common;

He writes Orts, You write - ORTS. Is it case-sensitive?

#4 User is offline   engmod 

  • Open Rails Developer
  • PipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 1,792
  • Joined: 26-February 08
  • Gender:Male
  • Location:Eltham, Victoria, Australia
  • Simulator:ORNYMG
  • Country:

Posted 12 December 2022 - 11:31 AM

View PostWeter, on 12 December 2022 - 11:01 AM, said:

He writes Orts, You write - ORTS. Is it case-sensitive?


Just above the ORTS is an Orts, so it would appear not.

#5 User is offline   Weter 

  • Member, Board of Directors
  • PipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 7,054
  • Joined: 01-June 20
  • Gender:Not Telling
  • Simulator:ORTS
  • Country:

Posted 12 December 2022 - 06:17 PM

Hi, Derek.
Parsers and formats - yes, but connon -?

#6 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 7,025
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 13 December 2022 - 12:24 AM

C# language is case sensitive.

#7 User is offline   Siebren 

  • Fireman
  • Group: Status: Active Member
  • Posts: 101
  • Joined: 16-November 22
  • Gender:Not Telling
  • Location:Ede, the Netherlands
  • Simulator:open rails
  • Country:

Posted 13 December 2022 - 01:12 AM

Should have told when opening this thread. There are two namespaces: ORTS.Common and Orts.Common. The names are case sensitive in C#.

The file Source\Contrib\TrackViewer\Drawing\DrawLongitudeLatitude.cs for instance contains a using statement for both of them:

using ORTS.Common;
using Orts.Common;


But when I try to add the last using line to the file Source\Orts.Formats.Msts\TrackDatabaseFile.cs it gives me the error on "using Orts.Common;". The file already has a "using ORTS.Common" like this:

Attached Image: Capture.JPG

The namespace Orts.Common in defined in C# files in project Orts.Simulation\Common. I guess the error has to do with the project dependencies of Orts.Formats.Msts:

Attached Image: Capture.JPG

But when I try to add the Orts.Simulation to it I get the error:

Attached Image: Capture.JPG

I've played around with other projects, but no luck.

#8 User is offline   Siebren 

  • Fireman
  • Group: Status: Active Member
  • Posts: 101
  • Joined: 16-November 22
  • Gender:Not Telling
  • Location:Ede, the Netherlands
  • Simulator:open rails
  • Country:

Posted 14 December 2022 - 05:16 AM

In the meantime I created some workaround by just copying the csharp source file and renaming the classes. So not a serious workaround, but good enough for now.

Thanks, Siebren.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users