How to read/get ini file path in WCF published folder vb.net? - wcf

I'm writing a WCF service which suppose to get it's data connection to sql server from config file.
Where should I place the config file and how can I get it's path so every time the service will run it will go to the specific program application published folder and read the file from there.
when I publish the service I create a folder and in it there is XXX.svc file, Web.config file and bin folder.

Related

File pickup from ftp directory

I have deployed an application in CloudHub with the FTP connector at the event source. It picks up the file whenever a file is dropped in the FTP directory. If I deploy application 0.1v and 2 workers, and a file arrives from the FTP directory, how should the application react?
Anyone could explain the above scenario?

IIS Http Module config file write auto creates .bak file

I've got a custom http module in IIS 8 that uses a set of config files to control how it works. These are all named *.config and are mainly in a filesystem folder outside the scope of the site, with one in the bin folder.
In the module I use system.io.file.writealltext to update the files. When I do this, the file I'm writing to is copied to a .bak file before the new file is written to. This only seems to happen when the file extension is .config (I've tested with other extensions and it doesn't happen).
It also doesn't happen everywhere - it happens with all the deployments I have on an Azure Windows Server 2016 VM, but doesn't happen much on other deployments (we have clients with a variety of versions of Win Server & IIS).
I suspect its an IIS setting, to automatically create a .bak when a .config file is changed, but can't find any info on this.
Does anyone have any idea why this is happening and how I can turn it off?

Browser cannot download .txt file if the project is .Net Core Restful API

I am trying to activate my SSL for my project but one of the the urls doesn't respond.
This is the web site and when you paste the url to the browser, it downloads the .txt file.
http://www.xxx.co.uk/.well-known/pki-validation/83CB00D29E282E1FFD6DFB220F030EF4.txt
This is the Restful .Net Core API domain and when you paste the url to the browser, it returns 404 error.
http://api.xxx.co.uk/.well-known/pki-validation/83CB00D29E282E1FFD6DFB220F030EF4.txt
Under the IIS I have compared the psychical paths, permissions and it seems everything is same. I believe something in Rest API blocks the .txt file download. Should I check the web.config or something I need to add to the C# source code? Should I update ConfigureServices(IServiceCollection services)? In IIS I have checked MIME Types and the .txt is already defined.
Any suggestions?
I believe my problem is pointing to this subject but I am not sure how to enable/define .txt files in startup.cs. Any code snippets?
How to Serve Static File
EDIT: Finally I found a solution. Now the browser can download the .txt files. What I did is, I created a virtual directory in IIS. Here are the steps:
Go to the C: drive
Create a new folder called well-known
Inside the .well-known folder, create another folder named pki-validation
so far, your folders should look like this: C:\.well-known\pki-validation
Upload the TXT file in the pki-validation folder
Open the IIS Manager on your server
Do a right click on your website and select Add Virtual Directory
In the Alias section write .well-known
In the Psychical Path area enter the path to the well known folder. For example: C:\well-known
Press OK to create this alias
The urls are now serving the .txt files. I hope these steps one day saves the other developers time.

Persistent Axis2 Service Files

I deployed an instance on Axis2 within my JBoss EAP 6.2 server. However, the only way I can add my service files are through the online admin console. This is a problem because when I add them through the console they are added to a random folder within standalone/tmp/vfs. So when I stop and start my server again I lose my reference and I need to re-add them through the console. How can I set it up so that I do not need to re-add my service files every time I start my server?
You can prepackage them inside your war under /WEB-INF/services so that they are automatically deployed with the war file.
e.g.
/WEB-INF
/services
/service_a.aar
/service_b.aar
/services.list
The services.list file in the same directory is a text file listing your aar files ... one per line
The aar files are just zipped Axis archives. They contain a META-INF directory with your wsdl, any xsd files and an Axis2 services.xml service configuration file describing the service.

how can i refer WCF client config settings from the exe which doesnt have a config file

I have a WCF Service and Client(dll) application. This client dll is loaded by a myexe.exe but this(myexe.exe) doesn't have myexe.exe.config file. so now how to refer my client config settings from the exe which doesnt have a config file.
Then add a myexe.exe.config file.