With Msbuild v3.5 I can include the "/m" switch to enable multiprocessor support . However I cannot find an equivalent property that hangs off of anything in Microsoft.Build.BuildEngine. How do I enable this setting via the API?
I tried to discover this myself by reflecting over Msbuild.exe (thanks Lutz!) but it doesn't use the BuildEngine instead using System.Threading.Thread directly.
Does this...
http://blogs.msdn.com/msbuild/archive/2007/10/22/enabling-multiprocessor-support-in-an-msbuild-host.aspx
... answer your question?
Essentially, it looks as if you use the constructor of Engine that takes a parameter for the number of CPUs to use.
http://msdn.microsoft.com/en-us/library/bb300140.aspx
public Engine(
BuildPropertyGroup globalProperties,
ToolsetDefinitionLocations locations,
int numberOfCpus,
string localNodeProviderParameters
)
Related
I have a question regarding modifying SDK settings from the application using it.
I have a custom SDK which prints to a log when doing certain things. I want users of this SDK to be able to turn logging on/off. I use NSLog as my logger.
I have tried setting a preprocessor macro for this, as explained numerous times here in stackoverflow by doing something like:
#ifdef SHOWLOG
# define SLog(fmt, ...) NSLog((fmt), ##__VA_ARGS__);
#else
# define SLog(...)
#endif
And then expecting the user to set a compile flag called "-DSHOWLOG"
This does not work since the person who is using the SDK will have a compiled version of the SDK.
What other ways are there are there of changing configurations of SDK from the application that uses it?
Are environment variables a good option?
Maybe I'm misunderstanding the question, so I'll guess and offer this answer in the hope it helps:
Inside your SDK create your settings which you query to control how your SDK behaves. These settings can be stored in a shared/singleton object, behind a functional (i.e. C functions) API, or even just SDK (not publicly documented) global variables.
Provide a public API which alters the values of these settings.
So in the situation mentioned in the question you need an SDK-internal "show log" setting and a public API to set it.
HTH
I am trying to get value of a Filehandle created using System.IO.FileStream class.
using System.IO;
Filestream fs = New FileStream("c:/1/txt",FileMOde.OpenorCreate,FileAccess.ReadWrite);
Intptr file_ptr = fs.Handle;
When I run this in XP-x86 os with debug configuration, it works fine. But when I run it in Ce-Arm OS with release configuration, it is throwing an error.
System.IO.FileStream does not contain a definition for Handle and no extension method Handle accepting a first argument of type System.IO.FileStream could be found (are you missing a using directive or an assembly reference?)
Should I make any changes when I am trying to build in release configurations.
I know the release configuration will turn on all the compiler optimizations. But what does it have to do with inbuilt classes and properties? I am really confused. Please help.
Thanks in advance.
There are a few things going on here.
Directories in Windows (desktop and CE) are delimited by the backslash '\' character, not the forward slash. Desktop Windows might not mind it, but Windows CE isn't going to like it.
Windows CE has no notion of drive letters (or current directory for that matter) so your path is invalid for that reason as well.
The CF FileStream doesn't expose the file handle, and I'd say for likely good reasons. That's the specific reason for the error you see. Messing with the handle outside of the managed stream can cause the managed side of things to get into an indeterminate state and lead to bad things. Why, exactly, do you need that handle? If we know that, maybe we can propose a workaround, but generally using that native handle is going to lead to bad things happening.
I want to implement a Webbrowser in my vb.net (2008)-project, however, I don't like the inbuilt IE.
I also remembered that is was kind of easy to implement a mozilla-tool like the gecko-webbrowser in the past...
It was kinf of more complicated than I remember, as I had to dwnload xulrunner and Skybound.Gecko.dll which both probably have to be included in any publishing of the finished project... I also defined x86 as target CPU and made all the needed steps to use a GeckoWebBrowser within my Application. I also called Skybound.Gecko.Xpcom.Initialize(My.Application.Info.DirectoryPath & "/xulrunner") before compiling it.
However, when I try GeckoWebBrowser1.navigate("http://...") (The element was inserted with this name per designer) the IDE tells me that an objectreference is not set to a objectinstance as if GeckoWebBrowser1 isn't defined yet... but the GeckoWebBrowser1.Created attribute is giving back true.
Does anybody know why it isn't working yet?
I have the same error in my solution. Try to use GeckoFX assembly. I use 15 version dll and error fix.
https://bitbucket.org/geckofx/geckofx-16.0/downloads
First, I'm sorry but this is kind of a "give me teh codez" question. I promise to learn from your answers, though! That means that feel free to use the Socratic method if you feel it's necessary.
I'm currently developing (both maintenance and building new ones) multiple sites using Grails and the way it works is that it provides a commandline shell for executing various tasks.
This is all fine and well, but switching between versions is a bit of a nuisance, since it's all controlled by a single environment variable called GRAILS_HOME which is set to point to a directory such as C:\grails\grails-1.2.3\.
Now, what I would like to be able to do that instead of doing something like this:
grails create-app MyWebApp
grails list-plugins -repository=myPluginRepo
grails install-plugin myPlugin
and then noticing that I'm using the wrong version and that I have to go back, I'd rather do
g135 create-app MyWebApp
g135 list-plugins -repository=myPluginRepo
g135 install-plugin myPlugin
which would immediately tell me that I'm using Grails 1.3.5.
The problem I have in creating a psh script like this is that I absolutely suck at creating scripts. I did try doing this but after about five mysterious error messages from psh itself I decided to just ask for advice.
Bonus points: If I can parameterize the alias call to specify the version (something like g[1.3.5] other params) and then append the number to the environment variable value,
that'd be the most handy solution for me.
This should do it:
Function PSGrails($ver)
{
$env:GRAILS_HOME='c:\grails\grails-{0}\' -f $ver
grails $args
}
It's just a short function that sets the variable and then executes grails as above.
Run it by specifying the version number directly after the function name:
psgrails 1.3.5 create-app MyWebApp
psgrails 1.3.5 list-plugins -repository=myPluginRepo
psgrails 1.3.5 install-plugin myPlugin
In short: I want to monitor selected calls from an application to a DLL.
We have an old VB6 application for which we lost the source code (the company wasn't using source control back then..). This application uses a 3rd party DLL.
I want to use this DLL in a new C++ application. Unfortunately the DLL API is only partially documented, so I don't know how to call some functions. I do have the functions signature.
Since the VB6 application uses this DLL, I want to see how it calls several functions. So far I've tried or looked at -
APIHijack - requires me to write C++ code for each function. Since I only need to log the values, it seems like an overkill.
EasyHook - same as 1, but allows writing in the code in .NET language.
OllyDbg with uHooker - I still have to write code for each function, this time in Python. Also, I have to do many conversions in Python using the struct module, since most functions pass values using pointers.
Since I only need to log functions parameters I want a simple solution. Is there any automated tool, for which I could tell which functions to monitor and their signature, and then get a detailed log file?
A "static" solution (in the sense it can capture a stack trace on demand) would be Process Monitor.
A more dynamic solution would be ApiMonitor, but it may be too old to be compatible with the applications to monitor. Worth a try though.
Some more Google searching found what I was looking for: WinAPIOverride32. It allows writing text files such as:
CustomApi.dll|void NameOfFunction(long param1, double& param2);
Later on, these files can be used inside the program to log all calls to NameOfFunction. Now I just need to figure out how to log arrays and structs parameters.
Visual Studio Addin Runtime Flow here:
Runtime Flow in real time monitors and logs function calls and
function parameters in your running .NET application and shows a stack
trace tree. No instrumentation or source code required for monitoring.
If you just want to see the function interfaces of the DLL, you could try "Dependecies" (https://lucasg.github.io/Dependencies/). This is a nice remake of the DependencyWalker in as OpenSource.
This only allows you to see the dependencies of the DLL, with the corresponding function names (however, not the calling structure). Unfortunately, I don't believe it will tell you which specific functions in a DLL are being used by the calling DLL/EXE.