Question

Type or namespace not found error - .Net access provider in IFS10

  • 2 June 2023
  • 4 replies
  • 57 views

Badge +4

Hi All,

I want to try the c#.Net file in https://docs.ifs.com/techdocs/Foundation1/050_development/040_core_server/010_access_providers_dev/020_ap_dotnet/010_getting_started_guide.htm to talk to IFS10  and fetch some data.

 

Although I have added the all dll files to references and target .Net version is 4.5.2, I am getting “error CS0246: The type or namespace name 'Ifs' could not be found (are you missing a using directive or an assembly reference?)

Can you please help me to sort out the root cause or give me an advice what needs to be amended?

 

Thank you,

Sachini

 


4 replies

Userlevel 5
Badge +12

Hi Sachini,

Are you using Visual Studio 2013?
It looks like you may be using .NET Core rather than .NET Framework.
Please check both of these.

Best regards,
Ben

Badge +4

Hi,

I used Visual Studio 2019 with .NET framework

Thanks,

Sachini

Userlevel 5
Badge +12

Hi Sachini,

Are you manually compiling it in PowerShell as shown in your screen capture?
The output shows "Visual C# Compiler version 3.11.0-4.22108.8" which strongly suggests that this is using the .NET Core compilers.
When using Visual Studio, the normal way to compile is to right click on the project and click Build.
If you are manually compiling from PowerShell (within Visual Studio), it is likely that it first finds the .NET Core compilers in the path and uses it instead.

Best regards,
Ben

Userlevel 5
Badge +12

If you’re using csc directly to compile, you seem to be missing the references to the DLL’s (see the Compile step in the documentation). I think it should be:

csc /reference:Ifs.Fnd.AccessProvider.dll;Ifs.Fnd.Data.dll;Ifs.Fnd.Core.dll path/to/Program.cs

Reply