I am wondering if its possible to create a separate web.config file for a custom service which references the PSI on SharePoint 2013.
So I have my "service.svc" within a folder in the PSI directory, but I would like to have a separate web.config just for this service. I want to try to consume that service in a more general approach, without going through "ProjectServer.svc" in my client.
So I thought it would be better if I can define the endpoints and the rest of the bindings in that separate web.config file.
Thanks
The solution was to create a separate folder in the mapped PSI folder of IIS. Then inside you can easily install your service when deploying with a separate web.config file.
Related
I actually just created an NServiceBus self-hosted endpoint and bootstrapped owin self-hosted web api 2 by adding the Microsoft.AspNet.WebApi.OwinSelfHost nuget package. It's all up and running fine and I can hit the controller endpoints that I added, but the package didn't add the normal items like the web.config.
I'd like to have the normal web.config available to where I can also add in different build configurations (the transform files like web.debug.config, web.release.config, etc).
How do I add this into my project?
I tried just adding the file, but ConfigurationManager doesn't read it.
web.config is used for asp.net web application on a hosted server. As you are using a self-hosted server then web.config is no applicable. You would need app.config which would resolve to the executable name with the .config file extension.
Add app.config to the project and ConfigurationManager should be able to read it.
UPDATE:
It was indicated that the same config transformation was also needed for app.config
The following VS tool fills in the gap left between web.config transformations.
Configuration Transform
Automatically transform app.config or any other config during build
process. Once the transformation is set, it will run on other build
machines without the extension.
The link includes step by step instructions on how to use it in applying configuration transformations.
I have an WCF RESTFull Service which i need to deploy on IIS6. I have never done this before and i am completely new to the IIS environment. I found a good solution here on the forums but its not precise enough for my case. maybe someone can give me based on this solution a more expanded version:
Option 1 - "bin" deploy (preferred option)
compile your WCF service into a DLL (class library)
create a website in IIS6
copy the WCF DLL's into the website's .\bin folder
create a *.svc file in that website
add an appropriate web.config in the website folder to define your endpoints and service configuration etc.
Your WCF service will now be reachable at the website's base address, plus the name of the *.svc file, e.g.
http://myserver/someweb/Myservice.svc
Your *.svc would look something like this:
The Service= attributes denotes the class implementing the service - fully qualified with its namespace.
What is the .\bin folder in point 3. ? Where can I find it?
I need the exact settings for the property page tabs of the website please. Also the address: http://myserver/someweb/Myservice.svc ... What is the someweb ? the physical directory of the website? or the base address from the webconfig file?
An exact step for step guide with all needed settings would be great.
For the '/bin', manually create it in the root of the website you create and copy the assemblies into it.
Create the .svc in the root of the website and access it using a similiar url to;
http://yourwebsitename/service.svc
I am creating a windows service in VS2010, and in order to store a user's input during installation I've been told to write it to a file called app.config.
However i cannot find this app.config file? Does it create one in a windows service project? or just in a WCF windows service project?
In VS do the following:
Click on the service project
And add new item
Select Application Configuration File.
This will appear in your service project as app.config.
When you actually build the project you'll see it a Spotter.exe.config along side your Spotter.exe file.
I have wcf client. It uses .NET 3.5.
When I compile the client I get two files:
client.exe and
client.exe.config.
The second file contains configuration for the wcf client.
In my case I need to prevent the user sitting on the computer to see the urls and change some other parameters from the config file.
So the requirements are, the end user not to see and modify the data stored in the config. The config file contains the same data as app.config. I need to forbid the person using the program to see the end point urls so easy.
Also I have a lot of configuration there so I do not like to code in the moment.
Is there any solution for the problem (embedded app.config of something else)?
Edit: I do not need configurable options. The config file is automatically created when adding service reference from the studio.
Regards
You can also create your proxies programatically instead of using the service reference feature.
Every parameter in the serviceModel config section can be represented in code as well.
The ChannelFactory class will help you create proxies to the service.
You can easily encrypt entire parts of your config files - and not just web.config in web scenarios, but also application config's in stand-alone apps.
Check out some resources on how to do this:
Encrypting web.config values
Encrypting passwords in .NET app.config file
Encrypting the app.config file for Winforms application
Where is it best practice to set up the configuration such as connection strings or web service URL's in SharePoint 2010's Web Parts?
Web parts do not contain a web.config or an app.config and for good reason. So i wanted to know what everyone else does.
Would it be a good idea to create another assembly file along with your project?
Bill.
WebPart refers the configuration file web.config of the Web Site where it is deployed to. So we all use web.config for storing all the configuration.
Below Links will help you to get the value from the Web.Config
To Read Connection String.
To Read application Settings.