Getting server error 503 from server after multiple refreshes - c#

I have setup a subdomain via wildcard in my asp.net application. The subdomain routing works perfect, but for some reason if I refresh the page two times quickly I keep getting this error:
The remote server returned an error: (503) Server Unavailable.
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.WebException: The remote server returned an error: (503) Server Unavailable.
Stacktrace:
[WebException: The remote server returned an error: (503) Server Unavailable.]
System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request) +365
System.Net.WebClient.DownloadString(Uri address) +111
WebApplication3.Controllers.OtherController.Dynamic(String someValue, String Id) +2168
lambda_method(Closure , ControllerBase , Object[] ) +191
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +229
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +35
System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +39
System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +77
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +69
System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() +72
System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +387
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +42
System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +38
System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +188
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +38
System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +29
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +73
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +52
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +39
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38
System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +43
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +73
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +602
System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +195
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +128
The subdomain route is setup like this:
routes.MapSubDomainRoute("OtherRoute",
"{someValue}", // SubDomain
"{action}/{id}", // URL with parameters
new { controller = "Other", action = "Index", id = UrlParameter.Optional }, // Parameter defaults
new { someValue = new SubDomainConstraint() } // constraint so we only deal the subdomains we want
);
what could be the reason behind this issue ? Can someone help me out?
And the subdomain that I'm trying to access is:
http://subdomain.example.com/routeIdParameter

api cannot reach the installed servera

Related

Index was outside the bounds of the array in asp.net mvc connected with oracle database

I am facing an strange issue in asp.net mvc website that is connected with oracle database and deployed on IIS. When I am adding a new field in oracle database table (without changing anything in existing table structure), asp.net website running on IIS throwing exception in the method that is retrieving data from that table.
I am simply adding a new field in oracle database table using Oracle SQL Developer. I can understand that table schema is getting changed in this way, but not able to understand how does its effecting on existing sql query results.
I tried to do same-thing in SQL Server database, but it works perfectly fine.
Below is the code that is displaying data from oracle database. Getting exception at line having code "sda.Fill(dt);"
using Oracle.ManagedDataAccess.Client;
OracleConnection Ocon = null;
string oradb = System.Configuration.ConfigurationManager.ConnectionStrings["OracleDBConnStr"].ConnectionString;
Ocon = new Oracle.ManagedDataAccess.Client.OracleConnection(oradb);
string str = "select * from TABLE_NAME where TRIM(STATUS)!=1 and TRIM(STATUS)!=2";
OracleDataAdapter sda = new OracleDataAdapter(str, Ocon);
DataTable dt = new DataTable();
sda.Fill(dt);
Server Error in '/' Application.
Index was outside the bounds of the array.
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.<br>
Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.<br>
Source Error: <br>
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.<br>
Stack Trace: <br>
[IndexOutOfRangeException: Index was outside the bounds of the array.]
Oracle.ManagedDataAccess.Client.OracleDataReader.GetMinSchemaTable() +3066
Oracle.ManagedDataAccess.Client.OracleDataReader.set_IsFillReader(Boolean value) +102
Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) +376
System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) +141
TradingAutomationUI.Controllers.OtherAccountTransactionController.getbankTransectionCustom(String Query, String searchPerm) +255
TradingAutomationUI.Controllers.OtherAccountTransactionController.CustomEntriesView(Nullable`1 id) +347
lambda_method(Closure , ControllerBase , Object[] ) +145
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +229
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +35
System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +39
System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +77
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +42
System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +72
System.Web.Mvc.Async.<>c__DisplayClass48.<InvokeActionMethodFilterAsynchronouslyRecursive>b__41() +387
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +42
System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +38
System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +188
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +38
System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +29
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +73
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +52
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +39
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38
System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +43
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +73
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +602
System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +195
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +128<br>
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3282.0

Asp.Net Mvc Web App PowerBI Login HRESULT E_FAIL Error

I am trying to have a single sign-in web app through azure that has an initial Microsoft login and then no second login. At the moment I am just trying to get 2 logins to work but when running locally I can get the app to work and show the Power BI reports using a dual login. But whenever I publish the app up to the Azure host and I try to access the power BI page instead of having a Microsoft popup to log in it just suffers from this error.
[COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.]
Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext.RunAsyncTask(Task`1 task) +89
MultiTenantWebApp.Controllers.PowerBiController.Autenticate() in C:\Users\G4Fro\Source\Repos\Intern\MultiTenantWebApp\MultiTenantWebApp\Controllers\PowerBiController.cs:165
MultiTenantWebApp.Controllers.PowerBiController.MakeGroupDictionary() in C:\Users\G4Fro\Source\Repos\Intern\MultiTenantWebApp\MultiTenantWebApp\Controllers\PowerBiController.cs:64
MultiTenantWebApp.Controllers.PowerBiController.EmbedReport() in C:\Users\G4Fro\Source\Repos\Intern\MultiTenantWebApp\MultiTenantWebApp\Controllers\PowerBiController.cs:32
lambda_method(Closure , ControllerBase , Object[] ) +62
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +169
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +22
System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +29
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +32
System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() +50
System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +228
System.Web.Mvc.Async.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult) +10
System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +10
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +34
System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +26
System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +100
System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +10
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +27
System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +13
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +29
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +36
System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult asyncResult, Controller controller) +12
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +22
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +26
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +21
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +29
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +28
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +577
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +157
Any help would be greatly appreciated as I have no idea why it works offline but not online and I don't know how to understand the stack trace
This is the Authentication code
private void Authenticate()
{
string clientID = ""; // We have our client ID here that was created in power BI dev apps
string redirectUri = "https://localhost:44367/";
string resourceUri = "https://analysis.windows.net/powerbi/api";
string authorityUri = "https://login.windows.net/common/oauth2/authorize";
if (token == null)
{
AuthenticationContext authContext = new AuthenticationContext(authorityUri);
token = authContext.AcquireToken(resourceUri, clientID, new Uri(redirectUri)).AccessToken;
}
else
{
return;
}
}
HRESULT E_FAIL has been returned from a call to a COM component.
have no idea why it works offline but not online and I don't know how to understand the stack trace
According to the exception, it seems that you application try to access to out-of-process COM in the WebApp, but it is restricted in the Web App sandbox.
If it is restricted in the WebApp and Cloudservice is possible, please have try to use Cloudservice. About how to Migrate and Publish a Web Application to an Azure Cloud Service from Visual Studio, we could refer to this document.
I am getting this error at the moment and I am pretty sure it has to do with the fact that my azure app does not have the "Access the directory as the signed-in user" permission, since I am accessing Power BI as a master user as in the" App owns data" scenario.
Notes:
I only get this error when I unwind the aggregate exception. Otherwise the error message is "One or more errors occurred." Here is a good link on that: Flattening of Aggregate Exceptions
It looks like I have the permission, and that I have the rights to grant it, but when I click on the Grant permissions icon I get an error message saying I cannot grant that permission myself.
In fact the Azure documentation is clear here that you can grant that permission yourself only for Application Type:Native App, not Web app/API which is what I have here (so the UI has a display bug). Here is a link to it:Permission Scope Docs
I am still trying to figure out who my "Admin" is so that I can get this permission, so I am not yet sure that this is the whole issue. Will update.

Rotativa [Win32Exception (0x80004005): Access is denied]

I am using Rotativa to generate Views as PDF and it runs/works perfectly on my localhost. However when deployed to either a shared host on GoDaddy or my Azure website instance I get the following error.
I attempted to grant permissions on .exe in the Rotativa folder with no luck, also tried running with Full Trust and still getting the error.
ERROR / STACKTRACE
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.ComponentModel.Win32Exception: Access is
denied
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): Access is denied]
System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo
startInfo) +1789 System.Diagnostics.Process.Start() +6735098
Rotativa.WkhtmltopdfDriver.Convert(String wkhtmltopdfPath, String
switches, String html) +226
Rotativa.AsPdfResultBase.CallTheDriver(ControllerContext context) +26
Rotativa.AsPdfResultBase.BuildPdf(ControllerContext context) +128
Rotativa.AsPdfResultBase.ExecuteResult(ControllerContext context) +19
System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext
controllerContext, ActionResult actionResult) +13
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList1
filters, Int32 filterIndex, ResultExecutingContext preContext,
ControllerContext controllerContext, ActionResult actionResult) +56
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList1
filters, Int32 filterIndex, ResultExecutingContext preContext,
ControllerContext controllerContext, ActionResult actionResult) +420
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext
controllerContext, IList1 filters, ActionResult actionResult) +52
System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c()
+173 System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult
asyncResult) +100
System.Web.Mvc.Async.WrappedAsyncResult1.CallEndDelegate(IAsyncResult
asyncResult) +10
System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +49
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult
asyncResult) +27
System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult
asyncResult, ExecuteCoreState innerState) +13
System.Web.Mvc.Async.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult
asyncResult) +36
System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +54
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +39
System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult
asyncResult, Controller controller) +12
System.Web.Mvc.Async.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult
asyncResult) +28
System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +54
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +29
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult
asyncResult) +10
System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult
asyncResult, ProcessRequestState innerState) +21
System.Web.Mvc.Async.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult
asyncResult) +36
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +54
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
+31 System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult
result) +9
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
+9514928 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
CONTROLLER
public ActionResult Print(Guid reportId)
{
var report = new ViewAsPdf("Index", new { id = reportId}) { FileName = "testReport.pdf" };
return report;
}
PERMISSIONS
I tried to set permissions on the entire folder "Rotativa" with full control and now I get this...
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) +1789 System.Diagnostics.Process.Start() +6735098
Rotativa.WkhtmltopdfDriver.Convert(String wkhtmltopdfPath, String
switches, String html) +226
Rotativa.AsPdfResultBase.CallTheDriver(ControllerContext context) +26
Rotativa.AsPdfResultBase.BuildPdf(ControllerContext context) +128
Rotativa.AsPdfResultBase.ExecuteResult(ControllerContext context) +19
System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext
controllerContext, ActionResult actionResult) +13
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList1
filters, Int32 filterIndex, ResultExecutingContext preContext,
ControllerContext controllerContext, ActionResult actionResult) +56
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList1
filters, Int32 filterIndex, ResultExecutingContext preContext,
ControllerContext controllerContext, ActionResult actionResult) +420
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext
controllerContext, IList1 filters, ActionResult actionResult) +52
System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c()
+173 System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult
asyncResult) +100
System.Web.Mvc.Async.WrappedAsyncResult1.CallEndDelegate(IAsyncResult
asyncResult) +10
System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +49
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult
asyncResult) +27
System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult
asyncResult, ExecuteCoreState innerState) +13
System.Web.Mvc.Async.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult
asyncResult) +36
System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +54
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +39
System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult
asyncResult, Controller controller) +12
System.Web.Mvc.Async.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult
asyncResult) +28
System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +54
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +29
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult
asyncResult) +10
System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult
asyncResult, ProcessRequestState innerState) +21
System.Web.Mvc.Async.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult
asyncResult) +36
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +54
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
+31 System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult
result) +9
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
+9514928 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
UPDATE JAN 13/2015
I ended up switching to TuesPechkin which has been a far easier solution to work with. GoDaddy does support FullTrust as does Azure, however Azure has a known issue with running processes that call into the GDI which most wkhtmltopdf libraries do. TuesPechkin didn't work on Azure either so I never found a solution for an Azure website, but TuesPechkin worked perfect on GoDaddy hosting with the set in my web.config.
I think both GoDaddy and azure websites don't allow for "Full trust" IIS hosting mode, and that's required in order to run the wkhtmltopdf process.
You should look for a hosting provider that gives full trust access if you want to use Rotativa.
For me I fixed the problem by allowing access to "Everyone" with full permission on the security pane of the file wkhtmltopdf.exe
I hope this helped someone if using a local testing machine or a virtual machine.
Note that you should also give the same allow permission to folder that will save the pdf output.

Cant find image in network drive

I know this question have been asking many times but none of then have solved my situation.
I have this simple code
Image f = Image.FromFile(#"\\NetWork\imagenes\folder0\1690D-PC.tif");
But it throws:
System.IO.FileNotFoundException \\NetWork\imagenes\folder0\1690D-PC.tif
I have total access to the related network
I do can find the image in that location. I copy the path, START + r, pasted the path and the image opens.
Is the same for all images in that server.
But the situation not only remains there:
I tested in another pc to checked if is was a IIS problem or
whatever, but when I tested it throws the same(2 pc cannot access to
that file, having they full access... weird...)
When im in development, I can find the image everything work normaly, but when i deploy and
upload to my local iis and the other pc, throw the related exception(FileNotFoundException).
My parner has the same code(almost the same proyect, just with some
diferrent functionality and public) and he can find the image and
display it.
I ran into this situation last friday and i havent came up with a solution yet.
Im willing to hear all your suggestions.
Update 2.
More info:
There are 2 more application that request images from that server and those application can find it normally. Those application are in my local IIS.
Updte
Tracktrace
[FileNotFoundException: \\DAVID-PC\imagenes\folder0\1690D-PC.tif]
System.Drawing.Image.FromFile(String filename, Boolean useEmbeddedColorManagement) +472351
System.Drawing.Image.FromFile(String filename) +6
Muckup.Controllers.HomeController.Index() in C:\Users\pkm\Documents\Visual Studio 2010\Projects\Muckup\Muckup\Controllers\HomeController.cs:20
lambda_method(Closure , ControllerBase , Object[] ) +62
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +211
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
System.Web.Mvc.Async.<>c__DisplayClass42.<BeginInvokeSynchronousActionMethod>b__41() +28
System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +10
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +57
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +48
System.Web.Mvc.Async.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33() +57
System.Web.Mvc.Async.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() +223
System.Web.Mvc.Async.<>c__DisplayClass37.<BeginInvokeActionMethodWithFilters>b__36(IAsyncResult asyncResult) +10
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +57
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +48
System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +24
System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +102
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +57
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +43
System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +14
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +57
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +47
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +25
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +47
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9514812
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
Have you tried using double back slashes instead of # to find the file? Might be worth trying.
Image f = Image.FromFile(" *FullPath* \\NetWork\\imagenes\\folder0\\1690D-PC.tif");

MVC4 OAuth HasLocalAccount method throws InvalidOperationException

I have a MVC4 Application that spends debug process locally without enabling Register External site clients (like twitter , etc...) yet. And I'm Using custom membership user and role providers. But unfortunately when I browse the 'Manage' Page get this error:
Operation is not valid due to the current state of the object.
And the stack trace :
[InvalidOperationException: Operation is not valid due to the current state of the object.]
Microsoft.Web.WebPages.OAuth.OAuthWebSecurity.VerifyProvider() +91
Microsoft.Web.WebPages.OAuth.OAuthWebSecurity.HasLocalAccount(Int32 userId) +41
Melk.Controllers.AccountController.Manage(Nullable1 message) in C:\Users\AmirMehr\documents\visual studio 2010\Projects\Melk\Melk\Controllers\AccountController.cs:141
lambda_method(Closure , ControllerBase , Object[] ) +153
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary2 parameters) +211
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary2 parameters) +27
System.Web.Mvc.Async.<>c__DisplayClass42.<BeginInvokeSynchronousActionMethod>b__41() +28
System.Web.Mvc.Async.<>c__DisplayClass81.b__7(IAsyncResult ) +10
System.Web.Mvc.Async.WrappedAsyncResult1.End() +57
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +48
System.Web.Mvc.Async.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33() +57
System.Web.Mvc.Async.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() +223
System.Web.Mvc.Async.<>c__DisplayClass37.<BeginInvokeActionMethodWithFilters>b__36(IAsyncResult asyncResult) +10
System.Web.Mvc.Async.WrappedAsyncResult1.End() +57
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +48
System.Web.Mvc.Async.<>c_DisplayClass2a.b_20() +24
System.Web.Mvc.Async.<>c_DisplayClass25.b_22(IAsyncResult asyncResult) +102
System.Web.Mvc.Async.WrappedAsyncResult1.End() +57
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +43
System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +14
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
System.Web.Mvc.Async.WrappedAsyncResult1.End() +62
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +57
System.Web.Mvc.Async.<>c_DisplayClass4.b__3(IAsyncResult ar) +23
System.Web.Mvc.Async.WrappedAsyncResult1.End() +62
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +47
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +25
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
System.Web.Mvc.Async.WrappedAsyncResult1.End() +62
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +47
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9629708
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
Please help to be aware. Thanks.
VerifyProvider will throw if you are using the SimpleMembershipProvider and it is not yet initialized, or if the provider does not inherit from ExtendedMembershipProvider.
If you are using WebSecurity out of the box, you need to make sure WebSecurity.InitializeDatabaseConnection is called first.
If you are using custom providers, make sure they are inheriting from ExtendedMembershipProvider (or SimpleMembershipProvider), otherwise you cannot use this function.

Categories

Resources