Okay, so I hope y'all will bear with me.
I'm asking 2 questions. One is high level and I don't really expect anyone to "tutor" me in this setting. However, I ask it so that my 2nd question makes more sense.
In general let me state that I'm a professional VBA developer and I generally work on single-machine development. Thus, any time I get involved in distributed applications or things like web sites, I tend to get a little confused.
But I have to learn this .NET business, so I'm experimenting. For learning purposes, I made a very nice web service that has math functionality. One function adds 2 numbers. Another multiplies 2 numbers. Then I created a string function that concatenates 2 strings.
Then I thought I'd get creative and write something that pulls from a database. I'm familiar with ADO and I know I can use Server.CreateObject(), but I wanted to use the nifty features of .NET, so I tried adding a reference to the web service. I went to Website > Add Reference. I was presented with a dialog and was given "adodb" as a choice, so I chose that.
I then tried to compile the web service and I got
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Could not load file or assembly 'ADODB, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d
50a3a' or one of its dependencies. The system cannot find the file specified.
Line 25: <compilation debug="true" strict="false" explicit="true" urlLinePragmas="true">
Line 26: <assemblies>
Line 27: <add assembly="ADODB, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=B03F5F7F11D
Line 28: <pages>
Line 29: <namespaces>
I checked the config file and indeed the line mentioned above had been added.
Now I'm assuming that that particular version of adodb.dll is not on my host machine.
See, the real gotcha here is that I'm trying to do this on a commercial hosting account. The account has .NET 2.0 installed, so that's not a problem. But as a commercial web host, I don't really have access to the operating system and I don't even know if I have the ability to install DLLs or ask them to.
So, my high level question is: Am I doing this all wrong and can it be stated as a general rule of thumb that you can't do things like add references when you're working with a commercial host that does not give you the full capability of working with the operating system?
My lower level question is: "Can I install this adodb.dll" on the host by simply copying it somewhere that my config file can get to it? Or, as with the higher level question, do I stay away from creating references and simply use old fashioned ADO?
I did try to copy C:\Program Files\Microsoft.NET\Primar
y Interop Assemblies\adodb.dll to the web service folder and any subfolder that it uses. I noticed the version # was different than that in the config file, so I tried compiling with the old version # and the new version #. Neither worked.
thanks in Advance.
Okay, I just thought of something else: I'm also attempting to do all this directly on the hosting account. Is the proper way to do it to develop it on my own machine (with IIS) and then once it's working, somehow deploy it to the commercial server? If so, does this mean I have to make all my connection strings identical between my home machine and the host machine or do I just tweak those once I deploy?
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
Visual Basic options:
Set strict="true" to disallow all data type conversions
where data loss can occur.
Set explicit="true" to force declaration of all variables.
<compilation debug="true" strict="false" explicit="true" urlLinePragmas="true">
<add assembly="ADODB, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation>
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />