asp.net-mvc


External component has thrown an exception after framework upgrade on server


I recently upgraded a 2008 R2 Web server to .Net Framework 4.6.1. I then installed my ASP.NET MVC application on such which is built to .Net Framework 4.6.1. When I attempt to run the site, I get the following error.
External component has thrown an exception.
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.Runtime.InteropServices.SEHException: External component has thrown an exception.
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:
[SEHException (0x80004005): External component has thrown an exception.]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +485
System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark) +190
System.Reflection.Assembly.LoadFrom(String assemblyFile) +54
WebActivator.ActivationManager.get_Assemblies() +244
WebActivator.ActivationManager.RunActivationMethods() +86
WebActivator.ActivationManager.RunPreStartMethods() +46
WebActivator.ActivationManager.Run() +68
[InvalidOperationException: The pre-application start initialization method Run on type WebActivator.ActivationManager threw an exception with the following error message: External component has thrown an exception..]
System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection`1 methods, Func`1 setHostingEnvironmentCultures) +900
System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +164
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +169
System.Web.Compilation.BuildManager.ExecutePreAppStart() +172
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +907
[HttpException (0x80004005): The pre-application start initialization method Run on type WebActivator.ActivationManager threw an exception with the following error message: External component has thrown an exception..]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +579
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +118
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +726
I did same process on other similar servers and didn't hit an issue.
I did find that in IIS (which the site is running in), if I change the application pools "Load User Profile" setting to false then the site runs without a problem.
I don't just want to change this setting (unsure of its impact on the application), I would like to understand why I need to make such a change on this server and didn't need to on others. Was it the way the framework was installed or server is setup? Any feedback would be great.
(note: the server has version 4.5 installed and the site when built in such, ran without an issue)
I ran in this problem once, on many cases problem is due to some software in the dev suite that was not up to date. In my case the problem was caused due to Telerik justMock, The problem was resolved by updating justmock to latest version. Try to update or uninstall Telerik tools if you have one, Hope this solves your problem
External component has thrown an exception.
I had before similar problem after installing .Net Framework 4.6.1 - I have not figured out what component cause problem, but problem was related to missing .NET Framework 4.5.1 Targeting Pack.
Solution in my case:
uninstall all .NET Frameworks,
install .NET Framework 4.5.1 Developer Pack
install .NET Framework 4.5.2 Developer Pack
install .NET Framework 4.6.1 Targeting Pack
(the order is important)
All downloaded form official site: Targeting .NET Platforms

Related Links

Best practive for logging errors (handled and unhandled) in MVC
ServiceStack request giving 500 for large request
Cross domain session asp mvc in IE and old browsers
Adding MVC Controller scaffolding error
Unable to debug plugin in NopCommerce
Displaying HTML and Images in MultiSelectList ASP.NET MVC Razor
#Html.DisplayFor() value not change after the postback
Location of Validation Message
ASP.NET Identity update column type for primary key Id in AspNetUsers table from a string to and int or a guid, yes or no?
Deploying ASP MVC 5 App with IIS 7.5
validation for dropdown in MVC3
MVC getting a list of music and image into a table
How to allow users to only edit their details in a catalog
Defining Repository for MVC best practice
MVC ASP.NET search filter by int
How do I add placeholder text from the model into a MVC view?

Categories

HOME
ssis
codeigniter
opencl
elf
robotframework
parse.com
blogs
asana
logback
active-directory
android-dialer
activerecord
openframeworks
marketplace
union
cloudrail
orchardcms-1.10
amadeus
vast
org-mode
jmeter-plugins
pcap
ormlite-servicestack
c-strings
easendmail
profiling
smallbasic
angular-services
scalability
nested-loops
android-imageview
pymysql
concurrenthashmap
bluebird
scatter-plot
cloudinary
seh
detach
querydsl
edit-distance
json-rpc
dsx
couchbase-lite
log4perl
ms-jet-ace
typesetting
zbar
tryton
mapr
db2400
manifoldcf
wxhaskell
topojson
webtrends
singly-linked-list
android-location
formatter
vlc-android
uiswitch
facebook-comments
google-api-ruby-client
php-opencloud
par
session-replication
heroku-toolbelt
iphone-5
pencilblue
mkpolyline
declaration
imake
opensc
formhelper
citymaps
iqueryable
monk
bunny
twill
mouseenter
dirpagination
asp.net-apicontroller
windward
disabled-input
libavcodec
django-endless-pagination
resolver
mainwindow
capitalize
gdb-python
mosek
cakephp-2.1
qbwc
datakey
android-screen
consistent-hashing
objcopy
facebook-authentication
blackberry-os-v5
eye-detection
seam-conversation
scramble
xml-database
coords
xlink

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App