The type or namespace name 'Ports' does not exist in the namespace 'System.IO'

Related searches

I am working on developing a windows store app on my windows 8.1 system,64 bit (I need to deploy this app on my windows surface pro 3 tablet), technology being used is C#. I need to communicate through the RS-232 port. For this I am using the SerialPort class which falls under the namespace System.IO.Ports. But when I am including this in my C# code, I am getting the error -

"The type or namespace name 'Ports' does not exist in the namespace 'System.IO' (are you missing an assembly reference?)"

I have the windows SDK 8.0 installed. What could be the probable reason for this issue ? Is there any other was to communicate through the RS-232 port .

I am working on developing a windows store app on my windows 8.1 system,64 bit (I need to deploy this app on my windows surface pro 3 tablet), technology being used is C#. I need to communicate through the RS-232 port. For this I am using the SerialPort class which falls under the namespace System.IO.Ports. But when I am including this in my C# code, I am getting the error -

"The type or namespace name 'Ports' does not exist in the namespace 'System.IO' (are you missing an assembly reference?)"

I have the windows SDK 8.0 installed. What could be the probable reason for this issue ? Is there any other was to communicate through the RS-232 port .

Any pointer or suggested would be really helpful.

Here is the code -

using System;
using System.IO;
using System.IO.Ports;

namespace App4
{
    public class Class2
    {
        private SerialPort comport = new SerialPort();
    }

    private void SerialPortInit()
        {

            comport.BaudRate = 115200;
            comport.DataBits = 8;
            comport.StopBits = StopBits.One;
            comport.Parity = Parity.None;

        }
}

Google says that Serialport class is supported in dotNetFrameWork 4.5 (which is the one I am using) but still I am getting this error.

Regards, Shikha

Problem is the .net configuration.

Use the .NET 2.0 (not subset). Config:

Edit>ProjectSettings>Player>ApiCompatibilityLevel

Getting "type or namespace name could not be found" but , This can be the result of a .Net framework version incompatibility between two projects. It can happen in two ways: a client profile project� The type or namespace name ‘ManagementScope’ could not be found (are you missing a using directive or an assembly reference?) The type or namespace name ‘ObjectQuery’ could not be found (are you missing a using directive or an assembly reference?)

*This answer is valid for VC++ but I think it is same or similar for C#.

Open Project Properties -> C/C++ -> Command Line. There is an "Additional Options" box below. Add following lines to there:

/FU"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6\System.Data.dll" /FU"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6\System.dll" /FU"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6\System.Drawing.dll" /FU"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6\System.Windows.Forms.dll" /FU"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6\System.Xml.dll" 

Pay attention to the path and .NET version before adding them.

Compiler Error CS0246, The type or namespace name 'type/namespace' could not be found (are you missing a using directive or an assembly reference?) A type or namespace that is used in the program was not found. The type or namespace name 'ClassName' does not exist in the namespace 'Namespace' (are you missing an assembly reference?) Note In this error message, ClassName is a placeholder that represents the actual name of the class and Namespace is a placeholder that represents the actual namespace.

I hit the same issue with .Net Core 3.1

How to build cross-platform console apps with .NET Core

Add following to .csproj:

<PropertyGroup>
<RuntimeIdentifiers>win10-x64;osx.10.12-x64;debian.8-x64</RuntimeIdentifiers>

Then installed the package System.IO.Ports 4.7.0

The type or namespace name XXX could not be found(are you , The Project which is is referencing the Assembly may have different framework type from the assembly. for example: Forms Project was set to ". The problem is that it can't find the class - it's not in the same namespace as your current code. That may be it's in a different project in the current solution, in a external DLL, or just in a different namespace in another file in the current project. Start by hovering the mouse over the error, and open the drop down that appears.

Go to Edit->projectsettings->Player->APIcompetibilityLevel = .Net4.x This worked for me.

CS0246 The type or namespace name 'System' could not be found , For Bugs: I have got below Error in my WTS project. **CS0246 The type or namespace name 'System' could not be found (are you missing a� How to solve this error? "CS0246 The type or namespace name 'System' could not be found" (are you missing a using directive or an assembly reference?)" I followed every stupid article I could find and none of them fixed it

[SOLVED] Are you missing a using directive or an assembly , If you want to use another namespace to your project u can follow my How to fix error - The Duration: 1:57 Posted: Jul 14, 2019 A type or namespace that is used in the program was not found. You might have forgotten to reference (-reference) the assembly that contains the type, or you might not have added the required using directive. Or, there might be an issue with the assembly you are trying to reference. The following situations cause compiler error CS0246.

Resolved: The type or namespace name 'App' could not be found , There is common error in xamarin.forms project when you trying to build solution for android or Duration: 3:10 Posted: Mar 6, 2019 The type or namespace name 'Entities' does not exist in the namespace 'Unity' (are you missing an as Discussion in ' Data Oriented Technology Stack ' started by francois85 , May 10, 2019 . resolved

The type or namespace name 'UI' does not exist in the namespace 'UnityEngine' HELP! Discussion in 'Scripting' started by Tom-Red, Apr 19, 2016. Tom-Red. Joined:

Comments
  • you probably need to add a reference right click on your project in solution explorer and add reference
  • Windows Store apps are extremely restricted - it's entirely possible that the Windows Runtime doesn't provide the functionality you need.
  • See the comment here http://stackoverflow.com/q/25710474/2655508. Hans Passant knows about what he is talking.
  • I have already tried adding the reference. I have tried adding system.dll but getting this error -"A reference to System.dll could not be added. This component is already automatically referenced by the build system"
  • Do we have any other way to communicate through the RS-232 port other than serialport ?