Maybri
Posts: 8
Joined: Thu Mar 16, 2006 3:22 am

Help with CS0246 error

Tue Apr 04, 2006 5:25 am

Hi I'm working with an application on C#, but I want to convert this application in a DLL, I receive the error CS0246 which is the error of the references,types or namespaces "It can't be found the type or the name of the namespace Franson", I already made the relative references and I put the "using directive" but I still have the problem I will appreciate your help.

Thank You

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: Help with CS0246 error

Tue Apr 04, 2006 11:07 am

There shouldn't really be any difference in making a DLL or an application. Could you post some code where you get this error? Or is it a general error that doesn't come down to just a few lines?


Regards,
Jonas
Franson Support

Maybri
Posts: 8
Joined: Thu Mar 16, 2006 3:22 am

RE: Help with CS0246 error

Wed Apr 05, 2006 2:38 am

Hi I think it is a general error but I have the error in those parts:

using <font color="red">Franson.BlueTools;</font id="red">
using <font color="red">Franson.Protocols.Obex;</font id="red">
using <font color="red">Franson.Protocols.Obex.FTPClient;</font id="red">public static void fb_CopyEnd(Object source,<font color="red"> ObexEventArgs args[/b</font id="red">])
{
ObexCopyEventArgs copyArgs = ObexCopyEventArgs)args;
if(tipo==0)
fs.Close();
else if(tipo==1)
fw.Close();
fb.DisconnectAsync();
}

Thanks for your help!!!

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: Help with CS0246 error

Wed Apr 05, 2006 12:20 pm

The code looks okay. I guess you just missed the first "(" when casting the ObexCopyEventArgs?

Is this the error you are getting by the way?
"The type or namespace name 'Franson' could not be found (are you missing a using directive or an assembly reference?)"

This means that your references are incorrect. Double-check that you have included both Franson.BlueTools.dll AND Franson.Protocols.Obex.dll.

Both files are needed to make use of Obex with BlueTools.

If you find that the references are indeed correct try removing method by method and see when it compiles to determine
exactly where the error appear.

Regards,
Jonas
Franson Support

Maybri
Posts: 8
Joined: Thu Mar 16, 2006 3:22 am

RE: Help with CS0246 error

Thu Apr 06, 2006 2:44 am

Yes it is the error. I already check the references and there are correct and I also removed method by method but nothing's work :(. I really don't know what else can I do.

The error appears since I add the usings in the code, but I already add the references with Project --> Add reference.

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: Help with CS0246 error

Thu Apr 06, 2006 11:02 am

Could you contact me off forum so we can work this out? To mail me you can click on my name and then Click to send an E-Mail. I would contact you myself but you have no e-mail attached to your user.


Regards,
Jonas
Franson Support

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: Help with CS0246 error

Tue Apr 11, 2006 11:14 am

Maybri was using the commandline "csc.exe" to build his project. Remember that when use the commandline you must manually include your references since the #using in the source code is just to simplify your code. (Franson.Protocols.Obex.FTPClient.FileBrowser can just be written as FileBrowser with a #using Franson.Protocols.OBex.FTPClient)

For example, to build the ObexFTPClient sample:

Code: Select all

csc /reference:../../Franson.BlueTools.dll 
/reference:../../Franson.Protocols.Obex.dll /target:exe 
/out:ObexFTPClient.exe MainForm.cs AddressBook.cs InputForm.cs
This works if you stand in the ObexFTPClient where the SDK installed it and have csc.exe in your path.





Regards,
Jonas
Franson Support

Return to “BlueTools”