web.config comments included in line error? - asp.net

I'm troubleshooting an app, and I have this error to work with:
Exception message: Could not load file or assembly 'This.File,
Version=1, Culture=neutral, PublicKeyToken=[sometoken]' or one of its
dependencies. Access is denied. (C:\Program Files[file
location]\web.config line 205
Now - is that exactly line 205 of the web.config file, or is that line 205 if all the comments and empty lines from the web.config are removed?
I've tried researching this but find it very tricky!
Thank you!

This error means that there is an assembly referenced in the web.config that the compiler cannot locate. There are tactics to troubleshoot this. First, if you have the DLL make sure it is referenced by your project.
If it is a library located some where on your test machine, you can use this tool from the .NET Framework SDK - Assembly Binding Log Viewer https://msdn.microsoft.com/en-us/library/e74a18c4(v=vs.110).aspx. This tool will tell you where .NET is looking when its trying to find your assembly.
If you want to load the assembly dynamically at run time, you can catch this error in code by handling the AssemblyResolve event on the current AppDomain: https://msdn.microsoft.com/en-us/library/system.appdomain.assemblyresolve(v=vs.110).aspx

Related

Unable to Initialize TDSE object. Could not load file or assembly 'Tridion.ContentManager.Publishing while accessing the Tridion UI

While opening the Tridion UI I am getting this error:
Unable to Initialize TDSE object. Could not load file or assembly 'Tridion.ContentManager.Publishing, Version=6.1.0.996, Culture=neutral, PublicKeyToken=360aac4d3354074b' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) The type initializer for 'Tridion.ContentManager.TypeRegistry' threw an exception.
Most probably you have some extension or something like this that you have copied from the network and your DLL get locked. You need to find this DLL and click Unblock from the context menu. You will most probably have to do it for all other copied dlls as well. It should look like this:
http://www.izenda.com/Site/KB/Uploads/Images/unblock.PNG
In case you have no idea where to look - use procmon
I would also double check Tridion.ContentManager.Publishing dll is in the GAC.
A quick way to see this is to look in c:\windows\assembly and match the version of the DLL as well. You could re-drag and drop the DLL there to make sure all is well.

asp.net error “The type 'typeName' exists in both ”temp1.dll“ and ”temp2.dll"

When I build a web site I haven't got errors, but when I try to publish site the error appears:
Type 'AttachmentsControl' exists in both в 'c:\Users\userName\AppData\Local\Temp\Temporary ASP.NET Files\web.ui.application\8c85983a\5425041a\App_Web_mivbsgll.dll' and 'c:\Users\userName\AppData\Local\Temp\Temporary ASP.NET Files\web.ui.application\8c85983a\5425041a\App_Web_dhvduebi.dll'
I tried to add the batch="false" attribute to the "compilation" element of the web.config file, but this didn't help.
Also I tried to rename one class, but in this case another error appears:
Server Error in '/projectName' Application.
Thread was being aborted.
Can anybody help me?
P.S.: the most strangest thing is that I get this project from MS TFS, my colleague who add this project to TFS publish this site without errors.
Most probably the reason could be you are uploading the source files along with compiled published output and at the same time the source files are modified.
When you see this error, what asp.net is trying to do is, compile the files and create the application and the result is, you have two type declaration of same name, one in the dll and one in the source.
Try to delete the dll file you have uploaded (from the bin directory), it should resolve the issue.

Could not load file or assembly when trying to remove/delete Resource/Application

I have a Biztalk application that is basically a housing for a schema that other applications are using. I now want to remove this application, but am unable to from the BizTalk Server Admin Console, when I right-click --> Remove I get an error that says
Could not load file or assembly <assembly_name>.dll or one of its dependencies. The system cannot find the path specified (mscorlib)
followed by:
The system cannot find the path specified (Exception from HRESULT: 0x80070003)
So I go to remove the assembly from the Application and get the exact same error. I remove all references to it in other biztalk resources and still the same error when trying to delete the application or resource. I did notice that in the Modify Resouces dialog of referencing assemblies, this rogue assembly is listed as a dependency status of Not Found.
The strange thing is, when Messages come through, the resources which depend on the rogue assembly, still work fine and no errors are thrown (despite them using components of the assembly which shows as Not Found).
I have made sure to check the GAC and the assembly is loaded to it.
So now I have to ask:
where is Biztalk actually looking for this assembly?
is there a way I can just force a deletion of this application?
why does it care if the assembly is not found, when I'm trying to delete it?
why does it show as Not Found, yet still work?
Thanks.
I think the key is "or one of its dependencies." If it's a dependency it may be using the standard windows mechanism for finding a dll. It searches the current directory and the windows directory for them.
"where is Biztalk actually looking for this assembly?"
Look in the 'resources' section of your application in the biztalk management console. It shows a column with the location of the assembly.
I'd stop all the host instances/orchestrations, and then unload all your stuff from the GAC - if messages are actually still going through then stuff is still loaded that is using your schema.

Error migrating Tridion 2009 Event System to Tridion 2011 SP1

After adding my existing Tridion 2009 event DLL's (compiled on 2011 server) to bin directory and registering DLL in Content Manager Config file the GUI now returns the error below. I have checked event logs, Tridion logs etc for more details on the 'missing dependency' anyone any ideas?
Could not load file or assembly 'Tridion.Extensions.Events, Version=1.0.20.521,
Culture=neutral, PublicKeyToken=ecb60dbe3cbb7440' or one of its dependencies.
The system cannot find the file specified.
Unable to get LangID of User (tcm:0-2851-65552). Initialization of the extension
'C:\Program Files (x86)\Tridion\bin\Tridion.Extensions.Events.MDO.dll' failed.
System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly,ObjectHandleOnStack)
System.Reflection.RuntimeAssembly.GetExportedTypes()
Tridion.ContentManager.Extensibility.TcmExtension.LoadExtensions()
Tridion.ContentManager.Extensibility.TcmExtension.LoadExtensions()
Tridion.ContentManager.Extensibility.TcmExtension.InitializeExtensions()
Tridion.ContentManager.Extensibility.EventSystem.DeliverEvent(IEnumerable`1,TcmEventArgs,EventDeliveryPhase)
Tridion.ContentManager.Extensibility.EventSystem.DeliverEvent(IdentifiableObject,TcmEventArgs,EventDeliveryPhase) Tridion.ContentManager.IdentifiableObject.Load(LoadFlags,Boolean)
Tridion.ContentManager.IdentifiableObject.Load(LoadFlags)
Tridion.ContentManager.BLFacade.IdentifiableObjectFacade.Read(UserContext,String,XMLReadFilter) XMLState.GetPropertyElem XMLState.GetProperty User.LangID
It looks like you have two assemblies: Tridion.Extensions.Events.dll and Tridion.Extensions.Events.MDO.dll. Since you refer to TcmExtension DLLs by their full path in the Tridion.ContentManager.config, you cannot have one that depends on another in the same directory.
The solution is to put the "shared library" (probably Tridion.Extensions.Events.MDO.dll for you) in the GAC.
Fortunately, .NET assemblies contain all the dependency information you need in their metadata. Faced with this problem, I would generally try to open up the assembly with a tool that can read this, for example, ILDASM, or IlSpy. That gives you a concrete list of things to look for, instead of the vague and mysterious "or one of its dependencies".
An alternative approach is to use FUSLOGVW to monitor where the .NET runtime is looking for assemblies.

Assembly loading error in my ASP.NET app, and the assembly isn't even referenced anymore

I had some code that referenced the Noesis.Javascript assembly (http://javascriptdotnet.codeplex.com) and had renamed the Noesis.Javascript.dll to Noesis.Javascript.0.4.dll. I referenced this file through Visual Studio, and when I launched my web app in the ASP.NET development server, I got this error:
Could not load file or assembly
'Noesis.Javascript.0.4' or one of its
dependencies. The located assembly's
manifest definition does not match the
assembly reference. (Exception from
HRESULT: 0x80131040)
I then tried to remove this reference and re-reference the older version of the library. I got the same error. I then tried to remove this reference entirely and comment out all code that used this library. I still get the same error. I have tried to explicitly close out the ASP.NET development server from its icon in the system tray, but this still occurs. I can find no reference of this assembly anywhere in my project now, yet the error persists. What might be happening? Is there some cache that I'm not finding? How can I resolve this error?
Go into the registry and set [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Refresh the page and the error output will show you which assembly has a dependency on Noesis.Javascript.0.4.
Check if "Noesis.Javascript.0.4" appears anywhere in your web.config file and remove it if it does. It might be in the <assemblies> part.
remove the reference and add it again. Please note that the two dll version must be same. Do not add any later version, if its get registered into your web.config, otherwise you need to remove from there too.
In my case, I added a wrong DLL. Instead of adding 64bit, I added 32bit.
Thanks,

Resources