-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System.ArgumentNullException with .NET 4.5.2 WebApi #174
Comments
@youngki924 Can I get a little more info? What type of project and what target framework version? Thanks. |
@phantomtypist packages.config package id="Microsoft.AspNet.Mvc" version="5.1.2" targetFramework="net452" I tried FileSystemRazorViewEngine and it worked but that is not what I can use for actual implementation. Instead of email.Send(), I tried EmailService and customized EmailViewRenderer to set HttpContextWrapper and got the different exception. FindView looks had a problem. Before Exception Thanks |
Dumb question, but I want to cover the bases.... this exception occurs on both your machine and the actual server the application is deployed to OR does the exception only occur on the server? |
I'll just throw this out there too. In the folder that I keep the views I had to create a web.config with the following content:
This was in an MVC 5 project targeting .NET Framework 4.5. |
And another "double-checking" question: Did you try to scaffold a completely blank MVC 5 project with Postal and your Razor view and try to send the email? You know, just for sanity sake? I'm somewhat wondering if there is a dependency/reference issue. |
With regards to the NuGet packages you have installed... is there anything prohibiting you from upgrading to the newer/latest minor and patch versions of the following packages?:
|
@phantomtypist I am developing Web api and got an error after configuration change to App.conf. pageBaseType was added because it was required:
Error: Could not process request: http://localhostxxxx. Exception has been thrown by the target of an invocation. I did not try pure MVC5 yet. Thanks. |
It seems like you encountered an exception related to the HttpBrowserCapabilitiesWrapper in the provided code. This might be caused by the context in which you're trying to create the email object. The stack trace suggests an issue with the HttpContextBase and HttpBrowserCapabilities. Double-check that you're using the correct context and that all Postal Codes required dependencies are properly set up. It's also beneficial to ensure compatibility with the version of .NET and libraries you are using. Debugging step by step and verifying the inputs could help pinpoint the exact cause of this exception. |
Encountering a System.ArgumentNullException in .NET 4.5.2 en vivo WebApp. Any guidance on resolving this issue would be greatly appreciated! |
Followed the instruction from
http://hangfire.readthedocs.io/en/latest/tutorials/send-email.html
Got an exception:
{
"ClassName": "System.ArgumentNullException",
"Message": "Value cannot be null.",
"Data": null,
"InnerException": null,
"HelpURL": null,
"StackTraceString": " at System.Web.HttpBrowserCapabilitiesWrapper..ctor(HttpBrowserCapabilities httpBrowserCapabilities)\r\n at System.Web.HttpRequestWrapper.get_Browser()\r\n at System.Web.WebPages.BrowserHelpers.GetOverriddenBrowser(HttpContextBase httpContext, Func
2 createBrowser)\r\n at System.Web.WebPages.DisplayModeProvider.<.ctor>b__2(HttpContextBase context)\r\n at System.Web.WebPages.DefaultDisplayMode.CanHandleContext(HttpContextBase httpContext)\r\n at System.Web.WebPages.DisplayModeProvider.<GetAvailableDisplayModesForContext>d__4.MoveNext()\r\n at System.Web.Mvc.VirtualPathProviderViewEngine.GetPath(ControllerContext controllerContext, String[] locations, String[] areaLocations, String locationsPropertyName, String name, String controllerName, String cacheKeyPrefix, Boolean useCache, String[]& searchedLocations)\r\n at System.Web.Mvc.VirtualPathProviderViewEngine.FindView(ControllerContext controllerContext, String viewName, String masterName, Boolean useCache)\r\n at System.Web.Mvc.ViewEngineCollection.<>c__DisplayClass6.<FindView>b__4(IViewEngine e)\r\n at System.Web.Mvc.ViewEngineCollection.Find(Func
2 lookup, Boolean trackSearchedPaths)\r\n at System.Web.Mvc.ViewEngineCollection.FindView(ControllerContext controllerContext, String viewName, String masterName)\r\n at Postal.EmailViewRenderer.CreateView(String viewName, ControllerContext controllerContext)\r\n at Postal.EmailViewRenderer.Render(Email email, String viewName)\r\n at Postal.EmailService.Send(Email email)\r\n at Postal.Email.Send()\r\n at MyTestApp.Controllers.EmailController.SendPostal(MyMailModel objModelMail)","RemoteStackTraceString": null,
"RemoteStackIndex": 0,
"ExceptionMethod": "1\n.ctor\nSystem.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\nSystem.Web.HttpBrowserCapabilitiesWrapper\nVoid .ctor(System.Web.HttpBrowserCapabilities)",
"HResult": -2147467261,
"Source": "System.Web",
"WatsonBuckets": null,
"ParamName": "httpBrowserCapabilities"
}
The text was updated successfully, but these errors were encountered: