Is showing the Exception StackTrace useful in a RELEASE assembly or only a DEBUG .dll - asp.net

I've gone to some lengths to improve the error handling in my webservice - in particular, showing the StackTrace as in this example:
catch (Exception ex)
{
EventLog log = new EventLog();
log.Source = g_EventSource;
StringBuilder msg = new StringBuilder("Exception in UpdateRecord method has been logged:");
msg.Append(Environment.NewLine);
msg.Append("passedURL="); msg.Append(passedURL);
msg.Append(Environment.NewLine);
msg.Append(ex.Message);
msg.Append(Environment.NewLine);
msg.Append(ex.Source);
msg.Append(Environment.NewLine);
msg.Append(ex.StackTrace);
log.WriteEntry(msg.ToString(), EventLogEntryType.Error, 100);
return msg.ToString();
}
My question is what will happen when I publish my webservice having compiled it as RELEASE instead of DEBUG? I only publish the .dll and the web.config (no source) now when I compile in DEBUG mode but when an error is logged the StackTrace points back to line numbers of file(s) in my development machine like:
C:\Documents and Settings\johna\My Documents\Visual Studio 2008\Projects\ etc.
In short, will a RELEASE mode DLL still show the above sort of stack trace? I think it will but not sure; my system administrator has raised this question as we prepare for a move into another level of deployment.

You can have line numbrers in Stack Trace messages but you need to include .PDB files. No problems even in release mode.

Related

System.Runtime.InteropServices.COMException: 'The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))'

I am working with zkemkeeper 64 bit. I am having an error When i ccall
bool a = axCZKEM1.Connect_Net(IPAddress, Port);
axCZKEM1 is my zkemkeeper.CZKEMClass object.
The following error i am getting.
System.Runtime.InteropServices.COMException: 'The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))'
Can you please help me with this ?
It is because COM dll files are not registered. you must have something like install.bat, run it in admin mode. Or find the Dll files from the download SDK folder, register all of them, then run the application. Problem will be resolved.

Visual Basic 2015 project for VB.NET to work in XP

Apologies for my lack of knowledge as I do not have much experience.
I have created a VB.NET application using visual basic 2015 however, when I tried to run the application on XP Professional Version 2002 SP3 I get the follow error message.
I have for the life of me do not know how to fix this. The .net framework which the application was created in was 4.5.2.
The application works perfectly on Windows 7 and Windows 10.
However, issues are only on XP
PLATFORM VERSION INFO
Windows : 5.1.2600.196608 (Win32NT)
Common Language Runtime : 4.0.30319.269
System.Deployment.dll : 4.0.30319.1 (RTMRel.030319-0100)
clr.dll : 4.0.30319.269 (RTMGDR.030319-2600)
dfdll.dll : 4.0.30319.1 (RTMRel.030319-0100)
dfshim.dll : 4.0.31106.0 (Main.031106-0000)
SOURCES
Deployment url : file:///C:/Documents%20and%20Settings/rwuser/Desktop/Disk%20Cleanup%20Toolkit/drive_cleanup.application
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of C:\Documents and Settings\rwuser\Desktop\Disk Cleanup Toolkit\drive_cleanup.application resulted in exception. Following failure messages were detected:
+ Exception reading manifest from file:///C:/Documents%20and%20Settings/rwuser/Desktop/Disk%20Cleanup%20Toolkit/drive_cleanup.application: the manifest may not be valid or the file could not be opened.
+ Manifest XML signature is not valid.
+ SignatureDescription could not be created for the signature algorithm supplied.
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [28/07/2016 09:56:20] : Activation of C:\Documents and Settings\rwuser\Desktop\Disk Cleanup Toolkit\drive_cleanup.application has started.
ERROR DETAILS
Following errors were detected during this operation.
* [28/07/2016 09:56:21] System.Deployment.Application.InvalidDeploymentException (ManifestParse)
- Exception reading manifest from file:///C:/Documents%20and%20Settings/rwuser/Desktop/Disk%20Cleanup%20Toolkit/drive_cleanup.application: the manifest may not be valid or the file could not be opened.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)
at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestDirectBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
--- Inner Exception ---
System.Deployment.Application.InvalidDeploymentException (SignatureValidation)
- Manifest XML signature is not valid.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.Manifest.AssemblyManifest.ValidateSignature(Stream s)
at System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)
--- Inner Exception ---
System.Security.Cryptography.CryptographicException
- SignatureDescription could not be created for the signature algorithm supplied.
- Source: System.Security
- Stack trace:
at System.Security.Cryptography.Xml.SignedXml.CheckSignedInfo(AsymmetricAlgorithm key)
at System.Security.Cryptography.Xml.SignedXml.CheckSignature(AsymmetricAlgorithm key)
at System.Security.Cryptography.Xml.SignedXml.CheckSignatureReturningKey(AsymmetricAlgorithm& signingKey)
at System.Deployment.Internal.CodeSigning.SignedCmiManifest.Verify(CmiManifestVerifyFlags verifyFlags)
at System.Deployment.Application.Manifest.AssemblyManifest.ValidateSignature(Stream s)
COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.
XP only supports the .NET Framework up to version 4.0. If you want to run it on XP you'll need to change the target framework to 4 and re-compile the project.
https://blogs.msdn.microsoft.com/dotnet/p/dotnet45xp/

open function in ChannelFactory gives File not found exception. using Biztalk adapter

I am connecting my local system with SAP server using BizTalk adapter and also using Microsoft.servicemodel.channels to open the connection in sap to process XML as input file.
SAPBinding binding = new SAPBinding();
binding.ReceiveTimeout = TimeSpan.MaxValue;
binding.SendTimeout = TimeSpan.MaxValue;
binding.EnableBusinessObjects = true;
binding.EnableSafeTyping = true;
EndpointAddress address = new EndpointAddress(SAPConnectionString);
ChannelFactory<IRequestChannel> factory = new ChannelFactory<IRequestChannel>(binding, address);
// add credentials
factory.Credentials.UserName.UserName = SAPUserName;
factory.Credentials.UserName.Password = SAPPassword;
// Open client
factory.Open(TimeSpan.MaxValue);
Factory.open cannot open the connection and it through an exception as A specified module could not be found, (Exception from HRESULT : 0x8007007E)
Kindly please help me
thanks in advance.
The error message suggests there is a dependency on an assembly it is unable to find. Please note this is not something specific to WCF or the SAP adapter.
Googling for "HRESULT: 0x80070007E" I found:
C# Unable to load DLL (Module could not be found HRESULT: 0x8007007E)
In David Heffernan's answer he recommends using tools like Dependency Walker to help debug dependency issues.

OrangeBits extension for WebMatrix may have caused a crash and has been disabled

I'm getting the following error every time I open WebMatrix with the OrangeBits extension installed:
The "OrangeBits" extension may have caused a crash and has been disabled. We recommend contacting the extension owner for assistance.
System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. ---> Ionic.Zip.ZipException: The file C:\USERS\NAME\APPDATA\LOCAL\MICROSOFT\WEBMATRIX\EXTENSIONS\30\OrangeBits\Tools\bin\cake already exists.
at Ionic.Zip.ZipEntry.CheckExtractExistingFile(String baseDir, String targetFileName)
at Ionic.Zip.ZipEntry.InternalExtract(String baseDir, Stream outstream, String password)
at Ionic.Zip.ZipEntry.Extract(String baseDirectory)
at OrangeBits.OrangeBits.<>c__DisplayClass17.<UnpackModules>b__15()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of inner exception stack trace ---
---> (Inner Exception #0) Ionic.Zip.ZipException: The file C:\USERS\NAME\APPDATA\LOCAL\MICROSOFT\WEBMATRIX\EXTENSIONS\30\OrangeBits\Tools\bin\cake already exists.
at Ionic.Zip.ZipEntry.CheckExtractExistingFile(String baseDir, String targetFileName)
at Ionic.Zip.ZipEntry.InternalExtract(String baseDir, Stream outstream, String password)
at Ionic.Zip.ZipEntry.Extract(String baseDirectory)
at OrangeBits.OrangeBits.<>c__DisplayClass17.<UnpackModules>b__15()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()<---
Referencing Justin Beckwith's answer here
Resolving this issue was as simple as navigating to:
C:\USERS\NAME\APPDATA\LOCAL\MICROSOFT\WEBMATRIX\EXTENSIONS\30\OrangeBits\Tools
And deleting modules.zip

ClickOnce Application try to find an application manifest in a wrong location (strange parameters)

This is my third post on ClickOnce, but each of them has its own subject so I hope nobody minds this. I'm urgently migrating the existing app to the new server. I publish a ClickOnce application to a server (online usage only, not for install), and if I try to execute it via web browsers, I get a message box saying "Cannot continue. The Application is improperly formatted. Contact the application vendor for assistance.", the detail log of which includes below; (I masked some strings in the URL by *, as it was private information)
PLATFORM VERSION INFO
Windows : 5.1.2600.196608 (Win32NT)
Common Language Runtime : 4.0.30319.1
System.Deployment.dll : 4.0.30319.1 (RTMRel.030319-0100)
clr.dll : 4.0.30319.1 (RTMRel.030319-0100)
dfdll.dll : 4.0.30319.1 (RTMRel.030319-0100)
dfshim.dll : 4.0.31106.0 (Main.031106-0000)
SOURCES
Deployment url: http://**.**.***.173:10080/*****/ClickOnce/*********.application?comid=*****&userjpname=************&userfullname=************&canregist=True&canmanage=True&systemid=0
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of http://**.**.***.173:10080/*****/ClickOnce/*********.application?comid=*****&userjpname=************&userfullname=************&canregist=True&canmanage=True&systemid=0 resulted in exception. Following failure messages were detected:
+ Exception reading manifest from http://**.**.***.173:10080/*****/ClickOnce/*********.application?comid=*****&userjpname=************&userfullname=************&canregist=True&canmanage=True&systemid=0: the manifest may not be valid or the file could not be opened.
+ Manifest XML signature is not valid.
+ The digital signature of the object did not verify.
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [2012/07/24 13:16:39] : Activation of http://**.**.***.173:10080/*****/ClickOnce/*********.application?comid=*****&userjpname=************&userfullname=************&canregist=True&canmanage=True&systemid=0 has started.
ERROR DETAILS
Following errors were detected during this operation.
* [2012/07/24 13:16:39] System.Deployment.Application.InvalidDeploymentException (ManifestParse)
- Exception reading manifest from http://**.**.***.173:10080/*****/ClickOnce/*********.application?comid=*****&userjpname=************&userfullname=************&canregist=True&canmanage=True&systemid=0: the manifest may not be valid or the file could not be opened.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)
at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestDirectBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
--- Inner Exception ---
System.Deployment.Application.InvalidDeploymentException (SignatureValidation)
- Manifest XML signature is not valid.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.Manifest.AssemblyManifest.ValidateSignature(Stream s)
at System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)
--- Inner Exception ---
System.Security.Cryptography.CryptographicException
- The digital signature of the object did not verify.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Internal.CodeSigning.SignedCmiManifest.Verify(CmiManifestVerifyFlags verifyFlags)
at System.Deployment.Application.Manifest.AssemblyManifest.ValidateSignature(Stream s)
COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.
My server address is http://**.**.***.173:10080, and a clickonce app is published in http://**.**.***.173:10080/*****/ClickOnce folder.
I assume it tried to find an application manifest file (.manifest) with these several weird parameters (or query strings?) such as comid, userjpname, userfullname, canregist, canmanage, True and systemid, and thus it returned an error.
In my deployment manifest file, the location of the application manifest file is specified as below. No idea where these parameters came from.
<dependentAssembly
dependencyType="install"
codebase="MYAPPNAME_9_9_9_99\MYAPPNAME.exe.manifest"
size="8532">
<assemblyIdentity
name="MYAPPNAME.exe"
version="1.0.1.43"
publicKeyToken="*************"
language="neutral"
processorArchitecture="msil"
type="win32" />
Did you try to sign the application and deployment manifests again?
Reading you description again, I'm a bit confused.
First you create an application manifest.
Then you sign it.
Then you create a deployment manifest and explicitly point it to your application manifest.
Then you sign this, too.
(btw: you have to do the signing part every time you change something.)

Resources