Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +

We have web services which experience on average 1,00,000 hits on a day.The web services are built in .net,Entity Framework and SQL server.
we are getting below exceptions. However, sometime we don't getting any response in spite of Error handling at both .Net and DB side.Can somebody please help.

1)System.Threading.ThreadAbortException

"System.Threading.ThreadAbortException: Thread was being aborted."
2)System.InvalidOperationException: ValueFactory

"System.InvalidOperationException: ValueFactory attempted to access the Value property of this instance.
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at AutoMapper.Mappers.ConvertMapper.MapExpression(TypeMapRegistry typeMapRegistry, IConfigurationProvider configurationProvider, PropertyMap propertyMap, Expression sourceExpression, Expression destExpression, Expression contextExpression)
at AutoMapper.Execution.TypeMapPlanBuilder.MapExpression(TypeMapRegistry typeMapRegistry, IConfigurationProvider configurationProvider, TypePair typePair, Expression sourceParameter, Expression contextParameter, PropertyMap propertyMap, Expression destinationParameter)
at AutoMapper.Execution.TypeMapPlanBuilder.CreatePropertyMapFunc(PropertyMap propertyMap)
at AutoMapper.Execution.TypeMapPlanBuilder.TryPropertyMap(PropertyMap propertyMap)
at AutoMapper.Execution.TypeMapPlanBuilder.CreateAssignmentFunc(Expression destinationFunc, Boolean constructorMapping)
at AutoMapper.Execution.TypeMapPlanBuilder.CreateMapperLambda()
at AutoMapper.TypeMap.Seal(TypeMapRegistry typeMapRegistry, IConfigurationProvider configurationProvider)
at AutoMapper.MapperConfiguration.Seal()
at AutoMapper.MapperConfiguration..ctor(MapperConfigurationExpression configurationExpression, IEnumerable`1 mappers)
"
3)System.NullReferenceException
System.NullReferenceException: Object reference not set to an instance of an object.

What I have tried:

I have tried to further optimize my store procedure because all the business logic/manipulations are done there.
Posted
Updated 28-Mar-17 8:34am

1 solution

Quote:
System.Threading.ThreadAbortException: Thread was being aborted

You aborted a thread and didn't handle the ThreadAbortException that gets raised in the thread. That's a horrible way to terminate a thread and can lead to resource leaks.

Quote:
System.InvalidOperationException: ValueFactory attempted to access the Value property of this instance

This is probably because you're trying to access a property on a model object and haven't loaded that property value from the database yet.

Quote:
System.NullReferenceException: Object reference not set to an instance of an object.

You're code is trying to use a property or method on a null object. You're code is assuming that you have an instance of some object but it's actually null. YOU are the only one who is going to be able to find this one. We don't have the code nor the data it uses to be able to narrow this one down.


In all of these cases, you have bugs in your code. You're going to have to look at the sections of code where these bugs are coming up and start debugging it to find the root cause of each of these problems.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900