C++ project using Windows Event Log - windows

I´m trying to learn the concept of writing events to Windows Event Log using Manifest and I followed the documentation provided by Microsoft.
I´ll describe the steps I took and where it went wrong. Hopefully someone can tell me whats missing or what I'm doing wrong.
Created a Instrumentation Manifest using ECManGen.exe proving information about the provider (C++ Console application), e.g. path to .exe-file. Created channels for all the type (Debug, Administration, Operational, and Analytic). Finally created an event that I
later wanted to write to log. (Also created Tasks and Keywords to organize the Event).
Created a new project in Visual Studio 2013 (C++ Console Application) and included the Manifest (.man) file.
Changed the build settings for the Manifest file to Custom build tool and set command line to mc -v -h . "%(FullPath)" and output to %(Filename).rc;%(Filename).h;.
I then built the project with no problems generating the .rc-file, .h-file, and .bin-files.
After the build I included the all the files to the project generated in Step 4 and rebuild. The rebuild generated the .res-file out of the .rc-file and the resource tab looks like this:
Project
-Manifest.rc
-11
The last step was to register the provider with wevtutil im Manifest.man and this is where I get the error. I received the following error:
Warning: Publisher GGSProvider resources are not accessible.
Failed to open metadata for publisher GGSEventManifest.man. The system cannot find the file specified.
Does anyone see what is wrong or can provide a simple step-by-step guide?
Thanks for any contribution!

The resourceFileName and messageFileName attributes in your manifest file must point to the full path of your dll. You cannot use environment variables in that path.
See http://msdn.microsoft.com/en-us/library/windows/desktop/dd996926(v=vs.85).aspx.

I did the following steps but with an DLL-project and it works fine. Can someone explain this behavior?
The next task is to create an event!

Related

Microsoft Visual Studio unable to start program assemblyx86

So I've been having this problem for a while it is usually a hit or miss. Sometimes I get the error, sometimes I don't.
I'm working on assembly x86 and everytime when I try to create a new project for .asm files, I get an error of the following
Unable to start program
...\Debug\DefaultProjectname.exe
The system cannot find the file specified
These are steps I use to make a file
Create project
Build MASM dependencies
Link Irvine library in additional dependencies
I'm able to build solution so that is kinda weird
Also, I'm trying to find a way that allow me to skip all the steps above and copy the default template

Xamarin test cloud submit app and config file

When submitting an app and test assembly to Xamarin Test Cloud using test-cloud.exe (version Xamarin.UITest.1.3.9.1500-dev) we also need to submit an App.config file (as our test assembly relies on configurable appSettings).
Initially I had hoped that everything within the bin directory (either Debug / Release depending on --assembly-dir provided) would be uploaded to Test Cloud.
This does not appear to be the case, my App.config file (XamarinMobileTests.dll.config) present in the bin directory is not uploaded.
So, to address this issue, I have attempted 2 potential solutions, none of which I have had any success with, these are as follows:
Using the --data parameter with the submit command (--data XamarinMobileTests\bin\Release\XamarinMobileTests.dll.config). This always seems to return an error: "Data files must be located in the assembly directory or a sub folder."
I have attempted to put this file in various locations, with no luck.
Specify appSetting values within the --test-params parameter. This executes the submit command without error and instantiates a test run in test cloud. However, the Xamarin.UiTest Sdk does not seem to have any support for accessing the --test-params specified. My only option seems to be using the Xamarin Web Api, figuring out the test run (also not available via the Sdk) and then fetching the test-params from the test run meta-data.
The documentation on their site is extremely limited for these parameters.
Has anyone experienced similar issues in the past or found a potential solution?
Ideally, the config file is uploaded by default. However, if this is not an option, then solution 1 would be my preferred choice.
Turns out the issue was with a trailing "\" on the --assembly-dir that was causing the config file specified in --data to not be uploaded.
Changing:
".\XamarinMobileTests\bin\Release\"
to:
".\XamarinMobileTests\bin\Release"
Resolved the issue and the config file was successfully uploaded.
It looks as if the test-cloud.exe does some flakey comparisons on file paths.

Run Custom Tool at build in VS

I'm creating an internal VS template to create new versions of a multilingual website with custom fields filled by a wizard. All is going well, until I try and run the program. Upon running, I receive...
Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "<My Namespace>.Global.resources" was correctly embedded or linked into assembly "<My program>" at compile time, or that all the satellite assemblies required are loadable and fully signed.
If I open up the resx files and save them, or choose to run a custom tool before building, it works fine, but if I try to build immediately after creating the project, I receive that error.
My settings on all of my resx files are...
Build Action - Embedded Resource
Copy to Output Directory - Do not coopy
Custom Tool - PublicResXFileCodeGenerator
Custom Tool Namespace - <My Namespace>
Mostly, I'm just looking for a way to run the custom tool at build. This does need to work as I've described it. This is a large company, and non-programmers/non-experts work here.
Thanks in advance,
Andrew

Modifying ClickOnce Output Folder Hierarchy

I'm attempting to publish a ClickOnce Office Extension project (VS2010). By default the output folder of ClickOnce has a child folder (with each version of the binary files) named "Application Files." I need to change this to something without a space in the name, for example "AppFiles."
I haven't found any place in the docs where this is explained and the few answers I have found have said to use Mage to manually modify .VSTO file next to the bootstrap setup.exe. I'd like to avoid that if at all possible.
What is the best way to go about changing this?
I have tried a few different things. Instead of using the built in Microsoft.Common.props, In a copy of Microsoft.Common.targets I've modified the _DeploymentApplicationFolderName property inside the _CopyFilesToPublishFolder target to "Application_Files." Also in a copy of Microsoft.VisualStudio.Tools.Office.targets, I've modified the Value of the ApplicationFilesFolderName property set inside InitializePublishProperties to "Application_Files."
Even after doing that, when I publish I get the following error:
Error 121 Publish failed with the following error: Could not find a part of the path '<path to output directory>\app.publish\Application Files\ProjectStats_1_0_0_15'.
I'm guessing the problem is this is happening when the copy from the output dir to the publish dir happens but I don't know. Either way, the output directory hierarchy seems fine and the VSTO refers to the proper path in the hierarchy for the relevant dlls. It's just the publish process fails.
It turns out there's no way to fix this and still use the Publish wizard in Visual Studio. After looking at the code for the Publish method in Microsoft.VisualStudio.Tools.Applications.Project.ClickOnceProvider.BuildManager class in the Microsoft.VisualStudio.Tools.Applications.Project.dll assembly, the directory name "Application Files" is hard coded. There is no way to automatically fix this from what I can tell.

Build error with VC6

When I build my application in VC6 IDE, I get this error:
--------------------Configuration: all - Win32 PRO Unicode Release--------------------
The system cannot find the file specified.
Error executing c:\windows\system32\cmd.exe.
all.exe - 1 error(s), 0 warning(s)
I don't have any custom build commands, and this error is particular to this specific project only. Please help.
The Build error was due to the unload of one of our sub-project dsp in our VC dsp file.
We unloaded a sub project that was not required for build. but we didnt remove it from project dsp.
( actually we have series of sub - project dsp files to be built with the main dsp file)
Once it was loaded and built again, the error vanished. Thanks for your suggestions and answers.
Didnt get the reason, but it solved the problem.
It is likely you have a custom build command in one of your applications dependencies.
Review them all, and in each one that has anything, add an ECHO ON as the first step.
Then when you do your build, you will see the details of what command is failing.
The most common problem I have, is when i try to copy header files to a common location automatically. I sometimes get the relative path wrong. Adding a DIR to the post build
is an easy way to show where you are, and can help correct path errors.
you may be deleted your environment variable
I changed the build mode from from Win32 Simulation to Win32 Debug and clicked on "Rebuild All" and it worked.

Resources