Question

I think it's associating my Web Service's CS files with the related ASMX files. But whatever's happening, I can't double-click to open the CS files - I have to "view Code" or it opens in the designer.

Anyone know how to turn off this automatic behavior? I just want to edit the code!

Was it helpful?

Solution

Try right-clicking, select "Open with...", mark "CSharp Editor" and select "Set as Default".

That works for avoiding the WinForms Designer.

OTHER TIPS

I found this question when trying to deal with a similar problem. I had a C# class in a file and whenever I double clicked on the file it would try to open in design mode but design mode was meaningless for this class. I just want to see the code.

I found that adding the [System.ComponentModel.DesignerCategory("")] attribute to my class fixed this.

In the Solution Explorer view, click the "Show All Files" icon. This will put "+" symbol next to each of your files. Click the + and it will expand to show the .CS file which holds the ASMX's code. At this point, double click that file instead.

For some reason VS2005 seems to have this a bit backwards when it comes to webservices. To open a webservice in code view, double-click the .asmx file, not the .asmx.cs file.

I guess it makes a bit of sense, as there's nothing to "design" when it comes to a webservice, but it's counterintuitive if you've been working with .aspx files.

In my experience, if you find that the wrote editor, that is the non-default editor, is opening when double-clicking on a file within the Solution Explorer then something is wrong with the underlying project's User Options file (.user) or the solution's User Options file (.suo). (I am not sure which, but I suspect the settings are stored in the .suo file.) Deleting the the .suo and all project .user files solved the problem.

I personally, set the Form Editor as my default editor for forms at the beginning of a project. After the forms are stable and require less user-interface design changes, I switch the default editor.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top