473,414 Members | 1,577 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

VStudio 2008: How to create simple console tool?

Hi,

I've created a few simple console tools. No .NET used at all, just STL.

Now I want to just XCOPY them to another machine. But running them there yields a couple of errors in the application log telling me that some ..NET DLL could not be found:
"The application has failed to start because its side-by-side configuration is incorrect.
Please see the application event log for more details."

The application log says:

"Activation context generation failed for "D:\Documents\MyTools\SomeTool.exe". Dependent Assembly Microsoft.VC90.CRT,processorArchitecture="x86",pub licKeyToken="1fc8b3b9a1e18e3b",type="win32",versio n="9.0.21022.8" could not be found. Please use sxstrace.exe for detailed diagnosis."
I learned that this error occurs because of missing .NET runtime files on the target machine. But I DON'T want to install .NET on the target machine. I'm *intentionally* just using common API and STL functions.

Can someone please enlighten me on how to set up a VC++ project to don't use .NET at all?

I just want to create some simple DOS tools that I can put on my USB stick to help me with my daily work.

TIA,
Axel Dahmen
Aug 10 '08 #1
4 4150
Try static linking CRT.

Giovanni

"Axel Dahmen" <Ke********@newsgroup.nospamha scritto nel messaggio
news:AA**********************************@microsof t.com...
Hi,

I've created a few simple console tools. No .NET used at all, just STL.

Now I want to just XCOPY them to another machine. But running them there
yields a couple of errors in the application log telling me that some .NET
DLL could not be found:
"The application has failed to start because its side-by-side configuration
is incorrect.
Please see the application event log for more details."

The application log says:

"Activation context generation failed for
"D:\Documents\MyTools\SomeTool.exe". Dependent Assembly
Microsoft.VC90.CRT,processorArchitecture="x86",pub licKeyToken="1fc8b3b9a1e18e3b",type="win32",versio n="9.0.21022.8"
could not be found. Please use sxstrace.exe for detailed diagnosis."
I learned that this error occurs because of missing .NET runtime files on
the target machine. But I DON'T want to install .NET on the target machine.
I'm *intentionally* just using common API and STL functions.

Can someone please enlighten me on how to set up a VC++ project to don't use
..NET at all?

I just want to create some simple DOS tools that I can put on my USB stick
to help me with my daily work.

TIA,
Axel Dahmen
Aug 10 '08 #2

"Giovanni Dicanio" <gdicanio@_NOSPAM_email_DOT_itha scritto nel messaggio
news:uq****************@TK2MSFTNGP02.phx.gbl...
Try static linking CRT.
i.e. :

Select project properties, then navigate here:

Configuration Properties | C/C++ | Code Generation

and select:

Runtime library = Multi-threaded (/MT)

(or use /MT option from command line).

In this way, you will have just a simple .exe that you can distribute.

Giovanni
Aug 10 '08 #3
Hi Axel,
I've created a few simple console tools. No .NET used at all, just
STL.
Now I want to just XCOPY them to another machine. But running them
there yields a couple of errors in the application log telling me
that some .NET DLL could not be found:
....
"Activation context generation failed for
"D:\Documents\MyTools\SomeTool.exe". Dependent Assembly
Microsoft.VC90.CRT,processorArchitecture="x86",pub licKeyToken="1fc8b3b9a1e18e3b",type="win32",versio n="9.0.21022.8"
could not be found. Please use sxstrace.exe for detailed diagnosis."
Where does the error talk about .Net?
I learned that this error occurs because of missing .NET runtime
files on the target machine.
Where did you learn that? You have been taught wrong!
The above microsoft.vc90.crt is the C++ runtime, a native dll which
is needed when you link to the CRT dll instead of static linkage
Please learn the differences of native and managed VC++ more
carefully and you will have much less trouble ;-)
But I DON'T want to install .NET on the
target machine. I'm *intentionally* just using common API and STL
functions.
Can someone please enlighten me on how to set up a VC++ project to
don't use .NET at all?
Change your VC++ project settings to use static linkage:

General settings:
- Use of MFC "Standard Windows" or "Static Library"
- Use of ATL "Not using ATL" or "Static Link"
- Common Language Runtime (this is .Net!) "No Common Language Runtime"

C/C++/Code Generation:
- Runtime Library (this causes your above error!) "Multi-threaded" or
"Multi-threaded Debug" depending on the Build Configuration you are
configuring "Release" or "Debug"

--
SvenC

Aug 10 '08 #4
Thanks, Giovanni and Sven, a lot for enlightening me and helping me out with the appropriate settings!!

Sven,
yes you're perfectly right. My mistake. I apologize for having been ignorant on the details of SxS... I must have got something wrong when reading about "assemblies" and the syntax of how the CRT file is referenced in the event log.

I've now found a very helpful blog on SxS on MSDN which I'm just reading into:

http://blogs.msdn.com/dsvc/archive/2...-problems.aspx

Thanks again to both of you for being a valuable help on my problem.

Best regards,
Axel Dahmen

PS: I've posted this reply once before, but there seems to be a problem with Windows Mail on Vista. It sometimes doesn't download my own replies from the newsgroup. So it's impossible for me to see if my reply actually reached the newsgroup at all. That's why I'm re-posting now...


-----------------
"SvenC" <Sv***@nospam.nospamschrieb im Newsbeitrag news:31**********************************@microsof t.com...
Hi Axel,
>I've created a few simple console tools. No .NET used at all, just
STL.
Now I want to just XCOPY them to another machine. But running them
there yields a couple of errors in the application log telling me
that some .NET DLL could not be found:
...
>"Activation context generation failed for
"D:\Documents\MyTools\SomeTool.exe". Dependent Assembly
Microsoft.VC90.CRT,processorArchitecture="x86",pu blicKeyToken="1fc8b3b9a1e18e3b",type="win32",versi on="9.0.21022.8"
could not be found. Please use sxstrace.exe for detailed diagnosis."
Where does the error talk about .Net?
>I learned that this error occurs because of missing .NET runtime
files on the target machine.
Where did you learn that? You have been taught wrong!
The above microsoft.vc90.crt is the C++ runtime, a native dll which
is needed when you link to the CRT dll instead of static linkage
Please learn the differences of native and managed VC++ more
carefully and you will have much less trouble ;-)
>But I DON'T want to install .NET on the
target machine. I'm *intentionally* just using common API and STL
functions.
Can someone please enlighten me on how to set up a VC++ project to
don't use .NET at all?
Change your VC++ project settings to use static linkage:

General settings:
- Use of MFC "Standard Windows" or "Static Library"
- Use of ATL "Not using ATL" or "Static Link"
- Common Language Runtime (this is .Net!) "No Common Language Runtime"

C/C++/Code Generation:
- Runtime Library (this causes your above error!) "Multi-threaded" or
"Multi-threaded Debug" depending on the Build Configuration you are
configuring "Release" or "Debug"

--
SvenC
Aug 10 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: mike | last post by:
What is the proper method for setting up visual studio 2003 to store and run solutions on a windoes 2003 webserver? Using vstudio enterprise on a WinXP client. Major issue is that SafeSource...
0
by: Daniel Perron | last post by:
Hi, I was trying to use Galois.Net to specify code generators and I had to look for some text template tool to simplify the syntax. I was looking for something similar to the syntax of an...
1
by: JJA | last post by:
I am exploring use of the new ASP.NET 2.0 membership facilities. Using Visual Studio 2005 on WinXP, I have one little site in http://localhost/mySite which exposes the menu choice "ASP.Net...
27
by: max | last post by:
Hello, I am a newbye, and I'm trying to write a simple application. I have five tables with three columns; all tables are identical; I need to change some data in the first table and let VB...
6
by: Oriane | last post by:
Hi there, I deploy my WPF application with Visual Studio 2008 and ClickOnce. My application runs with the ;Net 3.0 framework, but during the installation steps, the .Net 3.5 component is...
2
by: Kerem Gümrükcü | last post by:
Hi, for some unknow reason the UI of the VS2008 didnt respond to any kind of input even like Ctrl+F4 or Exit Command. The Save,Open,Save As, commands didnt respond and the IDE gave me that...
5
by: Claudio M. E. Bastos Iorio | last post by:
Hi, anyone using VS2008 (final) on windows Vista? I have a problem. The ASP.NET web site administration tool on any site created by VS2008, running on Vista, is not working as it should. I can...
12
by: rmiller407 | last post by:
I am getting an AccessViolationException when calling an old legacy fortran dll from c# in vs2008 express, but the same code worked fine in vs2005. If I create a vs2005 c# wrapper dll to call...
6
by: Wesley Peace | last post by:
I hate to cross post, but I've gotten no answer yet on a problem I'm having with visual studio 2008. I've created a series of forms with controls to access a Access database tables. The...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.