Domanda

When I sought the hardcoded origin of the port number my Web API uses, I found it in the project's *.csproj file. Yet when I 2-click it from the Find Results window in Visual Studio, it won't open and I'm rather brusquely informed, "The document 'Bla*.csproj' is already open as a project or a solution and cannot be opened in an editor at this time."

To look at it, I have to open it with Notepad++, which shows me what I want:

<WebProjectProperties>
  <UseIIS>True</UseIIS>
  <AutoAssignPort>True</AutoAssignPort>
  <DevelopmentServerPort>28642</DevelopmentServerPort>
  <DevelopmentServerVPath>/</DevelopmentServerVPath>
  <IISUrl>http://localhost:28642/</IISUrl>
  <NTLMAuthentication>False</NTLMAuthentication>
  <UseCustomServer>False</UseCustomServer>
  <CustomServerUrl>
  </CustomServerUrl>
  <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>

...but this is kind of painful. Is there a quicker way to open a .csproj file from within the project/Visual Studio (2013)?

È stato utile?

Soluzione

To edit a .csproj (or any other project file) directly from Visual Studio, do the following:

  1. Right click the project in Solution Explorer
  2. Select "Unload project"
  3. Project is now unloaded
  4. Right click the project again and select "Edit blah.csproj"
  5. Make your changes and save them
  6. Right click the project and select "Reload project" to apply the changes

Altri suggerimenti

Right-click project -> Unload project, then right-click again -> Edit

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top