Can you post a screenshot of the properties of the dll in the assembly folder AND also cut and paste the safecontrol entry in your web.config.
Another stab in the dark...are you modifying the correct web.config? Is this a single server farm? Jeremy Thake Readify | Senior Consultant M: +61 400 767 022 | E: jeremy.th...@readify.net<mailto:jeremy.th...@readify.net> | W: www.readify.net<http://www.readify.net/> From: ozmoss@ozmoss.com [mailto:ozm...@ozmoss.com] On Behalf Of Chris Milne Sent: Tuesday, 28 July 2009 2:36 PM To: ozmoss@ozmoss.com Subject: RE: Web part with dll reference Ahoy, No change since last post: Web Part Error: A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe. Show Error Details<http://dvsdev001/chris/default.aspx> Hide Error Details<http://dvsdev001/chris/default.aspx> [UnsafeControlException: A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe.] at Microsoft.SharePoint.ApplicationRuntime.SafeControls.GetTypeFromGuid(Guid guid) at Microsoft.SharePoint.WebPartPages.SPWebPartManager.CreateWebPartsFromRowSetData(Boolean onlyInitializeClosedWebParts) AFAIK they are both marked as safe. Kind regards, Chris Milne -----Original Message----- From: ozmoss@ozmoss.com [mailto:ozm...@ozmoss.com] On Behalf Of chris_py_...@manulife.com Sent: Tuesday, 28 July 2009 4:27 PM To: ozmoss@ozmoss.com Cc: ozmoss@ozmoss.com Subject: RE: Web part with dll reference all good mate :) btw back to your problem, does call stack give away what could be wrong with the web part? "Chris Milne" <chris.mi...@data aspects.com.au> To Sent by: <ozmoss@ozmoss.com<mailto:ozmoss@ozmoss.com>> ozmoss@ozmoss.com<mailto:ozmoss@ozmoss.com> cc Subject 07/28/2009 02:25 RE: Web part with dll reference PM Please respond to ozmoss@ozmoss.com<mailto:ozmoss@ozmoss.com> Hey Chris(tian) :) Nope, the externally-referenced assembly doesn't reference any other external assemblies, it only uses standard System namespace stuff. A tempting approach to install the external one separately, but I think in my case it'd be ideal to deploy them together. The external one is just a library that would never be used as a feature on its own, it would only be used when packaged with something else, a web part/workflow/something. I see where you're coming from though, I'll keep it in mind as an alternative. Cheers. Kind regards, Chris -----Original Message----- From: ozmoss@ozmoss.com [mailto:ozm...@ozmoss.com] On Behalf Of chris_py_...@manulife.com Sent: Tuesday, 28 July 2009 4:03 PM To: ozmoss@ozmoss.com Cc: ozmoss@ozmoss.com Subject: RE: Web part with dll reference chris, i think he meant your external reference assembly probably reference to another external reference assembly. I wouldnt deploy the external reference assembly with your solution but instead install them separately (if there is installation for it) but as jeremy suggested you can add the safe control entry from your deployment, but that's just me. BTW there are 4 chris' here LOL regards christian "Chris Milne" <chris.mi...@data aspects.com.au> To Sent by: <ozmoss@ozmoss.com<mailto:ozmoss@ozmoss.com>> ozmoss@ozmoss.com<mailto:ozmoss@ozmoss.com> cc Subject 07/28/2009 01:56 RE: Web part with dll reference PM Please respond to ozmoss@ozmoss.com<mailto:ozmoss@ozmoss.com> Hey Chris, Worth a shot, but no, all references in that project are System.*. Cheers. Kind regards, Chris From: ozmoss@ozmoss.com [mailto:ozm...@ozmoss.com] On Behalf Of Chris Tomich Sent: Tuesday, 28 July 2009 3:51 PM To: ozmoss@ozmoss.com Subject: Re: Web part with dll reference Hi Chris, Shot in the dark here but does your externally referenced assembly have references to other assemblies that you aren't deploying? Kind Regards, Chris Tomich On Tue, Jul 28, 2009 at 1:44 PM, Chris Milne < chris.mi...@dataaspects.com.au<mailto:chris.mi...@dataaspects.com.au>> wrote: Thanks Jeremy [update: and Sezai]. Yep, sorry, ‘tis VSeWSS 1.3 CTP using WSP. Copy Local is set to true on my reference and it does indeed deploy both my web part and referenced assembly to c:\windows\assembly\. I tried manually adding a <SafeControl> entry to the web.config for my referenced assembly to no avail, same result. Also found in SP log: http://server/chris/default.aspx - An unexpected error has been encountered in this Web Part. Error: This page has encountered a critical error. Contact your system administrator if this problem persists. which unfortunately is no more exciting than what I’m seeing on the page. Have followed this post to turn on extra debug info, am now seeing this on page: Web Part Error: A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe. Show Error Details Hide Error Details [UnsafeControlException: A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe.] at Microsoft.SharePoint.ApplicationRuntime.SafeControlsGetTypeFromGuid (Guid guid) at Microsoft.SharePoint.WebPartPages.SPWebPartManager.CreateWebPartsFromRow SetData (Boolean onlyInitializeClosedWebParts) So not found or not safe.. hmm. Both assemblies now have <SafeControl> entries and are in c:\windows\assembly\. In my external library, my assembly name is the same as my default namespace, is this allowed/problematic? Kind regards, Chris From: ozmoss@ozmoss.com [mailto:ozm...@ozmoss.com] On Behalf Of Jeremy Thake Sent: Tuesday, 28 July 2009 3:01 PM To: ozmoss@ozmoss.com Subject: RE: Web part with dll reference So are you using the VSeWSS 1.3 CTP when you say Visual Studio projects? I’m assuming you must be using a WSP if its automatically adding the SafeControl entry. The reason you’re probably getting this error is because you need to ensure you deploy the external library with the package. To do this, ensure you have Copy Local set to true in the properties. If it’s VSeWSS you’re using, you can check the manifest.xml file and see whether an Assembly element has been added for it. Also you can check it’s deployed by going to c:\windows \assembly and ensuring the dll is in there ;-) Jeremy Thake Readify | Senior Consultant M: +61 400 767 022 | E: jeremy.th...@readify.net<mailto:jeremy.th...@readify.net> | W: www.readify.net<http://www.readify.net> From: ozmoss@ozmoss.com [mailto:ozm...@ozmoss.com] On Behalf Of Chris Milne ________________________________ Support procedure: https://www.codify.com/lists/support List address: ozmoss@ozmoss.com Subscribe: ozmoss-subscr...@ozmoss.com<mailto:ozmoss-subscr...@ozmoss.com> Unsubscribe: ozmoss-unsubscr...@ozmoss.com<mailto:ozmoss-unsubscr...@ozmoss.com> List FAQ: http://www.codify.com/lists/ozmoss Other lists you might want to join: http://www.codify.com/lists oPlainText>Sent: Tuesday, 28 July 2009 12:41 PM To: ozmoss@ozmoss.com<mailto:ozmoss@ozmoss.com> Subject: Web part with dll reference Afternoon all, I’m developing a web part in which I would like to reference functionality that exists in one of our other company Visual Studio projects (.net assembly/dll). I’m having trouble doing this and hoping someone can point me in the right direction J I’ve created a simple VS web part project which works if I deploy it just by itself (not using the library functionality). I then added a reference to my dll, added a ‘using’ to import the namespace into my code (if I deploy again at this point it still works), but if I add one line of code that uses the external library into CreateChildControls() and deploy, I get a generic ‘Error An Unexpected error has occurred’ message on a page the webpart exists on. Visual Studio is automatically adding a <SafeControl Assembly=..> to my web.config for my web part assembly but not the external library assembly, do I need to add that? Both assemblies are automatically being added to the GAC. Any help is appreciated! Kind regards, Chris Support procedure: https://www.codify.com/lists/support List address: ozmoss@ozmoss.com<mailto:ozmoss@ozmoss.com> Subscribe: ozmoss-subscr...@ozmoss.com<mailto:ozmoss-subscr...@ozmoss.com> Unsubscribe: ozmoss-unsubscr...@ozmoss.com<mailto:ozmoss-unsubscr...@ozmoss.com> List FAQ: http://www.codify.com/lists/ozmoss Other lists you might want to join: http://www.codify.com/lists Support procedure: https://www.codify.com/lists/support List address: ozmoss@ozmoss.com<mailto:ozmoss@ozmoss.com> Subscribe: ozmoss-subscr...@ozmoss.com<mailto:ozmoss-subscr...@ozmoss.com> Unsubscribe: ozmoss-unsubscr...@ozmoss.com<mailto:ozmoss-unsubscr...@ozmoss.com> List FAQ: http://www.codify.com/lists/ozmoss Other lists you might want to join: http://www.codify.com/lists Support procedure: https://www.codify.com/lists/support List address: ozmoss@ozmoss.com<mailto:ozmoss@ozmoss.com> Subscribe: ozmoss-subscr...@ozmoss.com<mailto:ozmoss-subscr...@ozmoss.com> Unsubscribe: ozmoss-unsubscr...@ozmoss.com<mailto:ozmoss-unsubscr...@ozmoss.com> List FAQ: http://www.codify.com/lists/ozmoss Other lists you might want to join: http://www.codify.com/lists Support procedure: https://www.codify.com/lists/support List address: ozmoss@ozmoss.com<mailto:ozmoss@ozmoss.com> Subscribe: ozmoss-subscr...@ozmoss.com<mailto:ozmoss-subscr...@ozmoss.com> Unsubscribe: ozmoss-unsubscr...@ozmoss.com<mailto:ozmoss-unsubscr...@ozmoss.com> List FAQ: http://www.codify.com/lists/ozmoss Other lists you might want to join: http://www.codify.com/lists Support procedure: https://www.codify.com/lists/support List address: ozmoss@ozmoss.com<mailto:ozmoss@ozmoss.com> Subscribe: ozmoss-subscr...@ozmoss.com<mailto:ozmoss-subscr...@ozmoss.com> Unsubscribe: ozmoss-unsubscr...@ozmoss.com<mailto:ozmoss-unsubscr...@ozmoss.com> List FAQ: http://www.codify.com/lists/ozmoss Other lists you might want to join: http://www.codify.com/lists ===================================================================== Disclaimer: This message is intended only for the use of the person to whom it is expressly addressed and may contain information that is confidential and legally privileged. If you are not the intended recipient, you are hereby notified that any use, reliance on, reference to, review, disclosure or copying of the message and the information it contains for any purpose is prohibited. If you have received this message in error, please notify the sender by reply e-mail of the misdelivery and delete all its contents. Opinions, conclusions and other information in this message that do not relate to the official business of the Company shall be understood as neither given nor endorsed by it.--------------------------------------------------------------------- ----------- Support procedure: http://www.codify.com/lists/support List address: ozmoss@ozmoss.com<mailto:ozmoss@ozmoss.com> Subscribe: ozmoss-subscr...@ozmoss.com<mailto:ozmoss-subscr...@ozmoss.com> Unsubscribe: ozmoss-unsubscr...@ozmoss.com<mailto:ozmoss-unsubscr...@ozmoss.com> List FAQ: http://www.codify.com/lists/ozmoss Other lists you might want to join: http://www.codify.com/lists -------------------------------------------------------------------------- ------ Support procedure: http://www.codify.com/lists/support List address: ozmoss@ozmoss.com<mailto:ozmoss@ozmoss.com> Subscribe: ozmoss-subscr...@ozmoss.com<mailto:ozmoss-subscr...@ozmoss.com> Unsubscribe: ozmoss-unsubscr...@ozmoss.com<mailto:ozmoss-unsubscr...@ozmoss.com> List FAQ: http://www.codify.com/lists/ozmoss Other lists you might want to join: http://www.codify.com/lists ===================================================================== Disclaimer: This message is intended only for the use of the person to whom it is expressly addressed and may contain information that is confidential and legally privileged. If you are not the intended recipient, you are hereby notified that any use, reliance on, reference to, review, disclosure or copying of the message and the information it contains for any purpose is prohibited. If you have received this message in error, please notify the sender by reply e-mail of the misdelivery and delete all its contents. Opinions, conclusions and other information in this message that do not relate to the official business of the Company shall be understood as neither given nor endorsed by it.-------------------------------------------------------------------------------- Support procedure: http://www.codify.com/lists/support List address: ozmoss@ozmoss.com<mailto:ozmoss@ozmoss.com> Subscribe: ozmoss-subscr...@ozmoss.com<mailto:ozmoss-subscr...@ozmoss.com> Unsubscribe: ozmoss-unsubscr...@ozmoss.com<mailto:ozmoss-unsubscr...@ozmoss.com> List FAQ: http://www.codify.com/lists/ozmoss Other lists you might want to join: http://www.codify.com/lists -------------------------------------------------------------------------------- Support procedure: http://www.codify.com/lists/support List address: ozmoss@ozmoss.com Subscribe: ozmoss-subscr...@ozmoss.com Unsubscribe: ozmoss-unsubscr...@ozmoss.com List FAQ: http://www.codify.com/lists/ozmoss Other lists you might want to join: http://www.codify.com/lists