|
The compiler is free, you can download it from Microsoft[^].
And you can download a free IDE here Borland[^]
Free your mind...
|
|
|
|
|
As they said, the SDK contains the compiler and is free. If you want a good, free IDE there's also SharpDevelop at http://www.icsharpcode.net/OpenSource/SD/Default.aspx[^].
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I'd also recommend SharpDevelop, while their are a few bugs and annoyances I find it to be excellent.
|
|
|
|
|
As they have spoken so it is. Have fun with C sharp!
...the mind is not a vessel to be filled but a fire to ignited
|
|
|
|
|
Hi there,
Wondering if anyone knows how to send an object that is already serialized in .Net remoting. And listen and read the serialized object that is being received. I want to be able to send a serialized object and recieve and store it in a database, as well as pull a serialized object out of the database and send it through .net remoting.
Right now, I send an object that gets serialized and then deserialized at the other end. Then serialize it again to put it in the database. Then to send it, I pull it out of the database deserialize it and the send the object through .net remoting where it gets serialized again before it is sent.
This is alot of overhead that should not be required. I'm sure there is probably an easy way to do this???
Thanks alot,
I could easily see this being covered in another article but I have searched and can not find anything.
thanks again.
|
|
|
|
|
Another way, yes. Easier, perhaps not. The trick is to use the SOAP in the SoapServerFormatterSink without serializing and deserializing the object. You could override ProcessMessage to intercept the request and response streams appropriately and save these as text (since it is SOAP) to a database. You could then use this server formatter sink in your remoting configuration instead of the default SoapServerFormatterSink which would serialize and deserialize the object.
You could also use a regular sink in the chain to grab the SOAP and put it in a database, but the default formatter sink would still serialize and deserialize the object.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
But how do I call the method to begin with. I would call the method on the client, but it would require an object to pass in, which it would then serialize, then i use a formatter and replace its serializing with mine from the database?
This is the best I could come up with.
How would I call a blank method for invoking the method, and then in the formatter chain input my serialized object in the formatter i make?
I actually haven't done any remoting only read and looked at code samples.
Thanks very much for the help.
Ya, so all i need is to invoke the client proxy method, with blank info some how? and then add my serialized object in the formatter?
Thanks again.
|
|
|
|
|
Everything in this case (if I understand your problem correctly) happens on the server. The client would be none-the-wiser what's going on at the server (as is typically the case anyway). The Remoting server is configured to use a derivative SoapServerFormatterSink - the sink in the chain that actually performs the serialization. This formatter sink merely saves the SOAP that represents the object to the database, and retrieves the SOAP from the database to send back to the client, so no serialization is actually performed.
The implementation depends upon many things. For example, you could use a get and set method (don't use a property, though, because you'll incur an additional round trip to get the accessor). The client passes an object to the set method that gets serialized. It goes to the server in the form of an IMethodCallMessage which you store the parameter in the database. For an IMethodReturnMessage you get the stream from the database (for instance, using a TextReader ) and pass that back to the client.
I hope this explains the concept a little better. As I mentioned the first time, this isn't necessarily an easy thing. It's just something you're going to have to try. It should work based on what I know and my experiences with .NET Remoting.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Ok, thanks very much for the help.
That should help alot.
|
|
|
|
|
Oh, and you might consider configuring the formatter sink in your configuration file or through the Properties dictionary to use includeVersions="false" since your objects are being persisted and might change over the lifetime of the persisted data, meaning that (if you version your assemblies correctly) it would be valid because the Types would be different (even by simply changing the version). This could save you a lot of headaches down the road.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I compile a C# Web Service with the following command line
csc /t:library /out:ForwardRate.dll ForwardRate.cs /r:System.Data.OracleClient.dll
Following successfull compilation, I copy the DLL to the /bin directory of IIS. When I locally open the URL for my service, I get a page correctly describing my Web Service. However when I use the invoke button to test, it generates an exception of DLL not found. Unable to locate a dll (OCI.DLL). This dll is in the path, but it is not in the /bin directory where the service dll is located. I have since tried to create some simple console programs that duplicate the service behaviour and they compile as above and run without any problem. Does it make sense that any DLL's that a service assembly needs to reference at runtime have to reside in the /bin directory of IIS? Or have I missed out on something else?
Chris Meech
We're more like a hobbiest in a Home Depot drooling at all the shiny power tools, rather than a craftsman that makes the chair to an exacting level of comfort by measuring the customer's butt. Marc Clifton
VB is like a toolbox, in the hands of a craftsman, you can end up with some amazing stuff, but without the skills to use it right you end up with Homer Simpson's attempt at building a barbeque or his attempt at a Spice rack. Michael P. Butler
|
|
|
|
|
That is really strange. I have a web service running and using the ODP.NET, and don't have any references to OCI.DLL.
OCI.DLL is Oracle Call Interface and is installed by the Oracle Client.
Is the Oracle Client installed on the machine you are using to test ??
Free your mind...
|
|
|
|
|
Guillermo Rivero wrote:
Is the Oracle Client installed on the machine you are using to test ??
Yes it is. The two ways that I have checked this are one, using the Oracle Installer to confirm that Oracle Client is installed, and two I put together a couple of test console programs that would connect and query exactly the same as the service is supposed to. These test programs compiled and ran without a problem.
Guillermo Rivero wrote:
I have a web service running and using the ODP.NET, and don't have any references to OCI.DLL
My understanding is that both the classes of Oracle Client of .NET v1.1 or classes of the Oracle Data Provider .NET (from Oracle) require a minimum of Oracle Client 8.1.7. Additionally, once Oracle Client is required, OCI.DLL will get linked in eventually. It's about as low as you get in accessing the database.
I just find it odd that the console programs work but the service does not.
Thanks, though.
Chris Meech
We're more like a hobbiest in a Home Depot drooling at all the shiny power tools, rather than a craftsman that makes the chair to an exacting level of comfort by measuring the customer's butt. Marc Clifton
VB is like a toolbox, in the hands of a craftsman, you can end up with some amazing stuff, but without the skills to use it right you end up with Homer Simpson's attempt at building a barbeque or his attempt at a Spice rack. Michael P. Butler
|
|
|
|
|
|
Try putting oci.dll in your bin directory along with your assembly. Either inetsrv.exe or aspnet_filter.dll doesn't seem to search for files in the PATH and putting native DLLs in the bin directory has worked for us before. There might have been a different problem, though. I remember reading something about this a long time ago and now I can't remember where it is.
Also, are the "console programs" you're talking about .NET console apps that use the Oracle.NET client, or Oracle's console apps? Is oci.dll even in a directory specified by the PATH environment variable?
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Heath Stewart wrote:
Try putting oci.dll in your bin directory
That's first on my Monday morning TODO list.
Heath Stewart wrote:
Either inetsrv.exe or aspnet_filter.dll doesn't seem to search for files in the PATH and putting native DLLs in the bin directory has worked for us before.
If this is true, it seems like a pretty big oversight on DLL loading. And would explain the difference that I'm experiencing.
Heath Stewart wrote:
Also, are the "console programs" you're talking about .NET console apps that use the Oracle.NET client, or Oracle's console apps?
These console programs are .NET console apps. I'm using the classes for Oracle that ship as part of the .NET Framework SDK version 1.1
Heath Stewart wrote:
Is oci.dll even in a directory specified by the PATH environment variable?
Yes it is.
I'll be back on Monday to tackle this issue. Thanks for help, Heath and I'll post again to let you know how it turns out.
Chris Meech
We're more like a hobbiest in a Home Depot drooling at all the shiny power tools, rather than a craftsman that makes the chair to an exacting level of comfort by measuring the customer's butt. Marc Clifton
VB is like a toolbox, in the hands of a craftsman, you can end up with some amazing stuff, but without the skills to use it right you end up with Homer Simpson's attempt at building a barbeque or his attempt at a Spice rack. Michael P. Butler
|
|
|
|
|
yes, oci.dll is in a directory in the PATH enviroment variable. And I have the Oracle.NET assembly in the GAC. May be that's why it works for me.
Free your mind...
|
|
|
|
|
I tested out copying the OCI.DLL file to the /bin directory with my service assembly, but I still get the same error. For what it's worth, here is the output
System.DllNotFoundException: Unable to load DLL (oci.dll).
at System.Data.OracleClient.DBObjectPool.GetObject(Object owningObject, Boolean& isInTransaction)
at System.Data.OracleClient.OracleConnectionPoolManager.GetPooledConnection(String encryptedConnectionString, OracleConnectionString options, OracleConnection owningObject, Boolean& isInTransaction)
at System.Data.OracleClient.OracleConnection.OpenInternal(OracleConnectionString parsedConnectionString, Object transact)
at System.Data.OracleClient.OracleConnection.Open()
at ForwardRate..ctor()
ForwardRate is my service class and in it's ctor it attempts to connect to an Oracle database.
I'm wondering if I shouldn't try using the GAC utilities to add the System.Data.OracleClient.dll to the GAC? I not sure about doing so, cause I wonder if Microsoft didn't do so for some technical reason as opposed to some political reason.
Chris Meech
We're more like a hobbiest in a Home Depot drooling at all the shiny power tools, rather than a craftsman that makes the chair to an exacting level of comfort by measuring the customer's butt. Marc Clifton
VB is like a toolbox, in the hands of a craftsman, you can end up with some amazing stuff, but without the skills to use it right you end up with Homer Simpson's attempt at building a barbeque or his attempt at a Spice rack. Michael P. Butler
|
|
|
|
|
Someone else mentioned that they did when they had a similar problem and it worked fine. You'll be able to control versioning better anyway. In any case, System.Data.OracleClient is already in my GAC and I didn't put it there, which makes me wonder if something went wrong during the installation of .NET 1.1.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
When your application, e.g. a Web Service, is running inside aspnet_wp.exe, it's running as other user (the user you configured ASP.NET for, with a default of a local account named ASPNET).
The PATH environment variable is defined for each user at application start, so you'll need to either change the PATH environment variable for the ASP.NET user or change the ASP.NET user (search for processModel on MSDN) for one that has the PATH correctly configured. Don't forget to restart IIS or kill the aspnet_wp.exe process or the environment variable won't be loaded again.
As an alternative (that most system administrators hate), you can go to your system properties and change the PATH environment variable for the whole system and do a system restart (I'm not sure if a restart is needed, it may not be).
Trying to make bits uncopyable is like trying to make water not wet.
-- Bruce Schneier
By the way, dog_spawn isn't a nickname - it is my name with an underscore instead of a space. -- dog_spawn
|
|
|
|
|
The Oracle directories have been added to the system path, so that shouldn't be an issue. As well the console programs run fine. I've done some more testing this morning and even weirder is that putting the OCI.DLL file in the /bin directory with my assembly does not fix the problem at all.
I'm beginning to suspect that this is a managed code mixed with unmanaged code issue, but I'm going to test some more. I may also try to use the GACUTIL to add the System.Data.OracleClient.dll assembly to the GAC.
Thanks for the help.
Chris Meech
We're more like a hobbiest in a Home Depot drooling at all the shiny power tools, rather than a craftsman that makes the chair to an exacting level of comfort by measuring the customer's butt. Marc Clifton
VB is like a toolbox, in the hands of a craftsman, you can end up with some amazing stuff, but without the skills to use it right you end up with Homer Simpson's attempt at building a barbeque or his attempt at a Spice rack. Michael P. Butler
|
|
|
|
|
Chris Meech wrote:
As well the console programs run fine.
Yes, because they run as a different user. Are you trying to run them as the same user than the aspnet_wp.exe?
Can you make a simple function on your Web Service that returns System.Environment.GetEnvironmentVariables ?
Trying to make bits uncopyable is like trying to make water not wet.
-- Bruce Schneier
By the way, dog_spawn isn't a nickname - it is my name with an underscore instead of a space. -- dog_spawn
|
|
|
|
|
Daniel Turini wrote:
Yes, because they run as a different user. Are you trying to run them as the same user than the aspnet_wp.exe?
Good point. But since the system environment has the PATH establish corectly, I'm sure that is how they are being found. The IIS installation is completely default, so how would I determine what user account the processes run under and bettery yet what would I use in order to change that? Thanks.
Daniel Turini wrote:
Can you make a simple function on your Web Service that returns System.Environment.GetEnvironmentVariables
That sounds like a good test. I'll try that out shourtly. Thanks.
Chris Meech
We're more like a hobbiest in a Home Depot drooling at all the shiny power tools, rather than a craftsman that makes the chair to an exacting level of comfort by measuring the customer's butt. Marc Clifton
VB is like a toolbox, in the hands of a craftsman, you can end up with some amazing stuff, but without the skills to use it right you end up with Homer Simpson's attempt at building a barbeque or his attempt at a Spice rack. Michael P. Butler
|
|
|
|
|
Chris Meech wrote:
The IIS installation is completely default, so how would I determine what user account the processes run under and bettery yet what would I use in order to change that? Thanks.
Invoke the task manager (Ctrl-Shift-Esc), View/Select Columns/User Name.
Now, see on the process list what is the user for the aspnet_wp.exe process. On default installations, this is the ASPNET user.
Trying to make bits uncopyable is like trying to make water not wet.
-- Bruce Schneier
By the way, dog_spawn isn't a nickname - it is my name with an underscore instead of a space. -- dog_spawn
|
|
|
|
|
Daniel Turini wrote:
Invoke the task manager (Ctrl-Shift-Esc), View/Select Columns/User Name.
The closest column name is User Objects, which displays a numerical number. The aspnet_wp.exe process is running under the user object of '0'.
I tried your idea about a service to return the PATH environment variable and the string contains the full system path which includes the Oracle directories such as bin.
This is one mother of a confusing problem.
Chris Meech
We're more like a hobbiest in a Home Depot drooling at all the shiny power tools, rather than a craftsman that makes the chair to an exacting level of comfort by measuring the customer's butt. Marc Clifton
VB is like a toolbox, in the hands of a craftsman, you can end up with some amazing stuff, but without the skills to use it right you end up with Homer Simpson's attempt at building a barbeque or his attempt at a Spice rack. Michael P. Butler
|
|
|
|
|