File not found exception while using Smart device authentication utility!

  • Thread starter Gopi via DotNetMonster.com
  • Start date
G

Gopi via DotNetMonster.com

Hi

I am getting Filenotfound exception when I try to run application from
developing computer to Win CE.net machine through Smart Device
authentication utility.
Actually problem would be because of the files available in developing
machine but not in the Win CE.net machine. That part of my code tries to
read the file which is not available in Win CE.net machine. How and Where
should I place those text files which are dependent on the code?
I would appreciate any one of your help.

Cheers
 
G

Guest

Dear Gopi,

Windows CE .NET does not inherently provide a current directory setting
for applications. Specifying the data file in your code with no path
specification returns a FileNotFoundException. I'll try to explain it in
terms of Pocket PC because I never worked with the Win CE.NET applications.
Pocket PC applications store data files with your assembly files under
\Program Files\Assembly_Name\, where Assembly_Name is the name of your
assembly.
You can get the path of your executing assembly using,

Dim str As String = _

Path.GetDirectoryName([Assembly].GetExecutingAssembly().GetModules(0).FullyQualifiedName)

Here System.Windows.Forms, System.IO, and System.Reflection namespaces
must be referenced.
 
G

Gopi via DotNetMonster.com

Hi Arun,

Thanks for ur suggestion. But have u used Smart Device Auth Utility which
is used to debug smart application from visual studio environment?
 
P

Paul G. Tobey [eMVP]

I use it all the time and it just works. You're phrasing your problem
description incorrectly. The problem is that you want to deploy some text
files with your project and you don't know how to do that.

To do that, add the files to your project and set their Build action to
Content, which will be the default, if they're .txt files. They'll be
copied to the install directory where the EXE is placed when you deploy the
project.

Paul T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top