Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

"System.Exception' occurred in Microsoft.SPOT.Hardware.dll


  • Please log in to reply
1 reply to this topic

#1 tomveil

tomveil

    New Member

  • Members
  • Pip
  • 1 posts

Posted 07 September 2012 - 07:46 PM

Hello,

I am new to Netduino and am playing the NetduinoGo SDK in Visual Studio 2010 using the emulator.

I'm getting the following error -

An unhandled exception of type 'System.Exception' occurred in Microsoft.SPOT.Hardware.dll

My code is below -
using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;


namespace NetduinoGoApplication2
{
    public class Program
    {
        public static void Main()
        {
            // write your code here


        }

    }
}

The exception is occurring in -
netduino_source\GoBus\GoHub.cs line 56
// enable our power output
            _powerEnable = new OutputPort((Cpu.Pin)0x0A, false);


The exception occurs if I have references to either SecretLabs.NETMF.Hardware.NetduinoGo or GoBus in my .csproj file.


My .csproj file is -
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <AssemblyName>NetduinoGoApplication2</AssemblyName>
    <OutputType>Exe</OutputType>
    <RootNamespace>NetduinoGoApplication2</RootNamespace>
    <ProjectTypeGuids>{b69e3092-b931-443c-abe7-7e7b65f2a37f};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
    <ProductVersion>9.0.21022</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{52D32E7B-9763-4645-AC56-C3220E9E327B}</ProjectGuid>
    <TargetFrameworkVersion>v4.2</TargetFrameworkVersion>
    <NetMfTargetsBaseDir Condition="'$(NetMfTargetsBaseDir)'==''">$(MSBuildExtensionsPath32)\Microsoft\.NET Micro Framework\</NetMfTargetsBaseDir>
    <DeployDevice>NetduinoGo</DeployDevice>
    <DeployTransport>USB</DeployTransport>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <Import Project="$(NetMfTargetsBaseDir)$(TargetFrameworkVersion)\CSharp.Targets" />
  <ItemGroup>
    <Compile Include="Properties\AssemblyInfo.cs" />
    <Compile Include="Program.cs" />
  </ItemGroup>
  <ItemGroup>
    <Reference Include="GoBus, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" />
    <Reference Include="Microsoft.SPOT.Hardware" />
    <Reference Include="Microsoft.SPOT.Hardware.PWM" />
    <Reference Include="Microsoft.SPOT.Hardware.SerialPort" />
    <Reference Include="Microsoft.SPOT.Native" />
    <Reference Include="SecretLabs.NETMF.Hardware" />
    <Reference Include="SecretLabs.NETMF.Hardware.NetduinoGo, Version=4.2.0.0, Culture=neutral, processorArchitecture=MSIL" />
  </ItemGroup>
</Project>


#2 Arron Chapman

Arron Chapman

    Advanced Member

  • Members
  • PipPipPip
  • 289 posts
  • LocationOregon, USA

Posted 07 September 2012 - 09:19 PM

Tom, Welcome to the community. Gutworks and I helped you out in chat today, I think. I just wanted to follow up here so that if anyone else had this problem they could find a reference too. This is a problem with the emulator, when you get your Netduino and deploy code there you shouldn't see this anymore! :)

When you talk EE use small words, I'm just a Software Developer :)
My Blog/Site and Everything Else

If my post helped you please consider pressing the "Like This" button in the bottom right-hand corner.

 

Oh my. So many things, so little money!!

 





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.