Solved

how to add a config file in visual studio sql  server project

Posted on 2011-03-24
3
357 Views
Last Modified: 2012-06-27
I have created a sql server project in visual studio 2005 (C#).
in this project I have added a web Reference to a web service.
Now I need to figure our one way by which I can change service URL without recompiling the project and then regenerate the dlls.

some thing like adding the URL in config file
0
Comment
Question by:ziorinfo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 2

Accepted Solution

by:
byfour earned 125 total points
ID: 35213130
Step1 : First create your App.config file, externally using a notepad
Step2: Right click on ur project and select ADD -> Existing Item and select the created app.config file by selecting all files under the file type.

I hope this will solve ur problem!
0
 

Expert Comment

by:angelalaw
ID: 35214360
I have worked with this before.  And the web reference when adding to the VS project will hook up to the service and create a soap type xml file that basically give the structure of the web service calls that can be made so the compiler knows.

So as long it is the SAME soap you can program it to change by doing this.

        APIref.PSAPIService apiService = new APIref.PSAPIService ();
        apiService.Url = <url>

APIRef is the alias name of the web service you added.
PSAPIService is the name that the web service is called
then assign the url.

Again to be clear the SOAP calls need to be identical otherwise it can produce errors.

We needed to do this so we could easily go from unit testing to qa testing to production servers with out a recompile.

Hope this helps.

0
 
LVL 1

Expert Comment

by:AVONFRS
ID: 35221444
You can right click your project in Visual Studio > Add New Item > Config File

It will automatically create a config file for you and then you add the necessary values.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question