Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Error: Cannot create an object of type ... (Read 3946 times)
jgreen
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 27
Joined: Aug 12th, 2010
Error: Cannot create an object of type ...
Aug 17th, 2010 at 4:40pm
Print Post  
I have a project working great locally but when I upload it to a website I get the following error:

Parser Error:

Cannot create an object of type 'MindFusion.Drawing.Brush' from its string representation 's:#FFF5F5F5' for the 'BackBrush' property.


Project is copied into a folder off the root.
Bin folder and contents copied to root folder.
Web.config copied to root folder.

Here's the diagram code:

Code
Select All
<ndiag:DiagramView ID="dgvMain" runat="server" Height="600px" Width="100%"
                    Behavior="LinkShapes" BorderColor="#999966" BorderStyle="Solid"
                    AllowInplaceEdit="true" BorderWidth="1px"
                    DelKeyAction="DeleteSelectedItems" EnableClipboard="True"
                    MaxImageSize="0, 0" NodeClickedScript="onNodeClicked" >
                <Diagram AllowSelfLoops="False" LinkBaseShapeSize="7" Bounds="0, 0, 255, 1920"
                    ShowGrid="True" AllowSplitLinks="True" AutoResize="None"
                    EnableStyledText="True" GridColor="LightSlateGray"
                    GridOffsetX="0" GridOffsetY="0" GridSizeX="3.175" GridSizeY="12.7"
                    LinkTextStyle="Rotate" RoundedLinks="True" BackBrush="s:#FFF5F5F5"
                    ShapeBrush="s:#FFFFFFFF"  />
        </ndiag:DiagramView> 



Any idea what's going on?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Error: Cannot create an object of type ...
Reply #1 - Aug 17th, 2010 at 5:21pm
Print Post  
This is something that a type converter from mindfusion.common.dll should handle. Could you verify if that assembly has been copied to the server?
  
Back to top
 
IP Logged
 
jgreen
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 27
Joined: Aug 12th, 2010
Re: Error: Cannot create an object of type ...
Reply #2 - Aug 18th, 2010 at 1:35am
Print Post  
yes.

The following have been copied to the bin folder:

MindFusion.Common.dll (ver: 1.2.3764.24450)
MindFusion.Diagramming.dll (ver: 5.3.5.27109)
MindFusion.Diagramming.WebForms.dll (ver: 3.1.1.27174)
MindFusion.Graphs.dll (ver: 1.1.0.16661)
MindFusion.Svg.dll (ver: 1.0.3818.19150)

JDiagram.jar file copied to the folder containing the diagram file (default.aspx)
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Error: Cannot create an object of type ...
Reply #3 - Aug 18th, 2010 at 5:31am
Print Post  
So these are the .NET 3.5 NetDiagram assemblies, does your server run ASP.NET 3.5? Could you check if the page loads successfully if you remove the brush initializers from the aspx, and create brushes in the code-behind instead?
  
Back to top
 
IP Logged
 
jgreen
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 27
Joined: Aug 12th, 2010
Re: Error: Cannot create an object of type ...
Reply #4 - Aug 18th, 2010 at 3:19pm
Print Post  
Ok. Getting closer.

Yes, the site is setup for .Net 3.5.

I removed the brush initializers from the aspx and added to the code-behind
Code
Select All
        dgvMain.Diagram.BackBrush = New MindFusion.Drawing.SolidBrush(Color.WhiteSmoke)
        dgvMain.Diagram.ShapeBrush = New MindFusion.Drawing.SolidBrush(Color.White)
 


and got a little farther.

I'm now getting this error:
Security Exception

Exception Details
System.Security.SecurityException: Request failed.

Stack Trace:
Code
Select All
[SecurityException: Request failed.]
   MindFusion.Diagramming.RectangleFConverter.ConvertTo(ITypeDescriptorContext context, CultureInfo culture, Object value, Type destinationType) +0
   System.ComponentModel.TypeConverter.ConvertTo(Object value, Type destinationType) +16
   System.Web.Compilation.CodeDomUtility.GenerateExpressionForValue(PropertyInfo propertyInfo, Object value, Type valueType) +432
   System.Web.UI.SimplePropertyEntry.GetCodeStatement(BaseTemplateCodeDomTreeGenerator generator, CodeExpression ctrlRefExpr) +125
   System.Web.Compilation.BaseTemplateCodeDomTreeGenerator.BuildBuildMethodInternal(ControlBuilder builder, Type ctrlType, Boolean fInTemplate, Boolean topLevelControlInTemplate, PropertyEntry pse, CodeStatementCollection statements, Boolean fStandardControl, Boolean fControlFieldDeclared, String deviceFilter, Boolean fControlSkin) +2407
   System.Web.Compilation.BaseTemplateCodeDomTreeGenerator.BuildBuildMethod(ControlBuilder builder, Boolean fTemplate, Boolean fInTemplate, Boolean topLevelControlInTemplate, PropertyEntry pse, Boolean fControlSkin) +536
   System.Web.Compilation.BaseTemplateCodeDomTreeGenerator.BuildSourceDataTreeFromBuilder(ControlBuilder builder, Boolean fInTemplate, Boolean topLevelControlInTemplate, PropertyEntry pse) +1187
   System.Web.Compilation.BaseTemplateCodeDomTreeGenerator.BuildSourceDataTreeFromBuilder(ControlBuilder builder, Boolean fInTemplate, Boolean topLevelControlInTemplate, PropertyEntry pse) +1051
   System.Web.Compilation.BaseTemplateCodeDomTreeGenerator.BuildSourceDataTreeFromBuilder(ControlBuilder builder, Boolean fInTemplate, Boolean topLevelControlInTemplate, PropertyEntry pse) +552
   System.Web.Compilation.BaseTemplateCodeDomTreeGenerator.BuildSourceDataTreeFromBuilder(ControlBuilder builder, Boolean fInTemplate, Boolean topLevelControlInTemplate, PropertyEntry pse) +552
   System.Web.Compilation.TemplateControlCodeDomTreeGenerator.BuildMiscClassMembers() +61
   System.Web.Compilation.PageCodeDomTreeGenerator.BuildMiscClassMembers() +12
   System.Web.Compilation.BaseCodeDomTreeGenerator.BuildSourceDataTree() +920
   System.Web.Compilation.BaseCodeDomTreeGenerator.GetCodeDomTree(CodeDomProvider codeDomProvider, StringResourceBuilder stringResourceBuilder, VirtualPath virtualPath) +45
   System.Web.Compilation.BaseTemplateBuildProvider.GenerateCode(AssemblyBuilder assemblyBuilder) +102
   System.Web.Compilation.AssemblyBuilder.AddBuildProvider(BuildProvider buildProvider) +99
 



I added write permissions to the all the folders but didn't help.

What am I missing?

thanks,

John
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Error: Cannot create an object of type ...
Reply #5 - Aug 18th, 2010 at 3:32pm
Print Post  
Could you check at what security level does your application run? It seems the server refuses to load any of our custom type converters. In this case, move the Diagram.Bounds initialization from the aspx markup to the code-behind as work-around.

Stoyan
  
Back to top
 
IP Logged
 
jgreen
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 27
Joined: Aug 12th, 2010
Re: Error: Cannot create an object of type ...
Reply #6 - Aug 18th, 2010 at 5:47pm
Print Post  
The site's hosted at GoDaddy so I'm not sure what security level is setup but I removed the bounds settings from the aspx and added that to the page load as well and everything is working great now. thanks for your help!!

here's what I did for anyone else that may be having the same problem:

Default.aspx
Code
Select All
<ndiag:ShapeListBox ID="slbMain" runat="server" Style="background-color: white"
            Height="527px" Width="150px" JarLocation="JDiagram.jar">
</ndiag:ShapeListBox>

<ndiag:DiagramView ID="dgvMain" runat="server" Height="600px" Width="100%"
                    Behavior="LinkShapes" BorderColor="#999966" BorderStyle="Solid"
                    AllowInplaceEdit="true" BorderWidth="1px"
                    DelKeyAction="DeleteSelectedItems" EnableClipboard="True"
                    MaxImageSize="0, 0" NodeClickedScript="onNodeClicked" JarLocation="JDiagram.jar">
</ndiag:DiagramView>
 



Default.aspx.vb
Code
Select All
Imports MindFusion.Diagramming
Imports System.Drawing

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        If Not IsPostBack Then
            dgvMain.Diagram.BackBrush = New MindFusion.Drawing.SolidBrush(Color.WhiteSmoke)
            dgvMain.Diagram.ShapeBrush = New MindFusion.Drawing.SolidBrush(Color.White)

            dgvMain.Diagram.AllowSelfLoops = False
            dgvMain.Diagram.LinkBaseShapeSize = 7
            dgvMain.Diagram.Bounds = New System.Drawing.RectangleF(0, 0, 255, 1920)
            dgvMain.Diagram.ShowGrid = True
            dgvMain.Diagram.AllowSplitLinks = True
            dgvMain.Diagram.AutoResize = AutoResize.None
            dgvMain.Diagram.EnableStyledText = True
            dgvMain.Diagram.GridColor = Color.LightSlateGray
            dgvMain.Diagram.GridOffsetX = 0
            dgvMain.Diagram.GridOffsetY = 0
            dgvMain.Diagram.GridSizeX = 3.175
            dgvMain.Diagram.GridSizeY = 12.7
            dgvMain.Diagram.LinkTextStyle = LinkTextStyle.Rotate
            dgvMain.Diagram.RoundedLinks = True
        End If

    End Sub
 

  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint