Is there a way to run a project inside a solution that has more one project (read: web applications) and avoid the autostart feature of the integrated asp.net webserver in Visual Studio?
I have a big solution that has Windows forms projects, Windows Services projects, Web applications, Windows Libraries etc., sometimes I just want to debug the desktop application but each web application project starts a webserver and that slows down the execution process (when starting the application of course) and I would like those webservers to be disabled since im not using/debuging those projects but some other developers in my team are.
Thanks.
Select the project you don't want to start up automatically in solution explorer and in the properties pane set "Always Start When Debugging" to false
You could just create a new solution with only the project(s) you are working on.
Related
I started using Xamarin Studio for c# development and I wrote two 'Projects' in one 'Solution' - Server and Client. When I run Server, everything goes well, but the problem is, that I don't know how to run client at the same time.
Please help how to run both at the same time. I've googled but found nothing.
In the Solution options (right click the Solution in the Solution window and select Options) you can configure multiple startup projects in the Run - Startup Project section.
Testing this with Xamarin Studio 5.8 running two console apps, using Run - Start without Debugging, seems to work but debugging two console apps fails. Also you do not seem to be able to debug an ASP.NET app with a separate client app, but you can run both together without the debugger.
If you need to debug both then running two instances of Xamarin Studio will allow you to do that.
I have a GUI based windows application which is an .exe application(TestServer.exe )application. Now I need to add a windows service to this project solution.
So the solution would then build two executables. The first is the one it is currently building using the UserApplication; MyTestServer.exe
The second would be the new Windows Service; MyTestservice.exe.
Both would share the MyTestServerLibrary and our 3rd party dlls.
How can i do that in C# - Visual studio 2010?
As #nvoigt said, you simply add another project to your solution. If you'll right-click on your solution in the Solution Explorer window, select the Add|New Project... menu option. In the resulting dialog, select the Windows Service project type, give it a name, and press OK. Note that this step assumes you have one of the paid versions of Visual Studio 2010. My recollection is that the Windows Service project type is not delivered with the Express version.
From there, you simply build out your Windows service project just like you would any other project. If you've never done this before, I've got a set of instructions for how to do this here. The instructions target Visual Studio 2008 (I really need to update it...), but they are practically identical for Visual Studio 2010.
At this point, when you build your project, you'll get your TestServer.exe, any other C# assemblies that are part of your solution, and the newly-added Windows service executable. By default, running the Windows service directly from the Visual Studio debugger won't work for two reasons. First, your solution probably has TestServer.exe marked as the startup project, which simply means that when you press F5 to start debugging, the TestServer.exe will be run. But even if you change the startup project to be the new Windows service, it still won't work because services don't start the way normal Windows applications do. To get around this, you can look at the instructions here for how to have your Windows service operate in an "interactive" mode, which will let you debug it like any other application. For my purposes, though, I prefer to debug my Windows service when it's actually running as a Windows service. To do this, just put a call to System.Diagnostics.Debugger.Launch() in the constructor for your Windows service. Providing you are an administrator on your system, this will give you the opportunity to jump into a debug session when you start the service from the Services console.
This leads directly to the point of installing the service. To actually run a Windows service, it has to be installed on the system. For .NET-based Windows services, you can use the Microsoft-provided InstallUtil.exe to do this. If you open the Visual Studio command prompt from the Start menu, it's available in the directory path. I prefer the solution that Marc Gravell suggested to have the Windows service install/uninstall itself. I've got a set of instructions for how to do that here.
That should get you started. There are many good answers regarding Windows services on SO, so if you get stuck, be sure to search for it on this site. HTH.
What is the difference between using Visual Studio 2012 "Run as Administrator" mode and otherwise? Why do developers prefer using VS in administrator mode? What are the advantages/privileges that one gets?
I may be naive enough to ask this one but I am just curious. Thanks.
From MSDN: User Permissions and Visual Studio
You can do nearly everything in the Visual Studio IDE as a normal
user, but, you need administrator permissions to complete the
following tasks:
Installing Visual Studio.
Upgrading from a trial edition of Visual Studio.
Installing, updating, or removing local Help content.
Developing solutions for SharePoint 2010.
Acquiring a developer license for Windows Store.
Adding classic COM controls to the Toolbox.
Installing and using add-ins that were written by using classic COM in the IDE.
Using post-build events that register a component.
Including a registration step when you build C++ projects.
Debugging applications that run with elevated permissions.
Debugging applications that a run under a different user account, such as ASP.NET websites.
Debugging in Zone for XAML Browser Applications (XBAP).
Using the emulator to debug cloud service projects for Windows Azure.
Configuring a firewall for remote debugging.
Profiling an application.
Deploying a web application to Internet Information Services (IIS) on a local computer.
Changing how you participate in the Visual Studio Customer Experience Program.
Windows Vista introduced User Account Control which means that you are running all programs as a standard user even if you are an admin. There are certain things that you in VS that requires you to be running as an admin, not a standard user. For example running Windows Azure emulators, asp.net dev server, etc.
You can run VS as a standard user but sooner or later you will run into issues.
Currently I have a solution with Windows and WP7 XNA projects in it.
Whenever I try to debug just the Windows project it thinks it needs the WP7 emulator and decides to launch it. I opened up the Configuration Manager and created a new configuration just for Windows debugging and unchecked the building and deploying of all my WP7 projects yet it still insists on having the WP7 emulator open.
Is there a way to stop this behaviour?
In Configuration Manager uncheck deploy next to windows phone project
I bet it's very similar to this issue with multiple ASP.NET Development Server instances loading up no matter what project is being debugged. I can't check this right now to be sure, but I bet there might be a similar setting to this "Always start when debugging" option for the emulator.
So opening the Properties Window (View->Properties Window, not the View->Property Pages one) and then clicking on the project in Solution Explorer, then look for a similar setting to "Always start when debugging".
Alternatively, have you tried setting the target to a be Device instead of the emulator? That might also be a workaround.
It's probably because It's set as the startup project:
How to: Set Startup Projects
For a web application I am using ASP.NET C# (OS- Windows7, .NET 4) and the task has done. But I don't know how to run it locally in Windows7 as well as in Server 2008(.NET 4 and IIS installed in server 2008). And I have to run it in both the platfrom. So any help please. Thanks a lot.
If you have IIS 7 installed on your Win 7 machine, then:
Open you project in VS.NET
Right click on your project's node in solution explorer and choose "Properties"
Switch to the "Web" tab.
Select the radio "Use Local IIS web server"
Click the "Create Virtual Directory" button
That takes care of getting your application to run using IIS. You can also develop/debug ASP.NET applications like this.
As regards, deploying your ASP.NET application, after making sure all pre-requisites are installed. You'll need to use IIS Manager to create a website and associate that website to an application pool.
At first you need .NET 4 Framework on the local computer and you have to add the IIS functionality from Windows 7 corresponding add/remove software (activate functions). I presume you have Windows 7 Pro, because the home / basic edition aren't supporting server / development task like those.
If this tasks already is done, i think you just have to put your files into the iis (standard) inetpub folder (c:\inetpub\wwwroot). You can configure IIS in Windows 7 on mostly the same way as in Windows Server 2008.
Because it appears that you aren't a user of Visual Studio I would also recommend trying Visual Web Developer Express or WebMatrix. Both of those ships with an internal webserver that starts/stops themself while debugging the web application.