Click to See Complete Forum and Search --> : Unable to run the application on machine without VC++ installed


sachin.kumar
February 16th, 2005, 01:29 AM
I have build an application in which uses file names from a directory.
to get these file names I used the following code from MSDN.this code requires mscorlib.dll
to be included in the application

#using <mscorlib.dll>

FILE * fp;
String *extension;

// Create a reference to the current directory.
DirectoryInfo* di = new DirectoryInfo("C:\Sachin");
// Create an array representing the files in the current directory.
FileInfo* fi[] = di->GetFiles();
//Console::WriteLine(S"The following files exist in the current directory:");
// write the names of the files in the current directory.
Collections::IEnumerator* myEnum = fi->GetEnumerator();
fp = fopen("nest.lst","w+");
while (myEnum->MoveNext())
{
FileInfo* fiTemp = __try_cast<FileInfo*>(myEnum->Current);
//Console::WriteLine(fiTemp->Name);
extension = Path::GetExtension(fiTemp->Name);

fprintf(fp,"%s\t%s\n",fiTemp->Name,extension);
}

fclose(fp);

this code works using
#using <mscorlib.dll> with /clr option.
this is working fine on my machine.
but i fail to run this application on another machine that doesnt have visual studio installed. As i dont know how to specify path for this dll at run time.
thanks
sachin

VPaul
February 16th, 2005, 03:02 AM
In order to run your application on another machine, dotNET(framework - runtime) must be installed. Because mscorlib.dll is included in .NET.

sachin.kumar
February 16th, 2005, 03:20 AM
thanks for replying. but is there any way to include this dll separately at run time.

Andreas Masur
February 16th, 2005, 03:34 AM
thanks for replying. but is there any way to include this dll separately at run time.
What do you mean? The .NET framework has to be on the system. It cannot be dynamically loaded for the time your application is running...

sachin.kumar
February 16th, 2005, 03:41 AM
What do you mean? The .NET framework has to be on the system. It cannot be dynamically loaded for the time your application is running...
I mean to run the release build version of the exe. which is created in the .NET frame work. with out installing .NET on another machine

Andreas Masur
February 16th, 2005, 04:10 AM
I mean to run the release build version of the exe. which is created in the .NET frame work. with out installing .NET on another machine
OKay...still the answer is no. It has to be installed on the system in order to run your application....

indiocolifa
February 16th, 2005, 04:49 PM
yes, definitely you must install the 23MB sized .NET framework on the client computer.

DOTNETFX.EXE is the redistributable you must download to your client's machine (search it on MS).