iis deployment assembly load error - iis

I get an error when I deploy my webpages in loacl IIS. The interesting thing is that "AjaxControlToolkit.dll" is present in the /bin directory.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Could not load file or assembly 'System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Source Error:
Line 250: <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
Line 251: <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
Line 252: <add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
Line 253: <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
Line 254: <add assembly="Microsoft.JScript, Version=8.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
Source File: C:\Program Files\ClearCanvas\ClearCanvas Image Server\web\web.config Line: 252
Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927

Solved the problem.
Please try this

Related

Azure web apps throws error Merging of ETL files has failed

We have an azure website with two instances. .net core 2.1.1 with ef core and some other basic dependencies. From time to time one of the instances gets in a corrupted state and starts throwing 500 on every request.
The error logged in application insights is very low level so it seems to happen in the framework or "below" our code. Recent changes is moving from 2.1.0 to 2.1.1, implenting azure key vault, configuration of signal-R.
The first error below seems to be suggesting a problem with application insights and "ApplicationInsightsProfiler"
There is not a specific way to reproduce but it seems to start throwing the error when we are using our biggest request which create a lot of db-queries.
Any ideas on what can cause this or maybe some ideas on how to tack what can cause this error?
Second error (that is thrown all the time after the first initial error)
System.IndexOutOfRangeException:
at Go7 (System.Text.RegularExpressions, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
at System.Text.RegularExpressions.CompiledRegexRunner.Go (System.Text.RegularExpressions, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
at System.Text.RegularExpressions.RegexRunner.Scan (System.Text.RegularExpressions, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
at System.Text.RegularExpressions.Regex.Run (System.Text.RegularExpressions, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
at System.Text.RegularExpressions.Regex.IsMatch (System.Text.RegularExpressions, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
at System.Text.RegularExpressions.Regex.IsMatch (System.Text.RegularExpressions, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
at System.Data.Common.DbConnectionOptions.ValidateKeyValuePair (System.Data.Common, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
at System.Data.Common.DbConnectionStringBuilder.set_Item (System.Data.Common, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
at System.Data.SqlClient.SqlConnectionStringBuilder.set_Item (System.Data.SqlClient, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
at System.Data.Common.DbConnectionStringBuilder.set_ConnectionString (System.Data.Common, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
at System.Data.SqlClient.SqlConnectionStringBuilder..ctor (System.Data.SqlClient, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerConnection.get_IsMultipleActiveResultSetsEnabled (Microsoft.EntityFrameworkCore.SqlServer, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
at Microsoft.EntityFrameworkCore.Storage.RelationalConnection+<Microsoft-EntityFrameworkCore-Storage-IRelationalConnection-RegisterBufferableAsync>d__61.MoveNext (Microsoft.EntityFrameworkCore.Relational, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
First error: Merging of ETL files has failed (0x80070507) (Flags: 0x0000011f).
System.Runtime.InteropServices.COMException:
at DiagnosticsHub.StandardCollector.Host.Interop.ICollectionSession.Stop (ApplicationInsightsProfiler, Version=2.4.60711.2, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
at Microsoft.ServiceProfiler.Collectors.StandardCollectorBase.<StopAndCollectAsync>b__10_0 (ApplicationInsightsProfiler, Version=2.4.60711.2, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
at System.Threading.Tasks.Task`1.InnerInvoke (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
at System.Threading.Tasks.Task.Execute (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
at Microsoft.ServiceProfiler.Collectors.DetailedTraceCollector+<StopCollectingAndSaveTrace>d__26.MoveNext (ApplicationInsightsProfiler, Version=2.4.60711.2, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
Developer on Application Insights Profiler here.
The first error is a known bug that we have fixed in version 2.6.5 of the Application Insights site extension. Use the Azure Portal to upgrade the site extension on your web app(s).
However, I note that you are using .NET Core 2.1; there is currently another bug affecting .NET Core 2.1 applications which results in no profiling data being collected. We have a fix for that, but it has not yet been released.
I don't know about the 2nd error. It's probably unrelated to the profiler.

aspnet_compiler Unknown server tag 'sc:sublayout'

I have no error or warnings when i build my visual studio 2012 solution file.
However, when i tried using aspnet_compiler, I got lots of errors such as" Error ASPPARSE: Unknown server tag 'sc:placeholder' and also Error ASPPARSE: Unknown server tag 'sc:sublayout'"
I did some googling and found out that I require some tagPrefix in my web.config file.
Link: http://sitecoreblog.blogspot.sg/2012/03/include-sc-namespace.html
However, I already have the following tagPrefix in my web.config file
<controls>
<add tagPrefix="sc" namespace="Sitecore.Web.UI.WebControls" assembly="Sitecore.Kernel" />
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add tagPrefix="sc" namespace="Sitecore.Web.UI.WebControls" assembly="Sitecore.Analytics" />
</controls>
Can anyone provide me any insight on how can I resolve this weird issue?

Enable Azure Website Application Diagnostics

I have a Windows Azure Website (built with ASP.NET Web Pages), and in the configuration have enabled "Application Diagnostics" for both Blob storage and file storage:
I've then added some Trace statements to a Razor page to test it out
#{
System.Diagnostics.Trace.TraceInformation("INFORMATION");
System.Diagnostics.Trace.TraceWarning("WARNING");
System.Diagnostics.Trace.TraceError("ERROR");
}
However, this results in no logs at all, either in the file system or the blob.
For good measure I attempted to add various settings to my web.config file (shown below), although from the documentation I read, it doesn't seem as though this should be necessary. But it makes no difference - I still see no diagnostic logs in the file system or the blob.
<system.web>
<compilation debug="true" targetFramework="4.5">
<assemblies>
<add assembly="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
<trace enabled="true"/>
<httpRuntime targetFramework="4.5" />
</system.web>
<system.diagnostics>
<trace>
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
name="AzureDiagnostics">
</add>
<add name="WebPageTraceListener"
type="System.Web.WebPageTraceListener, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</listeners>
</trace>
</system.diagnostics>
Is there anything else I need to configure that I've missed? Could it be that this simply doesn't work at all for ASP.NET Web Pages projects?
To enable tracing from a razor page add the following to your web.config:
<system.codedom>
<compilers>
<compiler
language="c#;cs;csharp"
extension=".cs"
type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
compilerOptions="/define:TRACE"
warningLevel="1" />
</compilers>
</system.codedom>
Source: http://blogs.msdn.com/b/webdev/archive/2013/07/16/tracing-in-asp-net-mvc-razor-views.aspx
Note that tracing from your cs files should work without any changes to web.config.

Umbraco 7.1.9 on Windows Server 2012 (Azure)

We recently deployed a Umbraco 7.1.9 application on a Windows Server 2012 VM hosted by Azure. The application works #1 locally on our developer machines but when we deploy the website on the VM we get this error:
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.Reflection.ReflectionTypeLoadException: Could not load types from assembly umbraco, Version=1.0.5443.21812, Culture=neutral, PublicKeyToken=null, errors:
Exception: System.TypeLoadException: Declaration referenced in a method implementation cannot be a final method. Type: 'Umbraco.Web.Editors.ContentPostValidateAttribute'. Assembly: 'umbraco, Version=1.0.5443.21812, Culture=neutral, PublicKeyToken=null'.
Exception: System.TypeLoadException: Could not load type 'System.Web.Http.Controllers.IControllerConfiguration' from assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Exception: System.TypeLoadException: Could not load type 'System.Web.Http.Controllers.IControllerConfiguration' from assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Exception: System.TypeLoadException: Could not load type 'System.Web.Http.Controllers.IControllerConfiguration' from assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Exception: System.TypeLoadException: Declaration referenced in a method implementation cannot be a final method. Type: 'Umbraco.Web.WebApi.Filters.EnsureUserPermissionForContentAttribute'. Assembly: 'umbraco, Version=1.0.5443.21812, Culture=neutral, PublicKeyToken=null'.
Exception: System.TypeLoadException: Declaration referenced in a method implementation cannot be a final method. Type: 'Umbraco.Web.WebApi.Filters.EnsureUserPermissionForMediaAttribute'. Assembly: 'umbraco, Version=1.0.5443.21812, Culture=neutral, PublicKeyToken=null'.
Exception: System.TypeLoadException: Declaration referenced in a method implementation cannot be a final method. Type: 'Umbraco.Web.WebApi.Filters.FileUploadCleanupFilterAttribute'. Assembly: 'umbraco, Version=1.0.5443.21812, Culture=neutral, PublicKeyToken=null'.
Exception: System.TypeLoadException: Declaration referenced in a method implementation cannot be a final method. Type: 'Umbraco.Web.WebApi.Filters.FilterAllowedOutgoingMediaAttribute'. Assembly: 'umbraco, Version=1.0.5443.21812, Culture=neutral, PublicKeyToken=null'.
Exception: System.TypeLoadException: Declaration referenced in a method implementation cannot be a final method. Type: 'Umbraco.Web.WebApi.Filters.FilterAllowedOutgoingMediaAttribute'. Assembly: 'umbraco, Version=1.0.5443.21812, Culture=neutral, PublicKeyToken=null'.
Exception: System.TypeLoadException: Could not load type 'System.Web.Http.Controllers.IControllerConfiguration' from assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Exception: System.TypeLoadException: Could not load type 'System.Web.Http.Dispatcher.DefaultHttpControllerSelector' from assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
We installed the latest version of .NET Framework, every updates on the server and we can't get it to work.
Anyone got a similar issue?
EDIT: Useful thread here...
http://our.umbraco.org/forum/getting-started/installing-umbraco/48351-Umbraco-703-is-totally-broken-after-fresh-nuget-install
This didn't help...
I haven't seen that problem yet but I'm diffing Web.config to upgrade from 7.1.4 to 7.1.9 today and I've noticed two things that might help you.
This was added recently:
<add assembly="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
There is nothing like this in Web.config for System.Web.Http:
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
</dependentAssembly>
Makes me wonder if the answer to your problem might be adding this:
<dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
Or this (seen here):
<dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.2.0" newVersion="5.2.2.0" />
</dependentAssembly>
Not sure it will be helpful for anyone else having this issue as it is very specific to our project.
We added the LowercaseRoutesMVC4 package that depends on AspNetWebApi.Core which is an unlisted package. It references a bad version of System.Web.Http. I uninstalled this package, used the LowercaseUrls property in my route configuration instead of the NuGet package and now everything works as expected.

Deploying CAS policies in Sharepoint using the solution framework

I'm deploying my web parts using the sharepoint solution mechanism. Untul now, everything worked fine, but when i added CAS policies to the manifest.xml file, the deployment doesn't work as it should.
When deploying the solution with the CAS policies, there are no errors, but the policy file isn't created, the dll isn't copied, and the SafeControls entries aren't added to the web.config. My manifest.xml file looks like this :
<Solution SolutionId="{8099F953-02F2-49e1-B620-06B9050515A3}"
xmlns="http://schemas.microsoft.com/sharepoint/">
<FeatureManifests>
<FeatureManifest Location="Przydzialy\feature.xml" />
</FeatureManifests>
<TemplateFiles>
<TemplateFile Location="FEATURES\Przydzialy\AjaxWebPart.dwp" />
<TemplateFile Location="FEATURES\Przydzialy\UserControlContainer.dwp" />
</TemplateFiles>
<Assemblies>
<Assembly DeploymentTarget="WebApplication" Location="Package.WebParts.dll">
<SafeControls>
<SafeControl Assembly="Package.WebParts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9a8b1f3d028b8494" Namespace="Package.WebParts" TypeName="UserControlContainer" Safe="True" />
<SafeControl Assembly="Package.WebParts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9a8b1f3d028b8494" Namespace="Package.WebParts" TypeName="AjaxWebPart" Safe="True" />
<SafeControl Assembly="Package.WebParts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9a8b1f3d028b8494" Namespace="Package.WebParts" TypeName="ProgressTemplate" Safe="True" />
<SafeControl Assembly="Package.WebParts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9a8b1f3d028b8494" Namespace="Package.WebParts.SmartWebPart" TypeName="UserControlContainerToolPart" Safe="True" />
</SafeControls>
</Assembly>
</Assemblies>
<CodeAccessSecurity>
<PolicyItem>
<PermissionSet class="NamedPermissionSet" version="1" Description="Permission set for Package.WebParts">
<IPermission class="AspNetHostingPermission" version="1" Level="Medium" />
</PermissionSet>
<Assemblies>
<Assembly Name="Package.WebParts" />
</Assemblies>
</PolicyItem>
</CodeAccessSecurity>
</Solution>
Did anybody had a problem like that befor ? I've run out of ideas at this point, so I'm open for suggestions.
Check your web.config and make sure that the trust level is not set to full. It should be set to WSS_Minimal if you haven't deployed any CAS policies yet or WSS_Custom if you have already deployed something. Make sure that you don't have any readonly files in your solution package as that causes problems.
Lastly, are you deploying your solution via Central Admin or stsadm? If you are deploying via stsadm, then go to central admin and see if there are any errors shown when you deploy your solution.
More than likely you are going to need more permissionSets as well, check my post here for more on Code Access Security.

Resources