Wednesday, November 21, 2018

Getting other files in ASP.NET Bin Directory when Publishing


I needed additional files in my ASP.NET's Bin directory that were not part of the ASP.NET project itself (they were configuration files and Native .dlls).  I tried various methods from different suggestions, but the solution described here is the only one that worked:

http://sedodream.com/2010/05/01/WebDeploymentToolMSDeployBuildPackageIncludingExtraFilesOrExcludingSpecificFiles.aspx

https://stackoverflow.com/questions/35000825/copyallfilestosinglefolderforpackagedependson-and-web-deploy


Some of the options that didn't work included marking the files as Content, using Post-Build events to copy your files to the Bin directory.  None of that works on putting them in the Web Deploy Package.


My issue was that my additional files (.dll and .ini) would not make it to the Web Deploy Package.  Getting them into the Folder Profile's output was not an issue.   There does not appear to be a way Visual Studio GUI or in your Project's Solution to make this happened.

You must do the following:

- create your Web Deploy Package.

- show all of the hidden files in the Solution.

- Find the PublishProfiles folder, then find the .pubxml file that corresponds with your Web Deploy Package's profile.

- You must manually insert the highlighted section below into your .pubxml file:




- the location of your extra files is important because the _CustomFiles Include entry specifies the location of those files.  I used  "..\extraFilesForWebDeploy\**\*"   This will get all of the files and subdirectory in a directory called extraFilesForWebDeploy that is at the same directory level as the ASP.NET project's folder. 

- If you just put your files there, they will be put in the ASP.NET's main directory.  To get them in the Bin directory, I had to create a Bin directory in my ExtraFilesForWebDeploy directory and put the files I wanted to be delivered there.

- You must have the CopyAllFilesToSingleFolderForMsdeployDependsOn section to get them in the Web Deploy Package.

-The only part that needs to be adjusted for your project is the location of the source files.

Friday, May 11, 2018

Troubleshooting Setting up Oracle 12c R2 and using it with Older Clients

Here are the problems I have every time I setup up Oracle.

Oracle 12c R2 on Windows Server added more complexity than even 12c R1.


1) Windows user name cannot have a space in it.  The Oracle Setup will hang up before it completes (with no explanation).


2) Turn off Password Complexity on Windows Server or Oracle Setup can't create a user for Oracle (if you are wanting it to create a user)


3) In listener.ora and tnsname.ora, change  "localhost" to your machine name or you will not be able to connect from other machines.


4) If you need older clients to connect with Oracle 12c R2, in the sqlnet.ora, you will have to add: 

SQLNET.ALLOWED_LOGON_VERSION_SERVER=8
SQLNET.ALLOWED_LOGON_VERSION_CLIENT=8

You can use a different minimum (instead of 8), but this is the lowest.

You will get this error on other machine if this is the case:

ORA 28040: No matching authentication protocol


5) If you have already created users in Oracle before adding the entries to sqlnet.ora, you will have to reset the passwords if you want to connect from the older versions.

ALTER USER  IDENTIFIED BY 

You will get the following error until this is done (for no apparent reason):

ORA-01017 Invalid Username/Password 


----

Resources:


https://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:9533918300346989898

https://community.microstrategy.com/s/article/ORA-28040-No-matching-authentication-protocol-when-connecting-to-Oracle-12c-or-higher-database

https://stackoverflow.com/questions/37615088/unable-to-connect-to-oracle-12c-from-client-machine