Spring.net description of application in Mvc4.0

Source: Internet
Author: User
Tags stack trace

Case DEMO:HTTP://YUNPAN.CN/CJ5AZRM7UYBI3 access Password 414b

Spring.net description of application in Mvc4.0

1. Referencing DLLs

2. Modify the global file (springmvcapplication)

3. Controller Add properties

4.WebConfig Configuration

<!--must follow the configuration--

<configSections>

<sectiongroup name= "Spring" >

<section name= "Context" type= "Spring.Context.Support.MvcContextHandler, Spring.Web.Mvc4"/>

</sectionGroup>

</configSections>

<!--spring.net node detailed configuration--

<spring>

<context>

<!--configuration file under the Config folder in the root directory of the Web site Spring.xml Remember to set the XML file to always copy to the output directory--

<resource uri= "File://~/Config/Spring.xml"/>

</context>

</spring>

<!--spring.net node detailed configuration End--

5.spring.xml Configuration ( remember right-click Property settings spring.xml always copy to input directory )

<objects xmlns= "Http://www.springframework.net" >

<!--all of the nodes inside the container Type property specification: The name of the assembly, including the full type, assembly name--

<object type= "Spring.net.mvcdemo.controllers.userinfocontroller,spring.net.mvcdemo" singleton= "false" >

<!--inject Userreginfoservice object to Userinfocontroller--

<property name= "Userreginfoservice" ref= "Userreginfoservice"/>

</object>

<!--configuration service-->

<object name= "Userreginfoservice" type= "Spring.Net.MVCDemo.Service.UserRegInfoService, Spring.Net.MVCDemo.Service "singleton=" false ">

</object>

</objects>

6. Note This exception information

Could not load type from string value ' Spring.net.mvcdemo.service.userreginfoservice,spring.net.mvcdemo.service '.

Description : An unhandled exception occurred during the execution of the current WEB request. Check the stack trace information For more information about the error and the source of the error in your code.

Exception Details System.TypeLoadException:Could not loadtype from string value ' Spring.Net.MVCDemo.Service.UserRegInfoService, Spring.Net.MVCDemo.Service '.

Source Error :

An unhandled exception was generated during the execution of the current WEB request. You can use the following exception stack trace information to determine information about the cause of the exception and where it occurred.


Stack Trace :

[Typeloadexception:could not load type from string value ' Spring.Net.MVCDemo.Service.UserRegInfoService, Spring.Net.MVCDemo.Service '.]

Spring.Core.TypeResolution.TypeResolver.Resolve (String typeName) in f:\bamboo-home\xml-data\build-dir\ sprnet-release-job1\src\spring\spring.core\core\typeresolution\typeresolver.cs:81

Spring.Core.TypeResolution.GenericTypeResolver.Resolve (String typeName) in f:\bamboo-home\xml-data\build-dir\ sprnet-release-job1\src\spring\spring.core\core\typeresolution\generictyperesolver.cs:91

Spring.Core.TypeResolution.CachedTypeResolver.Resolve (String typeName) in f:\bamboo-home\xml-data\build-dir\ sprnet-release-job1\src\spring\spring.core\core\typeresolution\cachedtyperesolver.cs:107

Spring.Core.TypeResolution.TypeResolutionUtils.ResolveType (String typeName) in f:\bamboo-home\xml-data\build-dir\ Sprnet-release-job1\src\spring\spring.core\core\typeresolution\typeresolutionutils.cs:101

Spring.Objects.Factory.Support.AbstractObjectDefinition.ResolveObjectType () in F:\bamboo-home\xml-data\build-dir \sprnet-release-job1\src\spring\spring.core\objects\factory\support\abstractobjectdefinition.cs:639

Spring.Objects.Factory.Support.AbstractObjectFactory.ResolveObjectType (rootobjectdefinition Rod, String ObjectName) in F:\bamboo-home\xml-data\build-dir\SPRNET-RELEASE-JOB1\src\Spring\Spring.Core\Objects\Factory\ Support\abstractobjectfactory.cs:1123

[Cannotloadobjecttypeexception:cannot Resolve Type [Spring.Net.MVCDemo.Service.UserRegInfoService, Spring.Net.MVCDemo.Service] For object with the name ' Userreginfoservice ' defined in file [C:\Users\DNT\Desktop\ Spring.net.mvcdemo\spring.net.mvcdemo\spring.net.mvcdemo\config\spring.xml] Line 19]

Spring.Objects.Factory.Support.AbstractObjectFactory.ResolveObjectType (rootobjectdefinition Rod, String ObjectName) in F:\bamboo-home\xml-data\build-dir\SPRNET-RELEASE-JOB1\src\Spring\Spring.Core\Objects\Factory\ support\abstractobjectfactory.cs:1127

Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.PredictObjectType (String ObjectName, Rootobjectdefinition MoD) in f:\bamboo-home\xml-data\build-dir\SPRNET-RELEASE-JOB1\src\Spring\Spring.Core\Objects \factory\support\abstractautowirecapableobjectfactory.cs:160

Spring.Objects.Factory.Support.DefaultListableObjectFactory.IsFactoryObject (String ObjectName, Rootobjectdefinition rod) in F:\bamboo-home\xml-data\build-dir\SPRNET-RELEASE-JOB1\src\Spring\Spring.Core\Objects \factory\support\defaultlistableobjectfactory.cs:1079

Spring.Objects.Factory.Support.DefaultListableObjectFactory.DoGetObjectNamesForType (type type, Boolean Includenonsingletons, Boolean alloweagerinit) in f:\bamboo-home\xml-data\build-dir\SPRNET-RELEASE-JOB1\src\Spring\ spring.core\objects\factory\support\defaultlistableobjectfactory.cs:1011

Spring.Objects.Factory.Support.DefaultListableObjectFactory.DoGetObjectsOfType (type type, Boolean Includeprototypes, Boolean includefactoryobjects, IDictionary resultcollector) in f:\bamboo-home\xml-data\build-dir\ sprnet-release-job1\src\spring\spring.core\objects\factory\support\defaultlistableobjectfactory.cs:841

Spring.Objects.Factory.Support.DefaultListableObjectFactory.GetObjectsOfType (type type, Boolean includeprototypes , Boolean includefactoryobjects) in f:\bamboo-home\xml-data\build-dir\SPRNET-RELEASE-JOB1\src\Spring\Spring.Core\ objects\factory\support\defaultlistableobjectfactory.cs:835

Spring.Context.Support.AbstractApplicationContext.GetObjectsOfType (Type type, Boolean Includeprototypes, Boolean includefactoryobjects) in f:\bamboo-home\xml-data\build-dir\SPRNET-RELEASE-JOB1\src\Spring\Spring.Core\Context\ support\abstractapplicationcontext.cs:1476

Spring.Context.Support.AbstractApplicationContext.GetObjectsOfType (type type) in F:\bamboo-home\xml-data\ build-dir\sprnet-release-job1\src\spring\spring.core\context\support\abstractapplicationcontext.cs:1411

Spring.Web.Mvc.SpringMvcDependencyResolver.GetService (Type servicetype) in f:\bamboo-home\xml-data\build-dir\ Sprnet-release-job1\src\spring\spring.web.mvc4\springmvcdependencyresolver.cs:77

System.Web.Mvc.DependencyResolverExtensions.GetService (idependencyresolver resolver) +56

System.Web.Mvc.SingleServiceResolver ' 1.GetValueFromResolver () +43

System.lazy ' 1.CreateValue () +416

System.lazy ' 1.LazyInitValue () +152

System.lazy ' 1.get_value () +75

System.Web.Mvc.SingleServiceResolver ' 1.get_current () +15

System.Web.Mvc.MvcRouteHandler.GetSessionStateBehavior (RequestContext requestcontext) +125

System.Web.Mvc.MvcRouteHandler.GetHttpHandler (RequestContext requestcontext) +33

System.Web.Mvc.MvcRouteHandler.System.Web.Routing.IRouteHandler.GetHttpHandler (RequestContext RequestContext) + 10

System.Web.Routing.UrlRoutingModule.PostResolveRequestCache (httpcontextbase context) +9770076

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

Version Information : Microsoft. NET Framework Version: 4.0.30319; ASP. NET version: 4.0.30319.34009

Explain

Spring.net description of application in Mvc4.0

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.