Upgraded project to Visual Studio 2010, but now get MVC error - asp.net

I have an asp.net mvc 1.0 project. I upgraded the project and solution to Visual Studio 2010. However, I do not want to use asp.net mvc 2.0. My app compiles under mvc 1.0. All my references are to 1.0. I have copy local true and i am referencing mvc 1.0 from a lib folder, not the GAC.
However I keep getting this error:
No parameterless constructor defined for this object.
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.MissingMethodException: No parameterless constructor defined for this object.
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:
[MissingMethodException: No parameterless constructor defined for this object.]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +86
System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +230
System.Activator.CreateInstance(Type type, Boolean nonPublic) +67
System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(Type controllerType) +82
[InvalidOperationException: An error occurred while creating a controller of type 'PartingOut.Web.Controllers.HomeController'. If the controller doesn't have a controller factory, ensure that it has a parameterless public constructor.]
System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(Type controllerType) +189
System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) +74
System.Web.Mvc.MvcHandler.ProcessRequest(HttpContextBase httpContext) +128
System.Web.Mvc.MvcHandler.ProcessRequest(HttpContext httpContext) +57
System.Web.Mvc.MvcHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext httpContext) +7
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
Its like it wants to keep using asp.net mvc 2.0, because its complaining about that GetControllerInstance method.
This project works fine in vs 2008. wahhh! :(
Anyone? Anyone?
Thanks in advance.

I'm just trying to cover all the bases here, so forgive me if this is an obvious answer, but: Does PartingOut.Web.Controllers.HomeController actually have a parameterless constructor?

I figured it out.
Nothing to do with asp.net mvc 2 or vs 2010. It was still referencing asp.net mvc 1.0 fine. One of the other developers had done the upgrade and took out the "overrides" keyword in the method:
IController GetControllerInstance(Type controllerType)
on our own custom ControllerFactory.
Meh.

Related

IIS 10 The resource class for this page was not found. Please check if the resource file exists and try again

Getting this error randomly on server here is the iis details.
IIS version= 10.0.14393.0
Windows server 2016
System.Web.Management.WebRequestErrorEvent, System.InvalidOperationException, An unhandled exception has occurred.The resource class for this page was not found. Please check if the resource file exists and try again.
Stack trace: at System.Web.Compilation.LocalResXResourceProvider.CreateResourceManager()
at System.Web.Compilation.BaseResXResourceProvider.EnsureResourceManager()
at System.Web.Compilation.BaseResXResourceProvider.GetObject(String resourceKey, CultureInfo culture)
at System.Web.Compilation.ResourceExpressionBuilder.GetResourceObject(IResourceProvider resourceProvider, String resourceKey, CultureInfo culture, Type objType, String propName)
at ASP.usercontrols_uc_adduser_ascx.__BuildControlImage1()
at ASP.usercontrols_uc_adduser_ascx.__BuildControlcontractorUC_RadAjaxLoadingPanel1()
at ASP.usercontrols_uc_adduser_ascx.__BuildControlTree(secure_usercontrols_uc_adduser_ascx __ctrl)
at ASP.testpage_aspx.__BuildControlAddQuickContractor1()
at ASP.testpage_aspx.__BuildControlfrmMain()
at ASP.testpage_aspx.__BuildControlTree(secure_bidmain_aspx __ctrl)
at ASP.testpage_aspx.FrameworkInitialize()
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
This error is coming randomly, but after recycling the app pool fixes it. Can some help with this.
I doubt if the case relates to the Network/Route issue. For example, some requests are discarded by the application gateway, which may be caused by the wrong NAT tables configured in the public firewall or router. You could verify this by accessing the website with a local IP.
please check the below issue.
https://serverfault.com/questions/845606/iis-randomly-returning-inet-e-resource-not-found

Strange error with EXT.NET in ASP.NET MVC application

I got the exception in my ASP NET MVC APPLICATION developed with ext.net in c#.
Server Error in '/' Application.
________________________________
ItemTag validation (_tkn_7): Reference token (id22be3fe15600a888_ClientInit) was not found.
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.Exception: ItemTag validation (_tkn_7): Reference token (id22be3fe15600a888_ClientInit) was not found.
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:
[Exception: ItemTag validation (_tkn_7): Reference token (id22be3fe15600a888_ClientInit) was not found.]
Transformer.NET.ItemTag.Validate() +209
Transformer.NET.TextTransformer.Handle() +298
Transformer.NET.TextTransformer.Transform(List`1 tokensType, Dictionary`2 variables) +32
Ext.Net.ExtNetTransformer.Transform(String text) +554
Ext.Net.InitScriptFilter.Flush() +145
System.Web.HttpWriter.FilterIntegrated(Boolean finalFiltering, IIS7WorkerRequest wr) +603
System.Web.HttpResponse.FilterOutput() +121
System.Web.CallFilterExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +119
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +165

security exception in using routing in asp.net after doployment

i'm using routing in asp.net ,in local host every thing good , but after deployment , when browsing menu get below exception
Security Exception
Description: The application attempted to perform an operation not
allowed by the security policy. To grant this
application the required
permission please contact your system administrator or
change the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException:
Request for the permission of type 'System.Security.Permissions.
SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' failed.
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:
[SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Web.Security.UrlAuthorizationModule.CheckUrlAccessForPrincipal(String virtualPath, IPrincipal user, String verb) +42
Microsoft.AspNet.FriendlyUrls.Abstractions.UrlAuthorizationModuleWrapper.CheckUrlAccessForPrincipal(String virtualPath, IPrincipal user, String verb) +14
Microsoft.AspNet.FriendlyUrls.FriendlyUrlRoute.GetWebObjectFactory(HttpContextBase httpContext, String modifiedVirtualPath) +159
Microsoft.AspNet.FriendlyUrls.FriendlyUrlRoute.Resolve(HttpContextBase httpContext, IList1 extensions, String virtualPathOverride, IFriendlyUrlRouteSupportFunctions supportFunctions) +220
Microsoft.AspNet.FriendlyUrls.FriendlyUrlRoute.Microsoft.AspNet.FriendlyUrls.Abstractions.IFriendlyUrlRouteSupportFunctions.Resolve(HttpContextBase httpContext, IList1 extensions, String virtualPathOverride) +16
Microsoft.AspNet.FriendlyUrls.FriendlyUrlRoute.GetRouteData(HttpContextBase httpContext, String pathOverride, IFriendlyUrlRouteSupportFunctions supportFunctions) +140
Microsoft.AspNet.FriendlyUrls.FriendlyUrlRoute.GetRouteData(HttpContextBase httpContext) +8
System.Web.Routing.RouteCollection.GetRouteData(HttpContextBase httpContext) +233
System.Web.Routing.UrlRoutingModule.PostResolveRequestCache(HttpContextBase context) +60
System.Web.Routing.UrlRoutingModule.OnApplicationPostResolveRequestCache(Object sender, EventArgs e) +82
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69
any advice
This indicates, that your application is not running with Full trust on your IIS, or the trust level is not high enough.
Please follow the following checklist:
Open up IIS
Click on your website on the left panel
Double click on .NET Trust Level in the right panels.
Set the Trust Level to Full (internal)

Asp net System.Web.CachedPathData.GetPhysicalPath(VirtualPath virtualPath) Exception

I have this error in my website. it occurs not to specific page but to all.
at System.Web.CachedPathData.GetPhysicalPath(VirtualPath virtualPath)
at System.Web.CachedPathData.GetConfigPathData(String configPath)
at System.Web.CachedPathData.GetConfigPathData(String configPath)
at System.Web.CachedPathData.GetConfigPathData(String configPath)
at System.Web.CachedPathData.GetVirtualPathData(VirtualPath virtualPath, Boolean permitPathsOutsideApp) at System.Web.HttpContext.GetFilePathData()
at System.Web.HttpContext.GetConfigurationPathData()
at System.Web.HttpContext.GetSection(String sectionName)
at System.Web.Configuration.HttpConfigurationSystem.GetSection(String sectionName)
at system.Web.Configuration.HttpConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String configKey)
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at System.Configuration.PrivilegedConfigurationManager.GetSection(String sectionName)
at System.Net.Configuration.SettingsSectionInternal.get_Section()
at System.Net.WebUtility..cctor()System The type initializer for 'System.Net.WebUtility' threw an exception.
I have no idea what is it, and how to handle it.
Thanks,
The problem is described in: kb 2848799
to fix it you need to contact microsoft for a hotfix. The short term solution is to recycle the application domain.
ASP.NET issue 1
In some cases, the first call to HttpUtility in a web
application may cause incorrect type initialization. This leads to
later failures when you use HttpUtility methods. When you experience
this issue, you have to recycle the application domain to resolve the
issue. Additionally, you find the following message in the System log:
Getting Error Message for Exception System.Web.HttpUnhandledException
(0x80004005): Exception of type 'System.Web.HttpUnhandledException'
was thrown. ---> System.TypeInitializationException: The type
initializer for 'System.Net.WebUtility' threw an exception. --->
System.Web.HttpException at
System.Web.CachedPathData.GetPhysicalPath(VirtualPath virtualPath) at
System.Web.CachedPathData.GetConfigPathData(String configPath) at
System.Web.CachedPathData.GetConfigPathData(String configPath)
In some cases, the first call to HttpUtility in a web application may cause incorrect type initialization. This leads to later failures when you use HttpUtility methods. When you experience this issue, you have to recycle the application domain to resolve the issue. Additionally, you find the following message in the System log

server error in '/Services_DEV' application

I was getting the below error as I was unable to find the correct solution...Actually I found some solutions, and I tried them but none in the solutions helped me to resolve the below error.
Server Error in '/Services_DEV' Application.
Retrieving the COM class factory for component with CLSID {9F8D4F16-0F61-4A38-98B3-1F6F80F11C87} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
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.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {9F8D4F16-0F61-4A38-98B3-1F6F80F11C87} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6 and IIS 7, and the configured application pool identity on IIS 7.5) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
Source Error:
[No relevant source lines]
Source File: c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\rhenusservices_dev\19c0008c\aab4c325\App_Web_default.aspx.cdcab7d2.csyixg6l.0.cs Line: 0
Stack Trace:
[UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {9F8D4F16-0F61-4A38-98B3-1F6F80F11C87} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).]
_Default..ctor() +141
ASP.default_aspx..ctor() in c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\rhenusservices_dev\19c0008c\aab4c325\App_Web_default.aspx.cdcab7d2.csyixg6l.0.cs:0
__ASP.FastObjectFactory_app_web_default_aspx_cdcab7d2_csyixg6l.Create_ASP_default_aspx() in c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\rhenusservices_dev\19c0008c\aab4c325\App_Web_default.aspx.cdcab7d2.csyixg6l.1.cs:0
System.Web.Compilation.BuildResultCompiledType.CreateInstance() +32
System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) +109
System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +31
System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +40
System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +167
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +128
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1016

Resources