i have a .net app that was in .net 3.0 and using crystal reports 10.5
we migrated to .net 4.5 and a new development/testing web server using .net 4.5
now the application will not load.
the errors that i receive are:
Server Error in '/' Application.
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 'CrystalDecisions.Web, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.
Source Error:
Line 16: <compilation debug="true" targetFramework="4.5">
Line 17: <assemblies>
Line 18: <add assembly="CrystalDecisions.Web, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
Line 19: <add assembly="CrystalDecisions.Shared, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
Line 20: <add assembly="CrystalDecisions.ReportSource, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
Source File: E:\IIS_Sites\NOSSA\WebSAR\3.8.1\web.config Line: 18
Assembly Load Trace: The following information can be helpful to determine why the assembly 'CrystalDecisions.Web, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' could not be loaded.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable c:\windows\system32\inetsrv\w3wp.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: DisplayName = CrystalDecisions.Web, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304
(Fully-specified)
LOG: Appbase = file:///C:/inetpub/wwwroot/
LOG: Initial PrivatePath = C:\inetpub\wwwroot\bin
Calling assembly : (Unknown).
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\inetpub\wwwroot\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: CrystalDecisions.Web, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304
LOG: The same bind was seen before, and was failed with hr = 0x80070002.
i have installed the crystal runtime.
i'm not sure what else to try.
thanks
Are the following files in the bin directory of your website/application?
crystaldecisions.crystalreports.engine.dll, crystaldecisions.reportsource.dll, crystaldecisions.shared.dll, crystaldecisions.web.dll.
Also, I believe that version of CR is compiled under .NET 2.0 so you may need to enable the legacyV2 runtime. You can do so via the app.config file by adding useLegacyV2RuntimeActivationPolicy="true" to the startup element.
Or, you can do it in code by using the RuntimePolicyHelper class.
eg.
Imports System.Runtime.InteropServices
Imports System.Runtime.CompilerServices
'instantiate your class
Public Sub New()
Try
'runtime support for mixed mode assemblies
'this is used to load .NET 2.0 assemblies that crystal reports is built against.
If RuntimePolicyHelper.LegacyV2RuntimeEnabledSuccessfully = True Then
Else
If MsgBox("Legacy CLR could not be loaded. Continue?", _
vbYesNo + vbExclamation, _
"Failed to load legacy runtime.") = vbNo Then
Application.Exit()
End If
End If
Catch ex As Exception
ex = New Exception(ex.Message & vbCrLf & ex.StackTrace)
Throw ex
End Try
End Sub
Public NotInheritable Class RuntimePolicyHelper
Private Sub New()
End Sub
Public Shared Property LegacyV2RuntimeEnabledSuccessfully() As Boolean
Get
Return m_LegacyV2RuntimeEnabledSuccessfully
End Get
Private Set(value As Boolean)
m_LegacyV2RuntimeEnabledSuccessfully = value
End Set
End Property
Private Shared m_LegacyV2RuntimeEnabledSuccessfully As Boolean
Shared Sub New()
Try
Dim clrRuntimeInfo As ICLRRuntimeInfo = _
DirectCast(RuntimeEnvironment.GetRuntimeInterfaceAsObject(Guid.Empty, _
GetType(ICLRRuntimeInfo).GUID), ICLRRuntimeInfo)
Try
clrRuntimeInfo.BindAsLegacyV2Runtime()
LegacyV2RuntimeEnabledSuccessfully = True
Catch generatedExceptionName As COMException
LegacyV2RuntimeEnabledSuccessfully = False
End Try
Catch ex As Exception
ex = New Exception(ex.Message & vbCrLf & ex.StackTrace)
Throw ex
End Try
End Sub
<ComImport()> _
<InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _
<Guid("xxxxxxx-xxxxxxx-xxxxxxx-xxxxxxx")> _
Private Interface ICLRRuntimeInfo
Sub xGetVersionString()
Sub xGetRuntimeDirectory()
Sub xIsLoaded()
Sub xIsLoadable()
Sub xLoadErrorString()
Sub xLoadLibrary()
Sub xGetProcAddress()
Sub xGetInterface()
Sub xSetDefaultStartupFlags()
Sub xGetDefaultStartupFlags()
<MethodImpl(MethodImplOptions.InternalCall, _
MethodCodeType:=MethodCodeType.Runtime)> _
Sub BindAsLegacyV2Runtime()
End Interface
End Class
Please note that I didn't come up with this code - I may have even found it on this site - but I can't find the original contributor. However, it works for me so you may want to give it a try.
Related
I am getting the exception below when i tried to upgrade grpc version to 2.33.1
TargetFrameworkVersion : 4.8
The content of this exception did not tell me any thing, can any body give any help
Thanks.
Used Package References :
<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.14.0" />
<PackageReference Include="Grpc.Core.Api" Version="2.33.1" />
<PackageReference Include="Grpc.Tools" Version="2.33.1" />
</ItemGroup>
Message: An exception of type 'Grpc.Core.RpcException' occurred and was caught.
2021-11-05T19:00:30.966+01:00
Exception Messages:
RpcException : Status(StatusCode="Cancelled", Detail="Cancelled", DebugException="Grpc.Core.Internal.CoreErrorDetailException: {"created":"#1636135230.919000000","description":"Error received from peer ipv6:[::1]:28000","file":"T:\src\github\grpc\workspace_csharp_ext_windows_x64\src\core\lib\surface\call.cc","file_line":1062,"grpc_message":"Cancelled","grpc_status":1}")
Type : Grpc.Core.RpcException, Grpc.Core.Api, Version=2.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad
Message : Status(StatusCode="Cancelled", Detail="Cancelled", DebugException="Grpc.Core.Internal.CoreErrorDetailException: {"created":"#1636135230.919000000","description":"Error received from peer ipv6:[::1]:28000","file":"T:\src\github\grpc\workspace_csharp_ext_windows_x64\src\core\lib\surface\call.cc","file_line":1062,"grpc_message":"Cancelled","grpc_status":1}")
Context Messages:
Exception occurred from calling /ServiceGrpc/Init.
Source : mscorlib
Status : Status(StatusCode="Cancelled", Detail="Cancelled", DebugException="Grpc.Core.Internal.CoreErrorDetailException: {"created":"#1636135230.919000000","description":"Error received from peer ipv6:[::1]:28000","file":"T:\src\github\grpc\workspace_csharp_ext_windows_x64\src\core\lib\surface\call.cc","file_line":1062,"grpc_message":"Cancelled","grpc_status":1}")
StatusCode : Cancelled
Trailers : Grpc.Core.Metadata
TargetSite : Void Throw()
Stack Trace : at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Grpc.Core.Internal.AsyncCall2.UnaryCall(TRequest msg) in T:\src\github\grpc\src\csharp\Grpc.Core\Internal\AsyncCall.cs:line 78 at Grpc.Core.DefaultCallInvoker.BlockingUnaryCall[TRequest,TResponse](Method2 method, String host, CallOptions options, TRequest request) in T:\src\github\grpc\src\csharp\Grpc.Core\DefaultCallInvoker.cs:line 46
at Grpc.Core.Interceptors.InterceptingCallInvoker.b__3_0[TRequest,TResponse](TRequest req, ClientInterceptorContext`2 ctx) in T:\src\github\grpc\src\csharp\Grpc.Core.Api\Interceptors\InterceptingCallInvoker.cs:line 51
Context :
Windows 2019 Server
ASP.NET MVC using .NET Framework 4.5.2
log4net 2.0.12
In web.config (inside <configSections>) I have:
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
In the same file (inside <configuration>)
<log4net debug="true">
<root>
<level value="ALL" />
</root>
<logger name="inboundAPI">
<level value="ALL" />
<appender-ref ref="RollingFileAppender" />
</logger>
<appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="C:\temp\inboundAPI.log" />
<appendToFile value="true" />
<preserveLogFileNameExtension value="true"/>
<rollingStyle value="Date"/>
<datePattern value=".yyyyMMdd"/>
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level - %message%newline" />
</layout>
</appender>
</log4net>
Finally inside Global.asax.vb I have:
Sub Application_Start()
...
log4net.Config.XmlConfigurator.Configure()
End Sub
The directory (C:\temp\) where the log is supposed to be is Full Access for Everyone.
C:\>cacls C:\temp
C:\temp Everyone:(OI)(CI)F
BUILTIN\IIS_IUSRS:(OI)(CI)F
NT AUTHORITY\SYSTEM:(OI)(CI)(ID)F
BUILTIN\Administrators:(OI)(CI)(ID)F
BUILTIN\Users:(OI)(CI)(ID)R
BUILTIN\Users:(CI)(ID)(special access:)
FILE_APPEND_DATA
BUILTIN\Users:(CI)(ID)(special access:)
FILE_WRITE_DATA
CREATOR OWNER:(OI)(CI)(IO)(ID)F
The file is created and inherits the proper rights but remain empty while it is not empty on my development PC, using IIS Express.
C:\temp>dir
Volume in drive C is Windows
Volume Serial Number is 3A59-32AE
Directory of C:\temp
06/23/2021 07:18 PM <DIR> .
06/23/2021 07:18 PM <DIR> ..
06/23/2021 07:18 PM 0 inboundAPI.log
06/23/2021 07:41 PM 5,382 log4net.txt
2 File(s) 5,382 bytes
2 Dir(s) 15,342,981,120 bytes free
C:\temp>cacls inboundAPI.log
C:\temp\inboundAPI.log Everyone:(ID)F
BUILTIN\IIS_IUSRS:(ID)F
NT AUTHORITY\SYSTEM:(ID)F
BUILTIN\Administrators:(ID)F
BUILTIN\Users:(ID)R
IIS APPPOOL\InboundAPI:(ID)F
I have a system.diagnotic section in the same web.config file:
<system.diagnostics>
<trace autoflush="true">
<listeners>
<add
name="textWriterTraceListener"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="C:\temp\log4net.txt" />
</listeners>
</trace>
</system.diagnostics>
That is writing to the same directory successfully and here is the content as it might help
log4net: log4net assembly [log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a]. Loaded from [C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\inboundapi\7b262cab\40e772b2\assembly\dl3\b60f6c7c\739e9dfa_715cd701\log4net.dll]. (.NET Runtime [4.0.30319.42000] on Microsoft Windows NT 10.0.17763.0)
log4net: defaultRepositoryType [log4net.Repository.Hierarchy.Hierarchy]
log4net: Creating repository for assembly [InboundAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]
log4net: Assembly [InboundAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] Loaded From [C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\inboundapi\7b262cab\40e772b2\assembly\dl3\df6af0be\ce6bcea0_5268d701\InboundAPI.dll]
log4net: Assembly [InboundAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] does not have a RepositoryAttribute specified.
log4net: Assembly [InboundAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] using repository [log4net-default-repository] and repository type [log4net.Repository.Hierarchy.Hierarchy]
log4net: Creating repository [log4net-default-repository] using type [log4net.Repository.Hierarchy.Hierarchy]
log4net: configuring repository [log4net-default-repository] using .config file section
log4net: Application config file is [C:\inetpub\wwwroot\InboundAPI\web.config]
log4net: Configuring Repository [log4net-default-repository]
log4net: Configuration update mode [Merge].
log4net: Logger [root] Level string is [ALL].
log4net: Logger [root] level set to [name="ALL",value=-2147483648].
log4net: Retrieving an instance of log4net.Repository.Logger for logger [inboundAPI].
log4net: Setting [inboundAPI] additivity to [True].
log4net: Logger [inboundAPI] Level string is [ALL].
log4net: Logger [inboundAPI] level set to [name="ALL",value=-2147483648].
log4net: Loading Appender [RollingFileAppender] type: [log4net.Appender.RollingFileAppender]
log4net: Setting Property [File] to String value [C:\temp\inboundAPI.log]
log4net: Setting Property [AppendToFile] to Boolean value [True]
log4net: Setting Property [PreserveLogFileNameExtension] to Boolean value [True]
log4net: Setting Property [RollingStyle] to RollingMode value [Date]
log4net: Setting Property [DatePattern] to String value [.yyyyMMdd]
log4net: Setting Property [StaticLogFileName] to Boolean value [True]
log4net: Converter [message] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: Converter [newline] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: Setting Property [ConversionPattern] to String value [%date [%thread] %-5level - %message%newline]
log4net: Converter [date] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: Converter [literal] Option [ [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: Converter [thread] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: Converter [literal] Option [] ] Format [min=-1,max=2147483647,leftAlign=False]
log4net: Converter [level] Option [] Format [min=5,max=2147483647,leftAlign=True]
log4net: Converter [literal] Option [ - ] Format [min=-1,max=2147483647,leftAlign=False]
log4net: Converter [message] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: Converter [newline] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: Setting Property [Layout] to object [log4net.Layout.PatternLayout]
log4net: Type = [0], r0 = [.19700101], r1 = [.19700101]
log4net: Type = [1], r0 = [.19700101], r1 = [.19700101]
log4net: Type = [2], r0 = [.19700101], r1 = [.19700101]
log4net: Type = [3], r0 = [.19700101], r1 = [.19700102]
log4net: Searched for existing files in [C:\temp]
log4net: curSizeRollBackups starts at [0]
log4net: Opening file for writing [C:\temp\inboundAPI.log] append [True]
log4net: Created Appender [RollingFileAppender]
log4net: Adding appender named [RollingFileAppender] to logger [inboundAPI].
log4net: Hierarchy Threshold []
I think that I've read dozens of posts here and there and it might look like a duplicate but I swear that I tried all of what I read.
I still don't understand the following:
(1) Why is everything working on my PC with IIS Express?
(2) Why is the file created to suggest that rights are correct but remains empty?
(3) Why is the same IIS able to fill the log4net diagnostic in the same directory?
(4) Why is that diagnostic is not showing any error?
(5) Why is there nothing in the event log of Windows?
My brain is exploding!
I have a C++/CLI DLL that needs to run in the context of an ASP.NET WebApi action.
The action is affected by an ActionFilter that uses log4net's LogicalThreadContext to set a property containing a request ID; this works nicely to write the request ID into the log entries.
The problem is that ASP.NET seems to be creating an appdomain when it's time to load the class from the C++/CLI dll. (I can't seem to find any documentation on how that works; I'd love to find some.) When the appdomain plumbing tries to deserialize everything, it chokes because it can't find log4net.dll (see stack trace below).
Fusion logs show that it's looking in C:\Windows\System32\inetsrv, which is incorrect... I would expect it to look in the probing path or along the %PATH% environment variable.
A few data points:
log4net.dll is available in the web app's bin directory and works fine for everything else I'm using it for.
The C++/CLI code has no dependencies on log4net.
If I comment out my calls to log4net.LogicalThreadContext.Properties[...], everything works fine.
If I copy log4net.dll from my bin folder to C:\Windows\system32\inetsrv, everything works fine.
The web.config file specifies the probing path with a <probing privatePath="bin"/> element.
My Application_Start method in global.asax.cs prepends the web app's bin directory to the %PATH% environment variable:
var currentPathEnvVar = Environment.GetEnvironmentVariable("PATH");
var binPath = Path.Combine(Server.MapPath("~") ?? String.Empty, "bin");
_log.DebugFormat("Prepending paths to PATH: [{0}]", binPath);
Environment.SetEnvironmentVariable("PATH", String.Concat(binPath, Path.PathSeparator, currentPathEnvVar));
The log shows that the %PATH% is getting prepended correctly:
2015-06-05 17:07:48,816 1 DEBUG MyNamespace.WebApiApplication (null) Prepending paths to PATH: [C:\Program Files\MyCompany\MyApp\web\bin]
So how do I get the appdomain that ASP.NET creates to look in the right place to load assemblies?
Thanks.
Here's the stack trace that gets logged when all this goes down.
2015-06-05 17:08:41,148 23 ERROR MyNamespace.MyController (null) Controller action failed
System.TypeInitializationException: The type initializer for '<Module>' threw an exception. ---> <CrtImplementationDetails>.ModuleLoadException: The C++ module failed to load while attempting to initialize the default appdomain.
---> System.Runtime.Serialization.SerializationException: Unable to find assembly 'log4net, Version=1.2.13.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a'.
Server stack trace:
at System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name)
at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream stm)
at System.Runtime.Remoting.Messaging.SmuggledMethodCallMessage.FixupForNewAppDomain()
at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoDispatch(Byte[] reqStmBuff, SmuggledMethodCallMessage smuggledMcm, SmuggledMethodReturnMessage& smuggledMrm)
at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoTransitionDispatchCallback(Object[] args)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at System.AppDomain.IsDefaultAppDomain()
at <CrtImplementationDetails>.GetDefaultDomain() in f:\dd\vctools\crt\crtw32\h\minternal.h:line 367
at <CrtImplementationDetails>.DoCallBackInDefaultDomain(IntPtr function, Void* cookie) in f:\dd\vctools\crt\crtw32\h\minternal.h:line 401
at <CrtImplementationDetails>.DefaultDomain.Initialize() in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 278
at <CrtImplementationDetails>.LanguageSupport.InitializeDefaultAppDomain(LanguageSupport* ) in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 343
at <CrtImplementationDetails>.LanguageSupport._Initialize(LanguageSupport* ) in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 546
at <CrtImplementationDetails>.LanguageSupport.Initialize(LanguageSupport* ) in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 703
--- End of inner exception stack trace ---
at <CrtImplementationDetails>.ThrowModuleLoadException(String errorMessage, Exception innerException) in f:\dd\vctools\crt\crtw32\h\minternal.h:line 194
at <CrtImplementationDetails>.LanguageSupport.Initialize(LanguageSupport* ) in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 713
at .cctor() in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 754
--- End of inner exception stack trace ---
at MyNamespace.MyController.MyAction(String foo, Int64 bar, String baz)
This helped me to resolve similar issue:
https://blogs.msdn.microsoft.com/jorman/2007/08/31/loading-c-assemblies-in-asp-net/
Faced option 2.a and proposed solution worked fine:
protected void Application_Start(object sender, EventArgs e){
String _path = String.Concat(System.Environment.GetEnvironmentVariable("PATH"), ";",
System.AppDomain.CurrentDomain.RelativeSearchPath);
System.Environment.SetEnvironmentVariable("PATH", _path, EnvironmentVariableTarget.Process); }
Windows Server 2012 64 bit
IIS8
ASP.NET Framework 4
Trying to run an unmanaged DLL from my aspx page
Executing the DLL Function call gives:
The Just-In-Time debugger was launched without necessary security permissions. To debug this process, the Just-In-Time debugger must be run as an Administrator. Would you like to debug this process?
There is no debugger that I know of on the web server, trying to launch it gives errors.
Why is my call to my DLL crashing my aspnet worker process?
How can I tell IIS8 there is no debugger?
I have googled this extensively, and all the help seems to be about Visual Studio, not IIS. There is no Visual Studio on the web sever.
Here is the offending code.
private string regname = "";
private string fingerprint = "";
private string unlockingcode = "";
/// <summary>
/// called from page_load
/// </summary>
private void CreateUnlockingCode()
{
UInt32 lfp;
string sfp = fingerprint.Remove(4, 1);
lfp = Convert.ToUInt32(sfp, 16);
string bindir = Server.MapPath(#"~/bin/CodeGen64.dll"); //full path to the DLL "P:\\AFI2013\\bin\\CodeGen64.dll"
IntPtr pDll = NativeMethods.LoadLibrary(bindir); //attempt to load the library
try
{
IntPtr pAddressOfFunctionToCall = NativeMethods.GetProcAddress(pDll, "CreateCode2A");
CreateCode2 createCode2 = (CreateCode2)Marshal.GetDelegateForFunctionPointer(
pAddressOfFunctionToCall,
typeof(CreateCode2));
//THIS LINE CRASHES THE ASPNET WORKER PROCESS
unlockingcode = createCode2(1, regname, encrypt_template, lfp, (UInt16)0, (UInt16)0, (UInt16)0, (UInt16)0, (UInt16)0);
}
finally
{
bool result = NativeMethods.FreeLibrary(pDll);
}
}
And here is the Error from the Event Viewer.
Log Name: Application
Source: Application Error
Date: 7/10/2013 11:34:30 AM
Event ID: 1000
Task Category: (100)
Level: Error
Keywords: Classic
User: N/A
Computer: owl.INT.local
Description:
Faulting application name: w3wp.exe, version: 8.0.9200.16384, time stamp: 0x50108835
Faulting module name: ntdll.dll, version: 6.2.9200.16579, time stamp: 0x51637f77
Exception code: 0xc0000374
Fault offset: 0x00000000000ebd59
Faulting process id: 0x2608
Faulting application start time: 0x01ce7d9c1d409343
Faulting application path: c:\windows\system32\inetsrv\w3wp.exe
Faulting module path: C:\Windows\SYSTEM32\ntdll.dll
Report Id: 5b36e881-e98f-11e2-9406-000c2908dae4
Faulting package full name:
Faulting package-relative application ID:
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Application Error" />
<EventID Qualifiers="0">1000</EventID>
<Level>2</Level>
<Task>100</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2013-07-10T18:34:30.000000000Z" />
<EventRecordID>54586</EventRecordID>
<Channel>Application</Channel>
<Computer>owl.INT.local</Computer>
<Security />
</System>
<EventData>
<Data>w3wp.exe</Data>
<Data>8.0.9200.16384</Data>
<Data>50108835</Data>
<Data>ntdll.dll</Data>
<Data>6.2.9200.16579</Data>
<Data>51637f77</Data>
<Data>c0000374</Data>
<Data>00000000000ebd59</Data>
<Data>2608</Data>
<Data>01ce7d9c1d409343</Data>
<Data>c:\windows\system32\inetsrv\w3wp.exe</Data>
<Data>C:\Windows\SYSTEM32\ntdll.dll</Data>
<Data>5b36e881-e98f-11e2-9406-000c2908dae4</Data>
<Data>
</Data>
<Data>
</Data>
</EventData>
</Event>
I recently installed the latest PowerTools on Tridion 2011 SP1. After installing my CM gives the following error.
Uncaught ReferenceError: Tridion is not defined
Attaching a screenshot of the error below
If now I remove the PowerTools, I get an following error.
System.IO.FileNotFoundException: Could not load file or assembly 'Interop.TDSI18NLib, Version=5.4.0.0, Culture=neutral, PublicKeyToken=ddfc895746e5ee6b' or one of its dependencies. The system cannot find the file specified. File name: 'Interop.TDSI18NLib, Version=5.4.0.0, Culture=neutral, PublicKeyToken=ddfc895746e5ee6b' at Tridion.Web.UI.Models.TCM54.LocalizationModule.InitializeCulture(Object sender, EventArgs args) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll Running under executable C:\Windows\SysWOW64\inetsrv\w3wp.exe --- A detailed error log follows. === Pre-bind state information === LOG: User = NT AUTHORITY\NETWORK SERVICE LOG: DisplayName = Interop.TDSI18NLib, Version=5.4.0.0, Culture=neutral, PublicKeyToken=ddfc895746e5ee6b (Fully-specified) LOG: Appbase = file:///C:/Program Files (x86)/Tridion/web/WebUI/WebRoot/ LOG: Initial PrivatePath = C:\Program Files (x86)\Tridion\web\WebUI\WebRoot\bin Calling assembly : Tridion.Web.UI.Models.TCM54, Version=6.1.0.55920, Culture=neutral, PublicKeyToken=ddfc895746e5ee6b. === LOG: This bind starts in default load context. LOG: Using application configuration file: C:\Program Files (x86)\Tridion\web\WebUI\WebRoot\web.config LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet.config LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. LOG: Post-policy reference: Interop.TDSI18NLib, Version=5.4.0.0, Culture=neutral, PublicKeyToken=ddfc895746e5ee6b LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/webui/f9209e65/566ab287/Interop.TDSI18NLib.DLL. LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/webui/f9209e65/566ab287/Interop.TDSI18NLib/Interop.TDSI18NLib.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Tridion/web/WebUI/WebRoot/bin/Interop.TDSI18NLib.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Tridion/web/WebUI/WebRoot/bin/Interop.TDSI18NLib/Interop.TDSI18NLib.DLL. LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/webui/f9209e65/566ab287/Interop.TDSI18NLib.EXE. LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/webui/f9209e65/566ab287/Interop.TDSI18NLib/Interop.TDSI18NLib.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Tridion/web/WebUI/WebRoot/bin/Interop.TDSI18NLib.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Tridion/web/WebUI/WebRoot/bin/Interop.TDSI18NLib/Interop.TDSI18NLib.EXE.
Updated - Screenshot of the Error
The error from HTML as suggested by Frank.
System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Tridion.ContentManager.CoreService.Client, Version=6.1.0.996, Culture=neutral, PublicKeyToken=ddfc895746e5ee6b' or one of its dependencies. The system cannot find the file specified.
File name: 'Tridion.ContentManager.CoreService.Client, Version=6.1.0.996, Culture=neutral, PublicKeyToken=ddfc895746e5ee6b'
at System.Signature.GetSignature(SignatureStruct& signature, Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
at System.Signature..ctor(IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
at System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters()
at System.Reflection.RuntimeMethodInfo.GetParameters()
at System.ServiceModel.Description.ServiceReflector.ValidateParameterMetadata(MethodInfo methodInfo)
at System.ServiceModel.Description.TypeLoader.CreateOperationDescriptions(ContractDescription contractDescription, ContractReflectionInfo reflectionInfo, Type contractToGetMethodsFrom, ContractDescription declaringContract, MessageDirection direction)
at System.ServiceModel.Description.TypeLoader.CreateContractDescription(ServiceContractAttribute contractAttr, Type contractType, Type serviceType, ContractReflectionInfo& reflectionInfo, Object serviceImplementation)
at System.ServiceModel.Description.TypeLoader.LoadContractDescriptionHelper(Type contractType, Type serviceType, Object serviceImplementation)
at System.ServiceModel.Description.ContractDescription.GetContract(Type contractType)
at System.Web.Script.Services.WCFServiceClientProxyGenerator.GetClientProxyScript(Type contractType, String path, Boolean debugMode, ServiceEndpoint serviceEndpoint)
at System.Web.Script.Services.ProxyGenerator.GetClientProxyScript(Type type, String path, Boolean debug, ServiceEndpoint serviceEndpoint)
at Tridion.Web.UI.Core.CachedJsService.get_Contents()
at Tridion.Web.UI.Core.CachedJsService.WriteContents(HttpResponse response, List`1 writtenResources)
at Tridion.Web.UI.Core.CachedJsGroup.WriteContents(HttpResponse response, List`1 writtenResources)
at Tridion.Web.UI.Core.CachedJsPageResources.WriteContents(HttpResponse response, List`1 writtenResources)
at Tridion.Web.UI.Core.CachedJsControlResources.WriteContents(HttpResponse response)
at Tridion.Web.UI.Core.Common.HttpUtilities.OutputWithHTTPCacheHeaders(ICachedResource resource, Nullable`1 cacheDuration)
at Tridion.Web.UI.Controls.TridionPage.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable C:\Windows\SysWOW64\inetsrv\w3wp.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = NT AUTHORITY\NETWORK SERVICE
LOG: DisplayName = Tridion.ContentManager.CoreService.Client, Version=6.1.0.996, Culture=neutral, PublicKeyToken=ddfc895746e5ee6b
(Fully-specified)
LOG: Appbase = file:///C:/Program Files (x86)/Tridion/web/WebUI/WebRoot/
LOG: Initial PrivatePath = C:\Program Files (x86)\Tridion\web\WebUI\WebRoot\bin
Calling assembly : Tridion.UGC.Model, Version=6.1.0.205, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Program Files (x86)\Tridion\web\WebUI\WebRoot\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Tridion.ContentManager.CoreService.Client, Version=6.1.0.996, Culture=neutral, PublicKeyToken=ddfc895746e5ee6b
LOG: The same bind was seen before, and was failed with hr = 0x80070002.
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.DashboardView.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
The power tools are an open source project, and the issue tracker is available at:
http://code.google.com/p/tridion-2011-power-tools/issues
If you believe you have discovered a bug (or perhaps two), you can help the project team by reporting the problems there. (For bonus points - download the sources and work on a fix!)