|
What development environment are you using? In Visual Studio C# project you need to "Add a Reference" to the other DLL's you are "using".
led mike
|
|
|
|
|
I am using Visual Studio C# (Empty Project Template) and added reference to other DLL,s....However when trying to build assembly using CSC from command prompt I get the error..
Thanks
Joel
JO
|
|
|
|
|
Do as Pete says below.
led mike
|
|
|
|
|
The using statement here is a shortcut only. It saves you having to type in System.IO.Path... It does not automatically add the references to the DLLs into the build process.
Even though you have added the references into your csproj file, if you are building from the command line using the csc option, you need to add the references into the csc command manually. Alternatively, have you considered using a makefile to build from?
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: Alternatively, have you considered using a makefile to build from?
Can't you just point MSBUILD at a visual studio project file?
|
|
|
|
|
I dont know much about the assemblies...But I ll try csc /r option..
Will let u know the results..
Joel
JO
|
|
|
|
|
I use the following command..
csc /t:module Report.cs /r: C:\Crystal\CrystalDecisions.CrystalReports.Design.dll;C:\Crystal\CrystalDecisions.CrystalReports.Engine.dll;C:\Crystal\CrystalDecisions.Shared.dll;C:\Crystal\CrystalDecisions.Web.dll
But I get an error saying these files could not be found..
I verified the path of these files and its right...
Cant understand what m i doin wrong here
Joel
JO
|
|
|
|
|
Pete,
I was able to create a DLL using the /r option...I added reference to the dll in my web project and also used USING statement on my web form...However the Intellisense doesnt work with the classes in this assembly...
Joel
JO
|
|
|
|
|
I use C# EE. I do it the following:
having a Solution called "Application" I inserted two projects.
1. WindowsForm (Executable)
1. Class1 Class (as DLL)
The Assemblies must be referenced to the DLL you use. My WindowsForm Application gets the Ref to Class1.DLL. Then my Application has to include:
<br />
using Class1;<br />
The same works if I would handle another DLL instead of my executable WindowsForm. If you use more DLLs make sure they are "cross"-referenced, but don't overdrive...
Andyancona
andysm00@aim.com
andy@biomedsrl.com
|
|
|
|
|
Does anyone know of a way to read a CMYK image (Pref. Tiff) and get the CMYK values of the pixels rather than the RGB values?
|
|
|
|
|
I am attempting to create a web service that will send and received XML messages via SOAP. I am not certain which way to go on creating my client app. Ultimately , i have an application written in C++ that will have to ultimately receive the message, but is using C++ as a client much more difficult to code than using C#? Any advice or direction is appreciated.
Thanks,
|
|
|
|
|
LCI wrote: is using C++ as a client much more difficult to code than using C#?
Hard to say. For both languages there are tools that support you in doing this. For C# you can use the "Web Services Description Language-Tool (Wsdl.exe)" that creates a client proxy class from the WSDL document of the Web Service. The exact usage and all options are documented on MSDN.
Unfortunately, this tool does not generate such proxy classes in C++. An alternative may be the Apache Axis project that provides a similar tool. I've only used the Java version so far, but I guess the C++ version (Axis C++[^]) has this capability too.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi,
I am tring to use the File.Move function in my app but I cannot get it to work with variables as the source and destination strings.
Heres my code,
I have a couple of text fields supplying info for the source file path and want to use them to place th files found in the parent directory.
String ParentDir = textfield1.Text;
String ChildDir = textfield2.Text;
DirectoryInfo di = new DirectoryInfo(@"c:\"+ParentDir+@"\"+ChildDir+@"\");
foreach (FileInfo fileinfo in di.GetFiles())
{
String newdirectory = @"c:\"+ParentDir+@"\";
//new file name is same as one found
String newfilename = fileinfo.Name.ToString();
String Newdirandname = newdirectory + newfilename;
File.Move(di+fileinfo.Name, Newdirandname);
}
I am very new to C# .Net so please keep any suggestions simple (if they are!).
I am just getting the message that part of the file path cannot be found, but they all exist.
It seems to expect the destination file to already exist, which it won't until I have moved it there?
Any help would be appreciated, many thanks in advance
Mark
|
|
|
|
|
I'd use the System.IO.Path.PathSeparator instead of "\". If you are going to use "\" I think you'll need to change it to "\\" since "\" is an escape character...
Standards are great! Everybody should have one!
|
|
|
|
|
Not if the OP's using @"\", which the OP is.
|
|
|
|
|
I see. My bad. But I'd still use the PathSeparator
Standards are great! Everybody should have one!
|
|
|
|
|
Sorry, PathSeperator didn't help.
I have also tried using MoveTo as that only requires the destination. All I get is 'Could not find a part of the path'
but having added together the variables and written them to the page all seems fine - I can only think it can't find it because it doesn't exist yet, but surely that would be silly right?
|
|
|
|
|
That code should work, there is nowt wrong with it.
Try hardcoding the path into your code rather than getting it from textFields for debugging.
|
|
|
|
|
Try using Path.Combine() to build the path too.
|
|
|
|
|
have tried hard coding it and it works fine.
OK I'll keep searching
thx
|
|
|
|
|
Just a suggestion yyou don't need to use 'ToString()' on the fileinfo.Name <-it is a string
Are you sure the when you call the File.Move() the correct param are being passed?
Programmer: A biological machine designed to convert caffeine into code. Developer: A person who develops working systems by writing and using software.
[ ^]
|
|
|
|
|
Try this:
String ParentDir = textfield1.Text;
String ChildDir = textfield2.Text;
DirectoryInfo di = new DirectoryInfo(Path.Combine(Path.Combine("C:\\", ParentDir), ChildDir));
foreach (FileInfo fileinfo in di.GetFiles())
{
String newdirectory = Path.Combine("C:\\", ParentDir);
//new file name is same as one found
String newfilename = fileinfo.Name;
String Newdirandname = Path.Combine(newdirectory, newfilename);
File.Move(fileinfo.FullName, Newdirandname);
}
|
|
|
|
|
ok, as suggested i removed 'ToString()' - that was mainly added due to frustration.
String ParentDir = textfield1.Text;
String ChildDir = textfield2.Text;
DirectoryInfo di = new DirectoryInfo(@"c:\"+ParentDir+@"\"+ChildDir+@"\");
foreach (FileInfo fileinfo in di.GetFiles())
{
String newdirectory = @"c:\"+ParentDir+@"\";
//new file name is same as one found
String newfilename = fileinfo.Name.ToString();
//String Newdirandname = newdirectory + newfilename;
//File.Move(di+fileinfo.Name, Newdirandname);
fileinfo.MoveTo(Path.Combine(newdirectory, newfilename));
//I have changed this to be fileinfo.MoveTo() to avoid passing the wrong parameter but I still get the same message. I also tried the Path.Combine() method but it didn't change anything
I think I have tried testing everything now and it all comes back to the same result.
}
|
|
|
|
|
OK success!
I have added Path.Combine to everything (everything that needed it!)
and it seems to have worked.
However this was a simplified version, I now have to make it a bit more complicated, but I know it works so thanks for all your help, that was great.
Mark
|
|
|
|
|
This line seems to be the problem. You need to change:
markymark82 wrote: File.Move(di+fileinfo.Name, Newdirandname);
into
File.Move(fileinfo.FullName, Newdirandname);
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|