Skip to main content

Posts

Showing posts from March, 2008

DLL Files And .NET ClickOnce Deployment

I want to deploy one of my .NET apps as a ClickOnce application. The issue is that I am connecting to Oracle (see previous posts here and here ). Connecting to Oracle requires at least, 4 DLL files that generally have to be in the same directory as the EXE file. The issue is that when the program is published, the DLLs are not referenced in any way, so the program won’t work. Then I read about adding the files to the project, so that ClickOnce and the Publish processor will figure out that the DLLs are required and add them to the manifest. Here is the process in Visual Studio 2005: Put the 4 DLL files in their own directory in your solution directory (for ease of use mostly). Add all four files to your project by going to “Project->Add Existing Item…” Click on each DLL file in the solution explorer and then change their property: “Copy To Output Directory” to “Copy Always”. That’s it! Now when I publish or even run the application I don’t have to worry about if the DLL files...

C# .NET Programming Tip: Oracle Connection Revised

Take not that Microsoft will discontinue support for System.Data.OracleClient in .NET 4.0. This method should still work, but it will be depreciated… Now that I have had more time to work with Oracle, I found a better way to connect then described in my previous post . With this new method you can connect to multiple instances in one program by getting rid of that tnsnames file. *Remember that a project reference to System.Data.OracleClient must be added: OracleConnection dbConnection; string connectionString = "Server=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = *******)(PORT = 1521))(CONNECT_DATA = (SID = *****)));Persist Security Info=true;User Id=*****;Password=*****;"; dbConnection = new OracleConnection(connectionString); It’s really that simple. The key here is that the connection string must use the “Server” attribute instead of the “Data Source” one. I ran upon that while looking at the specification on Microsoft’s MSDN documentation site. It’s basically a t...