Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio does not generate app.config content when "add service reference"

When I add a web service by using "add service reference" in the console app, the app.config does not generate the configuration. How do I generate this app.config with a specific wsdl? Thanks!

like image 343
SAPNET Avatar asked Jan 29 '10 00:01

SAPNET


People also ask

How can add app config file in Visual Studio code?

In Solution Explorer, right-click the project node, and then select Add > New Item. The Add New Item dialog box appears. Expand Installed > Visual C# Items. In the middle pane, select the Application Configuration File template.

How do I update connected services in Visual Studio?

In Solution Explorer, right-click the service reference and then click Update Service Reference. A progress dialog box displays while the reference is updated from its original location, and the service client is regenerated to reflect any changes in the metadata.

How do I set up a service reference?

To access the Configure Service Reference dialog box, right-click a service reference in Solution Explorer and choose Configure Service Reference. You can also access the dialog box by clicking the Advanced button in the Add Service Reference Dialog Box.


1 Answers

When adding the service reference try clicking on the 'Advanced...' button and then uncheck the 'Reuse types in referenced assemblies' checkbox.

I found this out when I had created a simple project to test a third party service which all worked fine. Attempting to add the same reference to the main project resulted in the app.config and reference.vb file not being generated correctly.

I think this may have been because there were already other web references in the application or referenced applications, however unchecking 'Reuse types' resulted in the files being generated correctly.

like image 53
Carl Onager Avatar answered Oct 06 '22 05:10

Carl Onager