Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    Mar 2007
    Location
    Dus
    Posts
    5

    Question How to build a working DotNetStockListDemo.dll (.NET)

    Hi,

    I'm having diffuculties creating a working DotNetStockListDemo.dll. At present, I'm using Lightstreamer 3.4.3 build 1336, which I downloaded today.

    I start out creating a new Project in Visual Studio 2005. From the Project chooser menu, I select:
    • Visual C#
    • Class Library
    and save it as DotNetStockListDemo

    I remove the default Class1.cs and add the source files from:
    DOCS-SDKs\sdk_adapter_dotnet\examples\DotNetStockListDe mo\src_data_adapter
    (Burst.cs, ExternalFeed.cs and StockList.cs)

    To be able to build the Solution, I import DotNetAdapter.dll from:
    DOCS-SDKs\sdk_adapter_dotnet\lib\dotnet_1.1
    After this, it builds fine (ie no errors).

    To be able to run the demo, I remove the standard demo from the adapters folder and add the files from:
    DOCS-SDKs\sdk_adapter_dotnet\examples\DotNetStockListDe mo\Deployment_Piped_Version\Deployment_LS\StockLis t_pipes
    to the adapters folder (which runs fine without modifications).
    I then overwrite the DotNetStockListDemo.dll from that project with the build from Visual Studio.

    Now when starting Lightstreamer again, I get these error messages:
    Code:
    03.May.07 17:16:18,110 < INFO> Spawning external command 'cmd.exe' on path './Do
    tNetAdapter/dotnet_1.1/'...
    03.May.07 17:16:19,142 <ERROR> Exception caught while trying to connect
    com.lightstreamer.adapters.remote.RemotingException: Process exited with return
    code: 0
            at com.lightstreamer.adapters.remote.transport.LocalPipeTransport.connec
    t(LocalPipeTransport.java:70)
            at com.lightstreamer.adapters.remote.metadata.PipedMetadataProvider.init
    (PipedMetadataProvider.java:23)
            at com.lightstreamer.h.r.a(r.java)
            at com.lightstreamer.h.l.a(l.java)
            at com.lightstreamer.h.l.a(l.java)
            at com.lightstreamer.LS.main(LS.java)
    03.May.07 17:16:19,142 <ERROR> Metadata adapter init error
    com.lightstreamer.interfaces.metadata.MetadataProviderException: Exception caugh
    t while trying to connect: Process exited with return code: 0
            at com.lightstreamer.adapters.remote.metadata.PipedMetadataProvider.init
    (PipedMetadataProvider.java:27)
            at com.lightstreamer.h.r.a(r.java)
            at com.lightstreamer.h.l.a(l.java)
            at com.lightstreamer.h.l.a(l.java)
            at com.lightstreamer.LS.main(LS.java)
    03.May.07 17:16:19,142 <ERROR> Error while loading the Adapters
    com.lightstreamer.interfaces.metadata.MetadataProviderException: Exception caugh
    t while trying to connect: Process exited with return code: 0
            at com.lightstreamer.adapters.remote.metadata.PipedMetadataProvider.init
    (PipedMetadataProvider.java:27)
            at com.lightstreamer.h.r.a(r.java)
            at com.lightstreamer.h.l.a(l.java)
            at com.lightstreamer.h.l.a(l.java)
            at com.lightstreamer.LS.main(LS.java)
    03.May.07 17:16:19,142 <FATAL> Adapters initialization failed
    03.May.07 17:16:19,142 < INFO> Exiting.....
    I also tried adding LiteralBasedProvider.cs to the project from:
    DOCS-SDKs\sdk_adapter_dotnet\examples\DotNetStockListDe mo\src_metadata_adapter
    to the project, but this did not solve the issue. I suspected I don't need this file for the data adapter, as I think it belongs to DotNetAdapter.dll

    One thing that struck me as odd is that my DLL is larger than the supplied DLL, even the Release version (24KB as opposed to 15KB).

    What am I doing wrong?
    Can anyone help me in the right direction?
    In the end, I'd like to have Lightstreamer pull data from an SQL database and deliver it to the clients, but up till now I have not even been able to get the demo source running.

    Thanks in advance,
    Kind regards,
    Erik.

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,090
    Hi Erik,

    The message says that the Proxy Adapter, running inside Lightstreamer Server, tried to launch the Remote Server, but the process exited. We should then try to find the log of the Remote Server.
    By its default configuration, the Remote Server produces a log called DotNetServer.log in the same directory where the exe is located (i.e. adapters\StockList_pipes\DotNetAdapter\dotnet_1.1) . Can you see it?

    To simplify tracing the problem, you can alternatively configure the Remote Server in the Standalone Version and try launching manually the Remote Server with and without your compiled adapters.
    Just change the library in DOCS-SDKs\sdk_adapter_dotnet\examples\DotNetStockListDe mo\Deployment_Standalone_Version\Deployment_DotNet _Server\dotnet_1.1 and run DotNetServers.bat on the parent directory.
    This also causes a DotNetServer.log file to be created.

    Note that some compatibility problem in the Data Adapter library can explain a failure in the Metadata Adapter part, because the Remote Server, at startup, always loads all "dll" files it finds in its directory.

    We cannot explain the size difference from our compiled dll and yours. Note that we compiled the demo outside Visual Studio, by invoking
    Microsoft.NET\Framework\v1.1.4322\Csc.exe
    and with the following code generation options:
    Code:
        define:TRACE;DEBUG
        debug:pdbonly
        optimize-
    Dario

  3. #3
    Member
    Join Date
    Mar 2007
    Location
    Dus
    Posts
    5

    Question

    Hi Dario,

    thanks for your reply. I did not know there was another log as well. I was looking in the \logs folder.

    Now that i've seen the log, it seems there is something wrong with the compiled DLL, as it states:
    "System.BadImageFormatException: The format of the file 'DotNetStockListDemo.dll' is invalid."

    I tried your suggestion to compile the sources using csc.exe: it works now...
    Thanks!

    I've got a new question though:
    Is it possible to dynamically size the table, IE get more lines when more data is available and remove lines when data is removed? (Is there an example somewhere?)
    I will need to monitor a queue with this project. Items can be added to and removed from the queue. I'd like the table to hold exactly these items, no more, no less.

    Thanks again for your help,
    Kind regards,
    Erik.

  4. #4
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784

    Moved

    EriOor, I've posted a response on the .NET client API forum:
    http://www.lightstreamer.com/vb/showthread.php?p=351

  5. #5
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,090
    Erik,

    we were not aware of bytecode format problems caused by different compiling contexts.
    We will need to investigate on this.

    Dario

  6. #6
    Member
    Join Date
    Mar 2007
    Location
    Dus
    Posts
    5

    Lightbulb Solution!

    Hi Dario,

    I've found the problem: Visual Studio 2005 builds projects using the .NET 2.0 compiler, which obviously won't work on .NET 1.1 versions of the reference.
    Apparently there are workarounds for that, but the easiest solution is to build the 2.0 version of the program of course.

    I've built the Demo with the 2.0 reference and included the needed files in de adapters folder: It all works now!

    Sorry for the confusion!
    It did prove usefull though, as another user was asking the exact same question:
    http://www.lightstreamer.com/vb/showthread.php?t=75

    This might be something to add in an FAQ or something

    Kind regards,
    Erik.

  7. #7
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,090
    Thank you very much, Erik.

    I thought about .NET version, but I probably confused Visual Studio 2005 with Visual Studio 2003.

    Dario

 

 

Similar Threads

  1. example/DotNetStockListDemo with Net 2.0
    By martin in forum Adapter SDKs
    Replies: 1
    Last Post: January 8th, 2010, 12:58 PM
  2. Demo not working within my framework...
    By athanasius2 in forum General
    Replies: 3
    Last Post: April 17th, 2009, 01:40 PM
  3. LS getFieldValue not working
    By shreyaspurohit in forum Client SDKs
    Replies: 4
    Last Post: December 18th, 2008, 10:39 AM
  4. Replies: 6
    Last Post: December 12th, 2007, 05:45 PM
  5. Working examples!
    By jkrassman in forum Client SDKs
    Replies: 1
    Last Post: November 5th, 2007, 12:37 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 12:49 AM.