Solved

Silverlight in the GAC?

Posted on 2009-07-08
10
1,042 Views
Last Modified: 2013-11-12
I have tried to get a Silverlight web part to work in SharePoint, but each time I add the web part to the page, I get the SharePoint error message.  Here's the tutorial I just followed: http://blogs.msdn.com/andreww/archive/2009/03/12/silverlight-web-part-in-sharepoint.aspx

The only thing I think I'm missing is System.Web.Silverlight in the GAC, but I can't for the life of me figure out how to do that.  When I try to add it using .NET Configuration 1.1, I get an error messge that says: Unable to add the selected assembly.  The assembly must have a strong name (name, version, and public key).

I'm running Windows Server 2003 on a Virtual Machine.

0
Comment
Question by:StacyThomas
  • 6
  • 3
10 Comments
 
LVL 16

Assisted Solution

by:TSmooth
TSmooth earned 150 total points
ID: 24805946
Try using the gacutil:
http://msdn.microsoft.com/en-us/library/dkkx7f79(VS.71).aspx

Note that from the article you linked, that will need to be done on the sharepoint server, not your local machine (unless they are one in the same)
0
 

Author Comment

by:StacyThomas
ID: 24806341
Thanks for the response!

I ran gacutil from the Visual Studio Command Prompt (couldn't get it to work from Run --> cmd) and it said it was successfully added.  However, i'm still getting the same error in SharePoint when I try to add the web part, and the .NET Configuration still doesn't show it in the Assembly Cache (I did refresh), and I still get the same error when I try to add it in there.  I am doing all of this on the server running SharePoint.
0
 

Author Comment

by:StacyThomas
ID: 24806472
Found a website to set web.config so SharePoint can give more meaningful error messages, and this is the error I'm getting:

Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection' to type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection'.
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.InvalidCastException: Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection' to type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace:


[InvalidCastException: Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection' to type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection'.]
   System.Web.Configuration.ApplicationSettings.EnsureSectionLoaded() +72
   System.Web.Handlers.ScriptResourceHandler.IsCompressionEnabled(HttpContext context) +10
   System.Web.Handlers.RuntimeScriptResourceHandler.System.Web.Handlers.IScriptResourceHandler.GetScriptResourceUrl(List`1 assemblyResourceLists, Boolean zip, Boolean notifyScriptLoaded) +44
   System.Web.Handlers.RuntimeScriptResourceHandler.System.Web.Handlers.IScriptResourceHandler.GetScriptResourceUrl(Assembly assembly, String resourceName, CultureInfo culture, Boolean zip, Boolean notifyScriptLoaded) +152
   System.Web.Handlers.ScriptResourceHandler.GetScriptResourceUrl(Assembly assembly, String resourceName, CultureInfo culture, Boolean zip, Boolean notifyScriptLoaded) +37
   System.Web.UI.ScriptManager.GetScriptResourceUrl(String resourceName, Assembly assembly) +105
   System.Web.UI.ScriptRegistrationManager.RegisterClientScriptResource(Control control, Type type, String resourceName) +113
   System.Web.UI.ScriptManager.System.Web.UI.IScriptManager.RegisterClientScriptResource(Control control, Type type, String resourceName) +14
   System.Web.UI.ClientScriptManager.RegisterClientScriptResource(Control control, Type type, String resourceName) +53
   System.Web.UI.WebControls.Menu.OnPreRender(EventArgs e, Boolean registerScript) +113
   System.Web.UI.WebControls.Menu.OnPreRender(EventArgs e) +25
   Microsoft.SharePoint.WebControls.AspMenu.OnPreRender(EventArgs e) +142
   System.Web.UI.Control.PreRenderRecursiveInternal() +80
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842

 
0
 
LVL 23

Assisted Solution

by:Admin3k
Admin3k earned 350 total points
ID: 24806511
Not sure of your setup , but are you sure .NET configuration 1.1 is the one you should be using ?
I think the one for version 2 that comes with the SDK is the one to use if you are running versions 2.0 or 3.0 & 3.5 of the .NET framewok
http://www.microsoft.com/downloads/details.aspx?FamilyID=fe6f2099-b7b4-4f47-a244-c96d69c35dec&displaylang=en
you can also try to drag & drop the assembly directly to the GAC folder on the file system C:\Windows\Assembly

0
 

Author Comment

by:StacyThomas
ID: 24806535
Good call, Admin3k.  Opened up .NET Configuration 2.0 and the dll is indeed in the GAC.  However, I'm still getting the error posted above.

Help?

Thanks!
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 23

Accepted Solution

by:
Admin3k earned 350 total points
ID: 24806582
a thread that goes into possible resolution for this exact Asp.net elated error
http://forums.asp.net/p/1171570/1971496.aspx
0
 

Author Comment

by:StacyThomas
ID: 24806784
Thanks, Admin3k.  I added the code to my web.config file, and now I'm getting a different error:

Unable to cast object of type 'System.Web.UI.ScriptManager' to type 'Microsoft.PerformancePoint.Scorecards.WebParts.ScriptManagerLoader'.
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.InvalidCastException: Unable to cast object of type 'System.Web.UI.ScriptManager' to type 'Microsoft.PerformancePoint.Scorecards.WebParts.ScriptManagerLoader'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace:


[InvalidCastException: Unable to cast object of type 'System.Web.UI.ScriptManager' to type 'Microsoft.PerformancePoint.Scorecards.WebParts.ScriptManagerLoader'.]
   Microsoft.PerformancePoint.Scorecards.WebParts.ScriptManagerLoader.EnsureScriptManager(Page page) +46
   Microsoft.PerformancePoint.Scorecards.WebParts.ParameterizableWebPart.OnInit(EventArgs e) +104
   System.Web.UI.Control.InitRecursive(Control namingContainer) +333
   System.Web.UI.Control.AddedControl(Control control, Int32 index) +198
   System.Web.UI.ControlCollection.Add(Control child) +80
   Microsoft.PerformancePoint.Scorecards.WebParts.DashboardItemWebPart.CreateChildControls() +536
   System.Web.UI.Control.EnsureChildControls() +87
   System.Web.UI.Control.PreRenderRecursiveInternal() +44
   System.Web.UI.WebControls.WebParts.WebPart.PreRenderRecursiveInternal() +42
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842

 
0
 

Author Comment

by:StacyThomas
ID: 24806866
Ugh...I found this link: http://blogs.msdn.com/fooshen/archive/2008/10/18/performance-point-server-2007-and-ajax-on-sharepoint.aspx

However, I can't get to the PPS and PPM web.config files.  Should I just install AJAX?
0
 
LVL 23

Expert Comment

by:Admin3k
ID: 24806931
Shouldn't harm & could possibly solve it if some older code is involved.

0
 

Author Comment

by:StacyThomas
ID: 24813299
Oddly, the web page shared a part from PerformancePoint dashboard.  Taking that out (in addition to adding the lines below to the main web.config as well as the web.configs in PPSMonitoring - Preview and PPSMonitoring - Web Service) solved the problem.

Thanks!

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="1.0.61025.0" newVersion="3.5.0.0" />
      </dependentAssembly>
    </assemblyBinding>
</runtime>
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
Learn about cloud computing and its benefits for small business owners.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now