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

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.

Related

Updating BizTalk Application - ApplicationNode failed

I have two BizTalk applications. I updated the source code for 1 of them, checked it in TFS and it's ready to go. I've read that I have to delete the application that's currently there, so I exported msi, and bindings. The application is NOT in the control panel to remove so I went to BizTalk to delete it. I'm getting an error, Delete of ApplicationNode failed and that I have to "Remove assembly, first, it references assembly etc... " I tired to remove the assembly from Resources but it's throwing the same error.
The code change I made was a hard coded address that need updating. I have to go through all of this to update a BizTalk Application?

Unable to load DLL 'xmogrt': from Tridion metadata query

I'm trying to use the CustomMetaKeyCriteria class to pull back content from the Broker DB based upon some metadata I set up. However, I get the error listed below. Any ideas? That dll is in my bin folder & I confirmed it is the 32 bit version, as this code is running on a 32 bit box. I missed some set up obviously, but what?
Unable to load DLL 'xmogrt': The specified module could not be found.
(Exception from HRESULT: 0x8007007E)
Check if you have the rest of the dll dependencies for this file?
In my install folder for x86 I see the following DLLs:
MSVCP71.dll
MSVCR71.dll
netrtsn.dll
Tridion.ContentDelivery.Configuration.dll
Tridion.ContentDelivery.dll
Tridion.ContentDelivery.Interop.dll
xmogrt.dll
EDIT: And the following Tridion jars:
cd_broker
cd_cache
cd_core
cd_datalayer
cd_deployer
cd_linking
cd_model
cd_tcdl (not usually needed)
You should probably check cd_core_log for additional details, maybe you're missing one of the 3rd party jars.
Your DLL may be blocked if you copied it from a network location. Try right clicking on the DLL > Properties > Unblock

ASP.NET MVC 2.0 NHibernate Configure() issue

I have installed NHibernate for my ASP.NET web app although I'm getting a problem in real-time on the following line of code:
if (_sessionFactory == null)
{
_sessionFactory = new Configuration().Configure().BuildSessionFactory();
}
Looking at the inner exception the problem is this:
{"Could not find file 'D:\Websites\Test\Test\Test\bin\hibernate.cfg.xml'.":"D:\Websites\Test\Test\Test\bin\hibernate.cfg.xml"}
This makes sense, as the file doesnt exist in that location. This line of code is within my Core project. File hibernate.cfg.xml is currently in my Infrastucture project, not my Core. Should this be? I have copied the file into this location although I still get problems. If I manually copy the file into this location within windows explorer I then get the following error during runtime.
{"Could not load file or assembly
'Infrastructure' or one of its
dependencies. The system cannot find
the file specified.":"Infrastructure"}
Also, I'm missing DynamicProxy.dll as I'm using castle and I couldnt see a version of the DynamicProxy in the castle folder that I downloaded from http://sourceforge.net/projects/nhibernate/
any suggestions? I can see LinFu.DynamicProxy.dll within the download although it says I only need one of the folders, Linfu or Castle, and I'm using Castle for this experiment. Not sure if this has anything to do with it, just thought it might help.
any ideas? Many thanks,
James
About "Could not find hibernate.cfg.xml": you can either set it to "Copy to Output" (see this) or configure it as an embedded resource.
About "Could not load assembly Infrastructure": you're missing Infrastructure.dll in your bin, or one of its dependencies, just as the error says.
About missing DynamicProxy.dll: if you're using NHibernate 3.x all you need to use the Castle bytecode provider is NHibernate.ByteCode.Castle.dll and Castle.Core.dll

Updating DotNetNuke module from another app

I have several DNN modules that I wish to update silently, using the portal's built-in module upgrade facilities called from a separate application, in this case a Windows service. I was able to make it all work with version 4.3 of the portal by modifying the DNN source in key areas to allow DotNetNuke.dll to function outside of a web application. I'm now trying to do the same thing with the 4.9.0 source code and I'm having problems.
Everything works fine until DNN tries to read from the database. I have my Windows service project, the DNN library project, and several other related projects loaded in one VS solution (the additional projects are the same ones that are in the main solution file provided with the DNN source). I call PaInstaller.Install in my service to update each module. Execution gets to reflection.vb and then it tries to create a DotNetNuke.Data.SqlDataProvider object based on the type name. It raises an exception when calling System.Web.Compilation.BuildManager.GetType. The exception says:
Could not load type 'DotNetNuke.Data.SqlDataProvider' from assembly 'System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
I read this to mean it simply couldn't locate the DotNetNuke.SqlDataProvider.dll assembly. What's strange is that assembly is in the Bin folder for the DNN library project, and I also have it in the folder where my Windows service is running. The actual SqlDataProvider project is also loaded in the solution. I can't for the life of me understand why the runtime environment can't locate the assembly.
Has anyone tried something like this before, or know what could cause an assembly not to be found while stepping through the DNN source? Am I better off using something other than BuildManager.GetType to get an instance of the SQL provider type?
Chris,
Honestly depending on your needs, I would look at doing this a different way, as this is going to be very fragile with each DNN upgrade that happens in the future.
I'd look more towards using the "bulk install" option that DNN already has. Have your service upload the module zips to the /install/modules folder, then from there, call /install/install.aspx?mode=installresources and you are done!
If you need a third party solution to parse the results, have your windows service go through and pull the HTML response and parse it to validate success.

Weird MethodNotFound exception when renaming a property - related to asp.net / web forms / fluentnhibernate and visual studio

I have a local website which I run through Visual Studio 2008's internal development web server (through the run / compile button).
I have an external library which is referenced on a page of that website and resides inside the web site's "bin" folder.
I've recently changed a class' property name inside that library (renaming it, from "ValidFrom" to "VisibleFrom"), recompiled its dll and have overwritten the original dll inside the bin folder.
This class is mapped with FluentNHibernate, I've also changed the mappings and recompiled / redeployed the library.
When I try to run the site and navigate to the page where the library is used, I'm getting a MethodNotFound exception for the method get_ValidFrom, related to FluentNHibernate's configuration call. This should be get_VisibleFrom now!
Now I've reconfigured my NHibernate SessionProvider so that it generates a new Configuration for NHibernate on each call, and does not retrieve it from the Http Session entity like it did before, because I figured there might lie the problem.
I'm still getting the exception however. I've then deleted the Temporary ASP.NET folder's content... but I'm still getting the error.
Where is the generated schema for NHibernate stored, when using FluentNHibernate?
Anyone knows where else this could somehow be cached?
Thanks
FNH does not cache the schema, it is generated on-the-fly when you make a call to Fluently.Configure() and the schema is passed directly into an NHibernate Configuration object which is used to build an ISessionFactory.
Try clearing out all compiled objects/libraries/executables, removing the reference to your library from all projects that use it, add it back in, and then re-compile everything. Also check your all your code for "magic strings" that may be referencing this property or causing it to be referenced by the old name.
If that doesn't work, it might be helpful to see a stack trace to get an idea of what is being called from where.

Resources