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

missing files?


  • Please log in to reply
12 replies to this topic

#1 Andy

Andy

    New Member

  • Members
  • Pip
  • 7 posts

Posted 20 September 2010 - 03:38 PM

Morning everyone,
Maybe I'm missing something obvious here but I'm trying to open a SerialPort and when I execute the port.Open() command VisualStudio is asking me where the NetduinoHardwareProvider.cs file is. I have the SDK installed and I've only run into this (so far) when trying to use a SerialPort. Any thoughts? Below is the code & error text

using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
using System.IO.Ports;

namespace nd_serialTest
{
	public class Program
	{

		static InputPort btn = new InputPort(Pins.ONBOARD_SW1, false, Port.ResistorMode.Disabled);
		static OutputPort led = new OutputPort(Pins.ONBOARD_LED, false);

		public static void Main()
		{
			SerialPort c1 = new SerialPort("COM1", 9600);

			Debug.Print("ready");

			if (!c1.IsOpen)
			{
				c1.Open();
				byte[] msg = System.Text.UTF8Encoding.UTF8.GetBytes("TEST");
				c1.Write(msg, 0, msg.Length);
				c1.Close();
			}
		}
	}
}
error text:

Locating source for 'C:\Documents\Secret Labs\Projects\Production\SecretLabs.NETMF.Hardware.Netduino\NetduinoHardwareProvider.cs'. Checksum: MD5 {36 3 f0 c2 91 e3 ea ee 5 bc 34 44 70 d8 e1 22}
The file 'C:\Documents\Secret Labs\Projects\Production\SecretLabs.NETMF.Hardware.Netduino\NetduinoHardwareProvider.cs' does not exist.
Looking in script documents for 'C:\Documents\Secret Labs\Projects\Production\SecretLabs.NETMF.Hardware.Netduino\NetduinoHardwareProvider.cs'...
Looking in the projects for 'C:\Documents\Secret Labs\Projects\Production\SecretLabs.NETMF.Hardware.Netduino\NetduinoHardwareProvider.cs'.
The file was not found in a project.
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\vc7\atlmfc'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\vc7\crt'...
The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: C:\Documents\Secret Labs\Projects\Production\SecretLabs.NETMF.Hardware.Netduino\NetduinoHardwareProvider.cs.
The debugger could not locate the source file 'C:\Documents\Secret Labs\Projects\Production\SecretLabs.NETMF.Hardware.Netduino\NetduinoHardwareProvider.cs'.

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 20 September 2010 - 03:49 PM

Hi Andy, Welcome to the Netduino community. That's a really odd error. Could you please verify the two following things? 1. You're using the "Netduino Application" template, corret? 2. Have you added Microsoft.SPOT.Hardware.SerialPort.dll as a reference to your project? Also, are you using firmware you compiled yourself--or the firmware that came on the Netduino? Chris

#3 Andy

Andy

    New Member

  • Members
  • Pip
  • 7 posts

Posted 20 September 2010 - 03:54 PM

I thought it was a bit unusual. I am indeed using the 'Netduino Application' template and I made sure to referenceMicrosoft.SPOT.Hardware.SerialPort.dll as well. I wouldn't dare touch the firmware of my Netduino yet (I'm a total noob when it comes to embedded hardware) so it's still the original. Andy

#4 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 20 September 2010 - 04:01 PM

Hi Andy, Could you try three things for me really quick? 1. ZIP up the project's directory and attach it to this post--so we can take a quick look at any odd settings that might have crept in... 2. Please verify that you have selected the Netduino as your deployment target (in projet properties....NET Micro Framework tab). 3. Create a blank Netduino Application project--does that give you the same error? If so, create a blank ".NET MF Console Application"--does that give you the same error? Chris

#5 Andy

Andy

    New Member

  • Members
  • Pip
  • 7 posts

Posted 20 September 2010 - 04:13 PM

Hi Chris,

1. ZIP up the project's directory and attach it to this post--so we can take a quick look at any odd settings that might have crept in...
nd_serialTest.zip
2. Please verify that you have selected the Netduino as your deployment target (in projet properties....NET Micro Framework tab).
Yup, Netduino is selected.
3. Create a blank Netduino Application project--does that give you the same error? If so, create a blank ".NET MF Console Application"--does that give you the same error?
Doesn't appear to, I used the Netduino as the target for this too: MFConsoleApplication_test.zip

Attached Files



#6 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 20 September 2010 - 04:19 PM

Hmm. Unfortunately, your nd_serialTest app works perfectly the first time on my machine...so it looks like something is missing/misconfigured on your PC... :( So if you create a blank "Netduino Application" everything works properly...correct? Could you then add the Microsoft.SPOT.Hardware.SerialPort reference and try that? And then if that works, add a line or two of code at a time until it breaks? Hopefully this will give us more info as to what is going on... Chris

#7 Andy

Andy

    New Member

  • Members
  • Pip
  • 7 posts

Posted 20 September 2010 - 04:38 PM

I wouldn't be surprised in the least if it was something misconfigured on my machine. So I created a new app using the template. Added the reference for Microsoft.SPOT.hardware.SerialPort. As soon as it hit the c1.Open(); line an Open File Dialog box showed up in the v4.1 program folder looking for NetduinoHardwareProvider.cs. For giggles I ran a file search on my system but wasn't able to turn the file up at all. I even tried removing and reinstalling the SDK but that didn't seem to help either. I'm wondering if I could just d/l that file and point the program to it.

#8 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 20 September 2010 - 04:57 PM

As soon as it hit the c1.Open(); line an Open File Dialog box showed up in the v4.1 program folder looking for NetduinoHardwareProvider.cs.

How do you execute your program? Do you use single step debugging? What is the checkbox state of "Enable .NET Framework source stepping" and "Enable source server support" in Tools\Options\Debugging\General?

#9 Andy

Andy

    New Member

  • Members
  • Pip
  • 7 posts

Posted 20 September 2010 - 05:04 PM

I've been executing through the Debug > Start Debugging command with a breakpoint on the if(!c1.IsOpen) line so I can single step through the code. I'm not seeing either of those options even with 'Show all settings' checked. Could it be because I'm using C# Express?

#10 Andy

Andy

    New Member

  • Members
  • Pip
  • 7 posts

Posted 20 September 2010 - 05:21 PM

Just as a note, if I disable the breakpoint and let the app run without stepping through the code it doesn't fail in any visible way so it could be the debugger causing problems.

#11 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 20 September 2010 - 05:29 PM

I'm not seeing either of those options even with 'Show all settings' checked. Could it be because I'm using C# Express?

Unfortunately, I don't have C# Express installed to verify what settings are available there, it will take a moment to download it. Right now I can only suggest experimenting with various setting in Debug options, which can affect source stepping (perhaps Enable Just my code, in addition to the two I mentioned above), or clearing symbol cache. The NetduinoHardwareProvider.cs file is included in Netduino SDK source.

#12 Andy

Andy

    New Member

  • Members
  • Pip
  • 7 posts

Posted 20 September 2010 - 06:09 PM

Ok consider this figured out :rolleyes:. I hadn't realized the debugger would go into the Open() function, I had expected it to just run the Open command and update the Output window. Turns out it goes into more detail as in stepping through each pin initialization. I pointed it to the NetduinoHardwareProvider.cs from the SDK source and now it's working fine. Thanks for the help. Andy

#13 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 20 September 2010 - 06:19 PM

I hadn't realized the debugger would go into the Open() function, I had expected it to just run the Open command and update the Output window.

I see. There is "Step Over" debugger command (usually mapped to F10 hotkey) that does exactly that, in contrast to "Step Into" (F11). For a detailed description please have a look at Code Stepping Overview in MSDN Library.




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.