c# - Refactoring .asmx file in Visual studio -
I created my first ASP web service in Visual Studio 2012, for which the code now looks like this (this file is TestService.asmx.cs
):
using the system; Using System.Collections.Generic; Using System.Linq; Using System.Web; Using System.Web.Services; Namespace MyWS [(namespace = "http://something.org/") [WebSusbyBing (CONForceTwo = WSprofile.basicprofile1_1)] [Systems.CommentNameModel. Toiletbox Itam (fake)] Public Sector WS1: System. Web. Services WebService {[WebMethod] Public string hello () {return "Hello world"; }}}
what I would like to do now HelloWorldService
. For this, I have assumed that the Visual Studio's Rifcocort capabilities should be more than enough, so I chose the WS1
, clicked the refactor and changed the name of the class. However, when the webservice is running, a server error error attempt
Parser error message: Could not create type 'MyWS.WS1'.
From which I conclude that still a part of my project which thinks that the web service name is WS1
I have found that the file < Code> TestService.asmx is unchanged, the line is still
& lt;% @ WebService language = "C #" CodeBehind = "TestService.asmx .cc" class = "MyWS.WS1"%>
My question is as follows:
Is there a way to change the webservice name in the .asmx
file via VS refactoring method ? If not, what is the best way to avoid problems like this?
Thank you.
The functionality of VS refactoring is usually only name (i.e. name, function name , The name of the class), but MyWS.WS1 is viewed as a string by
class = "MyWS.WS1"
VS value < / Em> Whatever the ReSharper plug-in may have its own Refactor module, which can search for string references, but again, you can manually verify it He will need to change are correct and should be applied.
It's perfectly ok to change the service name manually, just make sure that you do not remember anything for a solution-wide regular text search for WS1
.
string
type strings. So if you have var name = "WS1";
This will include "wire" in search results.
Comments
Post a Comment