I am currently attempting to use WCF services to input data into a database,
I have been following the steps of this tutorial: http://www.c-sharpcorner.com/UploadFile/rohatash/inserting-data-into-database-using-wcf-service/
and I have reached the end of it successfully:
enter image description here
however, when I press the button, data does not get put into the database; instead this message pops up:
Server Error in '/' Application.
The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ServiceModel.FaultException: The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs.
Source Error:
Line 146:
Line 147: public string InsertUserDetails(WebAppTest2.ServiceReference1.UserDetails userInfo) {
Line 148: return base.Channel.InsertUserDetails(userInfo);
Line 149: }
Line 150:
Source File: c:\users\mauro-buhagiarjl(848\documents\visual studio 2015\Projects\WebAppTest2\WebAppTest2\Service References\ServiceReference1\Reference.cs Line: 148
Stack Trace:
[FaultException: The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs.]
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +153
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +336
WebAppTest2.ServiceReference1.IService1.InsertUserDetails(UserDetails userInfo) +0
WebAppTest2.ServiceReference1.Service1Client.InsertUserDetails(UserDetails userInfo) in c:\users\mauro-buhagiarjl(848\documents\visual studio 2015\Projects\WebAppTest2\WebAppTest2\Service References\ServiceReference1\Reference.cs:148
WebAppTest2.WebFormTest.Button1_Click(Object sender, EventArgs e) in c:\users\mauro-buhagiarjl(848\documents\visual studio 2015\Projects\WebAppTest2\WebAppTest2\WebFormTest.aspx.cs:27
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9712582
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +204
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +12
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +15
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1639
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1637.0
Any Ideas to where this message originates from?
Related
i am working on a web page to upload MP4 video and getting a thumbnail from the video
i am using NReco FFMpeg Converter to achieve this . it is working fine locally but upload it on a shared hosting it crashes at ffMpeg.GetVideoThumbnail
string VideoUrl = dataMediaUrl.ImageUrl;
string extension = VideoUrl.Split('.')[VideoUrl.Split('.').Length - 1];
var ffMpeg = new NReco.VideoConverter.FFMpegConverter();
string thumbnailJPEGpath = Server.MapPath(VideoUrl.Replace("~/upload/MediaGallery/", "~/upload/MediaGallery/Thumb_").Replace("." + extension, ".jpg"));
ffMpeg.GetVideoThumbnail(Server.MapPath(VideoUrl), thumbnailJPEGpath);
dataThumbUrl.ImageUrl = VideoUrl.Replace("~/upload/MediaGallery/", "~/upload/MediaGallery/Thumb_").Replace("." + extension, ".jpg");
This is the error I am getting:
Server Error in '/' Application.
This program is blocked by group policy. For more information, contact your system administrator
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ComponentModel.Win32Exception: This program is blocked by group policy. For more information, contact your system administrator
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[Win32Exception (0x80004005): This program is blocked by group policy. For more information, contact your system administrator]
System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) +1889
System.Diagnostics.Process.Start() +119
System.Diagnostics.Process.Start(ProcessStartInfo startInfo) +49
NReco.VideoConverter.FFMpegConverter.ConvertMedia(Media input, Media output, ConvertSettings settings) +1163
NReco.VideoConverter.FFMpegConverter.GetVideoThumbnail(String inputFile, String outputFile, Nullable`1 frameTime) +155
Admin_MediaGalleryVideoUpload.InsertButton_Click(Object sender, EventArgs e) +591
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9782698
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +204
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +12
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +15
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1639
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3394.0
Your problem is that part of the code (probably inside of one of the methods you call):
System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
If it execute a process on a remote machine the user that execute it need to have the permissions to execute programs on it (not granted by default).
To help you more we need to know the source code of method where StartWithCreateProcess is called ( NReco.VideoConverter.FFMpegConverter.GetVideoThumbnail(...)).
EDIT:
Googling a bit seems that NReco is an external library, i suggest to open a ticket to their support.
I’m trying to run a sample from an Azure SDK winch communicates with the Azure MFA service. The sample compiles and runs in visual studio but once I deploy it to IIS I get the error below:
Access is denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Security.Cryptography.CryptographicException: Access is denied.
I suspect it’s related to a certificate that is needed to authenticate to the Azure service but not sure how to troubleshoot as I’m not a developer by trade. The certificate is in the same location as the ASP app and it’s referenced correctly in the code. Again, the code works through Visual Studio.
Stack Trace:
[CryptographicException: Access is denied.
]
System.Security.Cryptography.CryptographicException.ThrowCryptographicException(Int32 hr) +41
System.Security.Cryptography.X509Certificates.X509Utils._QueryCertFileType(String fileName) +0
System.Security.Cryptography.X509Certificates.X509Certificate.LoadCertificateFromFile(String fileName, Object password, X509KeyStorageFlags keyStorageFlags) +125
System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(String fileName, String password, X509KeyStorageFlags keyStorageFlags) +141
pf_auth.send_message(String target, String message, String cert_file_path, String& body) +221
pf_auth.pf_authenticate_internal(PfAuthParams pfAuthParams, Boolean asynchronous, String& otp, Int32& call_status, Int32& error_id) +744
MFADemo.example.btnTest_Click(Object sender, EventArgs e) +1602
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +11754953
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +150
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3619
I think you are better off uploading the cert to your application in Azure Management portal in the Configure tab:
And then in the code your Cert store location should be "CurrentUser" instead of "LocalMachine" for it to work in Azure...
We had multiple issues with reading certificates from file system in Azure and ended up uploading it to he Azure website and reading it from the store...
I am trying to use the Excel File Dialog window from a asp.net page. it works good from my local computer but gives the following error on the server.
System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.
[COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.]
Microsoft.Office.Interop.Excel.ApplicationClass.get_FileDialog(MsoFileDialogType fileDialogType) +0
FileMoverSetup.FileDirectorySetup.btnProcessedBrowse_Click(Object sender, EventArgs e) in c:\Users\psanders\Documents\Visual Studio 2013\Projects\FileMoverSetup\FileMoverSetup\FileDirectorySetup.aspx.cs:390
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9628722
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +103
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724
I have been working on this for days without any luck. any suggestions??
EDIT
This is what I am talking about. It works perfectly on my box but when I put it on the server it has the above error.
I received this response on a different forum.
... and it never will.
First, it only ever works on your DEV machine because everything, including the web server, is running as YOU on your desktop.
When deployed on the server, everything runs as a service without any visible desktop. So, the dialog that shows up only shows up on the web server where nobody can see it. The dialog will NEVER show up on the client machine.
Also, Excel Interop (what you're doing) can NOT be used in a web application for various reasons, like re-entrancy and multiple thread problems. It may work so long as one user at a time is using a function in the website but it will fall on its face and crash with the more users using the functions at the same time.
from Dave Kreskowiak on code project
So I am going to try and find a new method of using/creating a folder selection dialog.
I am getting this error on one website which is deployed in IIS , when i browse from network system i am getting this error .
other websites are working fine
`Server Error in '/' Application.
No such host is known
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Sockets.SocketException: No such host is known
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SocketException (0x2af9): No such host is known]
System.Net.Dns.InternalGetHostByAddress(IPAddress address, Boolean includeIPv6) +3192148
System.Net.Dns.GetHostEntry(String hostNameOrAddress) +8777246
_Default.Page_Load(Object sender, EventArgs e) +320
System.Web.UI.Control.LoadRecursive() +71
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3178`enter code here`
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18055'`
What you have here is one unhanded exception when you call the Dns.GetHostEntry as seen on the stack trace, and on the clear message that you have.
Wrap this part of the code with try/catch and log the error on your system. If its critical for you to know the dns name, then you need to show an error page with further instructions.
Yes, there are a million questions and threads on this particular error, with many well-documented solutions, which I will definitely try. But first I want to understand the problem for my particular situation/environment.
In my situation, this error seems to be entirely random. I will go weeks without seeing it, then one day I'll log into my site and get the error. Refresh the page, login again, and no problem. During these periods in between incidents, nothing particularly special has happened to the web server.
And that's the other thing, the error says "If this application is hosted by a Web Farm or cluster...", but it's not. It's just one single Windows Server 2008.
So, I understand the general solution is to add a set of static machine keys to the web.config file --- but why does this happen seemingly at random, and why does it happen to my site which is on a single Windows Server 2008 machine?
I'm using ASP.NET 4 and my site is a Web Application running on IIS.
Error Message:
Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.
Stack Trace:
[ViewStateException: Invalid viewstate.
Client IP: ##::##:##:##:##
Port: ##
Referer: http://myserver/login.aspx
Path: /login.aspx
User-Agent: Opera/9.80 (Windows NT 6.1; WOW64; U; en) Presto/2.10.289 Version/12.01
ViewState: /wEPDw...6OCX]
[HttpException (0x80004005): Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.]
System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) +235
System.Web.UI.ViewStateException.ThrowMacValidationError(Exception inner, String persistedState) +14
System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +274
System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState) +4
System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState) +37
System.Web.UI.HiddenFieldPageStatePersister.Load() +241
System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +106
System.Web.UI.Page.LoadAllState() +43
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +8431
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +253
System.Web.UI.Page.ProcessRequest() +78
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.login_aspx.ProcessRequest(HttpContext context) +4
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
From your log, I suggest you to check one thing - Did you connect any parameter from your user with the Viewstate that can be changed if the user is logged in/logged out? - or change for any other reason, e.g. because session is expired or changed.
This parameter can be different between the saved and the current Viewstate and this can break the page.
For example this code can do that:
ViewStateUserKey = CurrentUserCookie;
Or this one as it is:
ViewStateUserKey = User.Identity.Name
Also read this answer: https://stackoverflow.com/a/2551810/159270
This is similar:
ViewStateUserKey + shared hosting + ViewStateMac validation failure
And Some reference:
http://www.hanselman.com/blog/ViewStateUserKeyMakesViewStateMoreTamperresistant.aspx
http://msdn.microsoft.com/en-us/library/ms972969.aspx
The random errors are the nightmare of any developer.