StacyThomas
asked on
Silverlight in the GAC?
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.
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.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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. ScriptingS criptResou rceHandler Section' to type 'System.Web.Configuration. ScriptingS criptResou rceHandler Section'.
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.InvalidCastExceptio n: Unable to cast object of type 'System.Web.Configuration. ScriptingS criptResou rceHandler Section' to type 'System.Web.Configuration. ScriptingS criptResou rceHandler Section'.
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. ScriptingS criptResou rceHandler Section' to type 'System.Web.Configuration. ScriptingS criptResou rceHandler Section'.]
System.Web.Configuration.A pplication Settings.E nsureSecti onLoaded() +72
System.Web.Handlers.Script ResourceHa ndler.IsCo mpressionE nabled(Htt pContext context) +10
System.Web.Handlers.Runtim eScriptRes ourceHandl er.System. Web.Handle rs.IScript ResourceHa ndler.GetS criptResou rceUrl(Lis t`1 assemblyResourceLists, Boolean zip, Boolean notifyScriptLoaded) +44
System.Web.Handlers.Runtim eScriptRes ourceHandl er.System. Web.Handle rs.IScript ResourceHa ndler.GetS criptResou rceUrl(Ass embly assembly, String resourceName, CultureInfo culture, Boolean zip, Boolean notifyScriptLoaded) +152
System.Web.Handlers.Script ResourceHa ndler.GetS criptResou rceUrl(Ass embly assembly, String resourceName, CultureInfo culture, Boolean zip, Boolean notifyScriptLoaded) +37
System.Web.UI.ScriptManage r.GetScrip tResourceU rl(String resourceName, Assembly assembly) +105
System.Web.UI.ScriptRegist rationMana ger.Regist erClientSc riptResour ce(Control control, Type type, String resourceName) +113
System.Web.UI.ScriptManage r.System.W eb.UI.IScr iptManager .RegisterC lientScrip tResource( Control control, Type type, String resourceName) +14
System.Web.UI.ClientScript Manager.Re gisterClie ntScriptRe source(Con trol control, Type type, String resourceName) +53
System.Web.UI.WebControls. Menu.OnPre Render(Eve ntArgs e, Boolean registerScript) +113
System.Web.UI.WebControls. Menu.OnPre Render(Eve ntArgs e) +25
Microsoft.SharePoint.WebCo ntrols.Asp Menu.OnPre Render(Eve ntArgs e) +142
System.Web.UI.Control.PreR enderRecur siveIntern al() +80
System.Web.UI.Control.PreR enderRecur siveIntern al() +171
System.Web.UI.Control.PreR enderRecur siveIntern al() +171
System.Web.UI.Control.PreR enderRecur siveIntern al() +171
System.Web.UI.Control.PreR enderRecur siveIntern al() +171
System.Web.UI.Control.PreR enderRecur siveIntern al() +171
System.Web.UI.Control.PreR enderRecur siveIntern al() +171
System.Web.UI.Page.Process RequestMai n(Boolean includeStagesBeforeAsyncPo int, Boolean includeStagesAfterAsyncPoi nt) +842
Unable to cast object of type 'System.Web.Configuration.
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.InvalidCastExceptio
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.
System.Web.Configuration.A
System.Web.Handlers.Script
System.Web.Handlers.Runtim
System.Web.Handlers.Runtim
System.Web.Handlers.Script
System.Web.UI.ScriptManage
System.Web.UI.ScriptRegist
System.Web.UI.ScriptManage
System.Web.UI.ClientScript
System.Web.UI.WebControls.
System.Web.UI.WebControls.
Microsoft.SharePoint.WebCo
System.Web.UI.Control.PreR
System.Web.UI.Control.PreR
System.Web.UI.Control.PreR
System.Web.UI.Control.PreR
System.Web.UI.Control.PreR
System.Web.UI.Control.PreR
System.Web.UI.Control.PreR
System.Web.UI.Page.Process
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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!
Help?
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.ScriptManag er' to type 'Microsoft.PerformancePoin t.Scorecar ds.WebPart s.ScriptMa nagerLoade r'.
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.InvalidCastExceptio n: Unable to cast object of type 'System.Web.UI.ScriptManag er' to type 'Microsoft.PerformancePoin t.Scorecar ds.WebPart s.ScriptMa nagerLoade r'.
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.ScriptManag er' to type 'Microsoft.PerformancePoin t.Scorecar ds.WebPart s.ScriptMa nagerLoade r'.]
Microsoft.PerformancePoint .Scorecard s.WebParts .ScriptMan agerLoader .EnsureScr iptManager (Page page) +46
Microsoft.PerformancePoint .Scorecard s.WebParts .Parameter izableWebP art.OnInit (EventArgs e) +104
System.Web.UI.Control.Init Recursive( Control namingContainer) +333
System.Web.UI.Control.Adde dControl(C ontrol control, Int32 index) +198
System.Web.UI.ControlColle ction.Add( Control child) +80
Microsoft.PerformancePoint .Scorecard s.WebParts .Dashboard ItemWebPar t.CreateCh ildControl s() +536
System.Web.UI.Control.Ensu reChildCon trols() +87
System.Web.UI.Control.PreR enderRecur siveIntern al() +44
System.Web.UI.WebControls. WebParts.W ebPart.Pre RenderRecu rsiveInter nal() +42
System.Web.UI.Control.PreR enderRecur siveIntern al() +171
System.Web.UI.Control.PreR enderRecur siveIntern al() +171
System.Web.UI.Control.PreR enderRecur siveIntern al() +171
System.Web.UI.Control.PreR enderRecur siveIntern al() +171
System.Web.UI.Control.PreR enderRecur siveIntern al() +171
System.Web.UI.Page.Process RequestMai n(Boolean includeStagesBeforeAsyncPo int, Boolean includeStagesAfterAsyncPoi nt) +842
Unable to cast object of type 'System.Web.UI.ScriptManag
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.InvalidCastExceptio
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.ScriptManag
Microsoft.PerformancePoint
Microsoft.PerformancePoint
System.Web.UI.Control.Init
System.Web.UI.Control.Adde
System.Web.UI.ControlColle
Microsoft.PerformancePoint
System.Web.UI.Control.Ensu
System.Web.UI.Control.PreR
System.Web.UI.WebControls.
System.Web.UI.Control.PreR
System.Web.UI.Control.PreR
System.Web.UI.Control.PreR
System.Web.UI.Control.PreR
System.Web.UI.Control.PreR
System.Web.UI.Page.Process
ASKER
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?
However, I can't get to the PPS and PPM web.config files. Should I just install AJAX?
Shouldn't harm & could possibly solve it if some older code is involved.
ASKER
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-microso ft-com:asm .v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extension s" publicKeyToken="31bf3856ad 364e35" culture="neutral" />
<bindingRedirect oldVersion="1.0.61025.0" newVersion="3.5.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
Thanks!
<runtime>
<assemblyBinding xmlns="urn:schemas-microso
<dependentAssembly>
<assemblyIdentity name="System.Web.Extension
<bindingRedirect oldVersion="1.0.61025.0" newVersion="3.5.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
ASKER
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.