Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

System.TypeLoadExceptions when publishing to dxcloud

Vote:
 

Hello,

I'm following the Dev4DXC tutorial.

DxcAlloy project works fine locally, however when I publish to the dxcloud I get following error:

While loading .NET types from "EPiServer.Packaging" the following error(s) was reported:

    - System.TypeLoadException: Could not load type 'EPiServer.Web.Hosting.IHostingEnvironment' from assembly 'EPiServer.Framework, Version=11.2.1.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7'.

While loading .NET types from "EpiserverSite" the following error(s) was reported:

    - System.TypeLoadException: Could not load type 'EPiServer.Global' from assembly 'EPiServer, Version=11.2.1.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7'.


Any idea what I'm doing wrong? 

Thanks in advance,

Brecht Vanneste

--------

Full Stack trace:

[InitializationException: While loading .NET types from "EPiServer.Packaging" the following error(s) was reported:

     - System.TypeLoadException: Could not load type 'EPiServer.Web.Hosting.IHostingEnvironment' from assembly 'EPiServer.Framework, Version=11.2.1.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7'.

While loading .NET types from "EpiserverSite" the following error(s) was reported:

     - System.TypeLoadException: Could not load type 'EPiServer.Global' from assembly 'EPiServer, Version=11.2.1.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7'.

]
   EPiServer.Framework.Initialization.Internal.InitializationExceptionHelper.ThrowFriendlyTypeScannerException(IEnumerable`1 reflectionExceptions, IEnumerable`1 addonsWithErrors) +114
   EPiServer.Framework.Initialization.InitializationModule.EngineExecute(HostType hostType, Action`1 engineAction) +1283
   EPiServer.Framework.Initialization.InitializationModule.FrameworkInitialization(HostType hostType) +187
   EPiServer.Global..ctor() +83
   DxcAlloy.EPiServerApplication..ctor() +37
   ASP.global_asax..ctor() in d:\local\Temporary ASP.NET Files\root\d0e2cce6\afd7f897\App_global.asax.0.cs:0

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +197
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +100
   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) +1538
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +298
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +27
   System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +80
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +300
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +359

[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +444
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +119
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +604
#186257
Dec 14, 2017 17:24
Vote:
 

Was the site clean before publishing? Can you remove everything and publish again?

It seems some of the old assemblies get in the way.

#186258
Dec 14, 2017 17:41
Vote:
 
<p>That fixed it, thanks!</p>
#186281
Dec 15, 2017 11:51
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.