|
Scott Dorman wrote: The original post is here[^].
From my point of view, it's here[^].
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Yep, you're right. I didn't see that one.
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
Hi all!
My application is having a strange behavior and I can't find how to solve it.
I have a thread that executes an application using AppDomain.CurrentDomain.ExecuteAssembly(app);. I have a try/catch block surrounding this statement and catch for any Exceptions (assuming this are Unhandled exceptions from the application I'm executing.
Here is the code:
try
{
AppDomain.CurrentDomain.ExecuteAssembly(AUT.File);
}
catch (Exception excp)
{
logger.Warn("an exception was unhandled: " + excp.ToString());
}
The thing is that when I'm executing this code with debugger (in Visual Studio) the behavior is as I expected, i.e, the try/catch block catches unhandled exceptions inside the assembly I'm executing. But If I run it without a debugger the try/catch block doesn't catches unhandled exceptions. But a message box is shown informing of the thrown exception.
Why this behavior? How can make it have always the same behavior?
Thanks
José Tavares
|
|
|
|
|
Well the reason this happens is because all Windows Forms applications handle all unhandled exceptions by default in the Application.Run loop. If I add
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException);
all unhandled exceptions that occur in this application are re-thrown and my application code catches the exceptions.
The problem is that I want to use my application to test 3rd party apps sometimes don't having the code. Is there any other way to reproduce this behavior from outside the application or will I have to use Reflection to add that line to every application that I will test?
Thanks
José Tavares
|
|
|
|
|
Hi!
i have to zip a folder, when i use ZipPackage, it creates a [Content_Types].xml in the created zip file. I don't want it and can not find a way to omit it.
Help me pleaaaase
|
|
|
|
|
I am also getting same problem..if you find any solution please let me know..
thak's In advance.
ramanakant.
|
|
|
|
|
I had a very big doubt regarding the windows search api which im trying to implement in my search engine.I want to use windows serach api - Advanced Query Syntax to search a particular search criteria in sql server dtabase.Since Isearch manager classs of WDS API needs index to be specified ; when i give my table index it throws an exception "Error HRESULT E_FAIL has been returned from a call to a COM component".
It would be great if smebody guide me thru this or atleast sum pointers.I have been really stucked up past 5 days with this.Please mail me the code snippet for the same.
My mail id is online.shraddha@gmail.com
|
|
|
|
|
You've been wasting your time for 5 days because Windows Search doesn't work with SQL databases. Where di you find documentation that says it works with SQL??
|
|
|
|
|
Hey Dave,
Thank you so much.Preasently I am using full text search feature of sql server 2008.Can u please suggest me sumthing better thah this which will increase my search performance and also will narrow down my search.
Thanks
Shraddha
|
|
|
|
|
You're using the best product for the job. Perhaps you should be looking at your database structure and indexing for better performance.
|
|
|
|
|
ok..What if i write api which is same like windows serach api; but for database?Coes that sound good?
|
|
|
|
|
shraddhapingale wrote: What if i write api which is same like windows serach api; but for database?Coes that sound good?
No, it doesn't.
The best search engine will only works as good as the underlying database structure. But, if you wanted to take, probably, more than a year to develop you're own search engine, far be it from me to stop you.
|
|
|
|
|
Am using Enterprise Library 3.1 for logging exception in my webapplication. In debug mode its logging the exception. But in Publish mode its not logging the its not logging the exception.
Please let me know what needs to be done.
TIA
Regards,
Praveena
|
|
|
|
|
Hi I have vc++ 6.0 application and i am trying to port into .Net framework (VS2005). One of my process needs to be run in Admin credentials and for the I have added manifest file in application resource using
(#define MANIFEST_RESOURCE_ID 1
MANIFEST_RESOURCE_ID RT_MANIFEST "Test1.exe.manifest") commands and this get added into resources. I also created the Test1.exe.manifest file and provided credentials as follows:
[
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0"
processorArchitecture="X86"
name="Test1.exe"
type="win32"/>
<description>Description of your application</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="requireAdministrator"
uiAccess="true"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
]
Even provided "requireAdministrator" credentials in requirePriviledge tag my application is running with the normal user credentials instead on Admin credentials. While building application with this maifest added it is giving Warning as follows:
[
manifest authoring warning 81010002: Unrecognized Element "requestedPrivileges" in namespace "urn:schemas-microsoft-com:asm.v2"
]
Please let know how to run applcation with Admin credentails.
THanks
SNI
jhghjghj
|
|
|
|
|
Maybe try
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
<assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="Test1.exe" type="win32"/>
<description>Description of your application</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level='requireAdministrator' uiAccess='false' />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
This is not working. still the output is same.
jhghjghj
|
|
|
|
|
So you voted him down because his suggestion didn't work??
|
|
|
|
|
I guess in all fairness, my answer was unhelpful if it didn't work
I do, however, take that as an indication that I don't need to look
into it any further.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Very true! I've gotten a few of mine voted down too. Is it just me, or has this become a bit more common recently??
|
|
|
|
|
I think it's mostly because there's only two choices for
voting initial replies...could be wrong.
I actually won't stop pursuing the problem if the OP is
doing his/her part on the other end....doesn't seem to be
the case here
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
You aren't going to get many answers if you vote people down for trying to be helpful. It says "Helpful answer" not "Did it do everything you wanted it to, even though you missed bits out".
|
|
|
|
|
Guys you are taking it in wrong way. My intention is to say "NO" just that bcoz the it is not working and it does not mean that it is not helpful. I think there should one more option available to choose "Helpful but not wotking".
jhghjghj
|
|
|
|
|
Alternatively, you don't choose an option and you post a follow up question. Less contentious all round.
|
|
|
|
|
Ok, I fired up the old Visual Studio 2005 and created a new project.
I added a file to the project called MyAppName.exe.manifest
(MyAppName.exe MUST be the resulting EXE file name)
In that file I put the following XML:
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
<assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="Test1.exe" type="win32"/>
<description>Description of your application</description>
<dependency>
<dependentAssembly>
<assemblyIdentity type='win32' name='Microsoft.VC80.DebugCRT' version='8.0.50727.762' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
</dependentAssembly>
</dependency>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel level='requireAdministrator' uiAccess='false' />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
Note that your dependeny section may be different - create a simple project
(of type similar to yours - Win32, MFC, whatever) with the wizard, build it,
and examine the created .intermediate.manifest file to get the dependencies.
In the project properties/Linker/Manifest File I set Generate Manifest to no
*edit* this step isn't necessary
In the project properties/Build Events/Post-build Event I added the following
command line:
“$(FrameworkSDKDir).\Bin\mt.exe” -nologo -manifest “$(ProjectDir)$(TargetFileName).manifest” -outputresource:”$(TargetPath);#1″
Built the project - no warnings no errors.
Ran the exe from debugger - got the "requires elevation" error.
Ran the exe from Windows Explorer - got the UAC prompt.
Mark Salsbery
Microsoft MVP - Visual C++
modified on Tuesday, October 14, 2008 2:21 PM
|
|
|
|
|
thanks it is working
jhghjghj
|
|
|
|