Forum  Commercial Foru...  Commercial Foru...  Can't build VWG library anymore
Previous Previous
 
Next Next
New Post 2/22/2012 7:51 AM
  infotrac
29 posts
No Ranking


Can't build VWG library anymore 

Hi,

I am getting this error, when trying to build a VWG library with some controls that I have created.

Error    1    The "GenerateResource" task failed unexpectedly.
System.NullReferenceException: Object reference not set to an instance of an object.
   at Gizmox.WebGUI.Forms.SerializationReader.ReadInt32()
   at Gizmox.WebGUI.Forms.SerializableObject.OnSerializableObjectDeserializing(SerializationReader objReader)
   at Gizmox.WebGUI.Forms.SerializableObject.OnSerializableObjectDeserializing(StreamingContext objContext)
   at System.Runtime.Serialization.SerializationEvents.InvokeOnDeserialized(Object obj, StreamingContext context)
   at System.Runtime.Serialization.ObjectManager.RaiseOnDeserializedEvent(Object obj)
   at System.Runtime.Serialization.ObjectManager.RegisterObject(Object obj, Int64 objectID, SerializationInfo info, Int64 idOfContainingObj, MemberInfo member, Int32[] arrayIndex)
   at System.Runtime.Serialization.Formatters.Binary.ObjectReader.RegisterObject(Object obj, ParseRecord pr, ParseRecord objectPr, Boolean bIsString)
   at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseObjectEnd(ParseRecord pr)
   at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Parse(ParseRecord pr)
   at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
   at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream)
   at System.Resources.ResXDataNode.GenerateObjectFromDataNodeInfo(DataNodeInfo dataNodeInfo, ITypeResolutionService typeResolver)
   at System.Resources.ResXDataNode.GetValue(ITypeResolutionService typeResolver)
   at System.Resources.ResXResourceReader.ParseDataNode(XmlTextReader reader, Boolean isMetaData)
   at System.Resources.ResXResourceReader.ParseXml(XmlTextReader reader)
   at System.Resources.ResXResourceReader.EnsureResData()
   at System.Resources.ResXResourceReader.GetEnumerator()
   at Microsoft.Build.Tasks.ProcessResourceFiles.ReadResources(IResourceReader reader, String fileName)
   at Microsoft.Build.Tasks.ProcessResourceFiles.ReadResources(String filename, Boolean shouldUseSourcePath)
   at Microsoft.Build.Tasks.ProcessResourceFiles.ProcessFile(String inFile, String outFile)
   at Microsoft.Build.Tasks.ProcessResourceFiles.Run(TaskLoggingHelper log, ITaskItem[] assemblyFilesList, List`1 inputs, List`1 outputs, Boolean sourcePath, String language, String namespacename, String resourcesNamespace, String filename, String classname, Boolean publicClass)
   at Microsoft.Build.Tasks.ProcessResourceFiles.Run(TaskLoggingHelper log, ITaskItem[] assemblyFilesList, List`1 inputs, List`1 outputs, Boolean sourcePath, String language, String namespacename, String resourcesNamespace, String filename, String classname, Boolean publicClass)
   at Microsoft.Build.Tasks.GenerateResource.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult)    c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets    1835    9    INFOtrac.UI.VWGCLib

What should I do to be able to build the project?

I tried adding these things:

    <TrackFileAccess>false</TrackFileAccess>
    <GenerateResourceNeverLockTypeAssemblies>true</GenerateResourceNeverLockTypeAssemblies>

into the first Project's PropertyGroup in the project file, but they haven't helped me.

Thanks,

Alex

 
New Post 2/22/2012 10:45 AM
  palli
11838 posts
1st Level Poster




Re: Can't build VWG library anymore 

Hi Alex,

I am unaware of any problems in Visual WebGui, specific to control libraries, but to make sure I just tested here and it works fine.

You can make a simple test yourself, creating a new Visual WebGui library project and then just build it. Please let us know if that does not work.

I find it more likely that there's something in your library contents (code) that is making it fail build. Seeing error messages like that, when SerializationReader is having problems reading, it often points to some corrupt data inside of the resource files (.resx).

Please check the contents of your resource (*.resx) files inside this project and see if you have any sections or tags that may seem to you like binary data. In some cases the wrong attribute decoration for properties of your classes make the serializer serialize the wrong data, like serializing the object a property references rather than just the reference.

If you are unsure, you are welcome to email your library project to support and we will take a look at it. If you choose to do so, please remember to include the full Http reference to this thread in that email and also please post here on the thread when you have sent the email.

Hope this helps,

Palli

 


Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
New Post 2/27/2012 11:19 AM
  infotrac
29 posts
No Ranking


Re: Can't build VWG library anymore 
Modified By infotrac  on 2/27/2012 3:20:02 PM)

Hi Palli,

Yes, it was a resource file with binary data inside value tag.

  <data name="tbDateTime.ErrorProvider" mimetype="application/x-microsoft.net.object.binary.base64">
    <value>
        AAEAAAD/////AQAAAAAAAAAMAgAAAFlHaXptb3guV2ViR1VJLkZvcm1zLCBWZXJzaW9uPTQuMC41NzAx
        LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49YzUwOGI0MTM4NmM2MGYxZAwDAAAAWkdp
        em1veC5XZWJHVUkuQ29tbW9uLCBWZXJzaW9uPTQuMC41NzAxLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVi
        bGljS2V5VG9rZW49MjYzZmE0ZWY2OTRhY2ZmNgUBAAAAIUdpem1veC5XZWJHVUkuRm9ybXMuRXJyb3JQ
        cm92aWRlcgcAAAANbWludEJsaW5rUmF0ZQ5tZW5tQmxpbmtTdHlsZQ5tc3RyRGF0YU1lbWJlcg5tb2Jq
        RGF0YVNvdXJjZRRtb2JqQ29udGFpbmVyQ29udHJvbAhtb2JqSWNvbhtTZXJpYWxpemFibGVPYmplY3Qr
        bW9iakRhdGEABAECBAQFCCNHaXptb3guV2ViR1VJLkZvcm1zLkVycm9yQmxpbmtTdHlsZQIAAAAkR2l6
        bW94LldlYkdVSS5Gb3Jtcy5Db250YWluZXJDb250cm9sAgAAAC1HaXptb3guV2ViR1VJLkNvbW1vbi5S
        ZXNvdXJjZXMuUmVzb3VyY2VIYW5kbGUDAAAAAgAAAAMAAAAF/P///yNHaXptb3guV2ViR1VJLkZvcm1z
        LkVycm9yQmxpbmtTdHlsZQEAAAAHdmFsdWVfXwAIAgAAAAAAAAAGBQAAAAAJBQAAAAoKCgs=
</value>
  </data>

What do you mean by wrong attribute decoration for properties?

This resource file belongs to a class, which inherits from the base class, which inherits from UserControl.

This base class has a property of type ErrorProvider.

    public partial class itUserControl : UserControl
    {
        private ErrorProvider _ep = new ErrorProvider();

        public ErrorProvider ErrorProvider
        {
            get { return _ep; }
            set { _ep = value; }
        }

Is there something wrong with having a property like this in a base class and what's the solution?

Thanks,

Alex

 
New Post 2/27/2012 1:36 PM
  palli
11838 posts
1st Level Poster




Re: Can't build VWG library anymore 

Hi Alex,

You can see what property it's serializing incorrecty in the name=. In your case it's the tbDateTime.ErrorProvider. This property needs to be decorated with DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden). This property decides how your property is serialized by the designer, meaning if it should serialize the property (like "this.ErrorProvider" or the value of the property (which is the binary object itself). When working with public properties that store object references, you need to be concerned about this, not when your property is, say, a string value.

You can find a link to more information under the "General .NET" section here.

Hope this helps,

Palli

 


Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
Previous Previous
 
Next Next
  Forum  Commercial Foru...  Commercial Foru...  Can't build VWG library anymore
Assessment Bottom
.NET Web, Cloud and Mobile application delivery platform | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2011 Visual WebGui®       Visual WebGui weblog on ASP.NET Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS