I'm working on a web solution in Visual Studio 2010 that is using IIS Express to host the application. I want the build process to copy the output DLLs from some of the projects into a directory under the main web app. There is a watch on this directory that keeps MEF current. The problem is that my builds fail because they can't copy the dlls over the existing ones because the application is left running every time I debug. What I'd like to do is add a build command that stops the site before the build begins.
I was expecting to be able to run AppCmd Stop Site "MySiteName" but appcmd says that STOP is not supported for site objects.
Are there any ways to stop a site from running in iis express from the command line?
Option-1:
If you don't have any other sites running, try
"taskkill /IM iisexpress.exe"
Note: This stops all iisexpress.exe processes
Option-2:
Write some executable utility for doing this. Following link may help you!
Starting and stopping IIS Express programmatically
Windows PowerShell's Stop-WebSite cmdlet is a command line way of stopping a Website hosted on IIS.
Related
I am developing a web project and I am not being able to test it using the IIS Express from the Visual Studio 2015.
I have googled this error and I found many references to it on the internet, but I believe that my case is different, because there is no other error message displayed besides "Unable to Launch IIS Express Web Server".
I've looked at the Windows Event Viewer and I got these errors below:
The worker process failed to initialize correctly and therefore could not be started. The data is the error.
The Module DLL C:\Program Files (x86)\IIS Express\aspnetcore.dll failed to load. The data is the error.
I also tried to launch the IIS Express directly using: c:\Program Files (x86)\IIS Express>iisexpress.exe /trace:error and I was successfull, so I think that the problem must be somewhere within Visual Studio and that my port (8080) is free.
Does anyone knows what else I can do?
If you are working with .NET core/ASP.NET core application then
please make sure you have installed these-
.NET Core SDK
VS 2015 Tooling Preview 2
If it is appeared to be solution-specific then-
Look for applicationhost.config file at <solution-name>\.vs\config\applicationhost.config location
Try removing this file and run solution again.
See if this helps.
I had the same error few days ago. I tried many things but i think Repairing DotNetCore.1.0.0-VS2015Tools.Preview2.exe fixed the issue.
Also, check whether you can run the web app in Kestrel web server. If you can run then worth checking web.config file for the presence of aspnetCoreModule tag properly.
This link might be helpful -- https://github.com/aspnet/Home/issues/1583
I have a solution with many types of projects, and some of them are websites. Usually, I debug a non-website projects, but everytime I start to debug any project in the solution, the local visual studio IIS starts runnning.
Is there any possible way to stop running the IIS server ???
Thanks!
Open your project and go to the projects Properties. In web apps, you should see a Web tab/choice. Click that, then you can configure which/what server you want to start. I think that the default is that VStudio likes to use it's internal IIS Express, but you can configure it to use IIS locally on the box or to use a custom server.
You can actually set the project to not start anything in the Start Action section on that 'tab' as well, and to simply wait until it registers a connection.
Note that if you are trying to debug using a non-local server, then remote debugging will have to be on on the server, which isn't a great idea in production environments.
I'm using WebMatrix2 to run some test sites locally on my box. Each site of course is given its own port number by WM2 (eg localhost:15632 or localhost:12643)
What I haven't figured out is how to run two of those WebMatrix (I suppose they're actually IIS Express sites under the hood) at the same time, so I don't have to go back to the WM interface and choose a site to open. Since these sites each run under a different port can I not run them simultaneously? Or is this a limitation of IIS Express?
You can run multiple sites under IIS Express by starting them from the command line. Navigate to the directory containing iisexpress.exe (usually C:\Program Files (x86)\IIS Express) then use the following command where mySite represents the site to start:
iisexpress /site:mySite
or you can simply open multiple instances of WebMatrix.
Once you have opened your sites, you can manage them from the Notifications area on your task bar.
Here's more about running IIS Express from the command line: http://www.iis.net/learn/extensions/using-iis-express/running-iis-express-from-the-command-line
When right-clicking in Solution Explorer and deploy - it takes seconds.
When running setup /uninstall http://site from the \bin folder of the solution, it takes 13 minutes?! There are 8 features to activate, but my question is why does it take so long; and what is the equivalent command to deploy it the way Visual Studio [2005] does to Sharepoint [2007]?
When VS deploys a WSP it does so using the equivalent of the -local switch. This flag allows a synchronous deployment since it only occurs on the server the command is being run from. Obviously, this is not an option for a multi-server deploy.
If your BAT file is not using this switch then the jobs are being queued to the Timer service for eventual execution. This may be a part of your issue, although 13 minutes seems too long to be explained by this alone.
Here's one example of an STSADM command that offers the -local switch.
VS deploys solutions immediately so that you could troubleshoot any problems right away.
You can do that manually for yourself:
Following your setup command, run this:
%stsadmpath%\stsadm -o execadmsvcjobs
Infact this is part of VS deploy commands.
I have a virtual machine running windows 2003 server running MOSS 2007. This virtual machine is not being run on my dev machine, but on a different machine on the network. I can ping both the host and guest OS from my dev machine. I just need to know, if it is possible, how to configure visual studio 2008 to deploy the web parts/projects/etc to the remote VM when I do this:
Any input will be greatly appreciated! Thanks.
Your screenshot suggests that you're using Visual Studio Extensions for Windows SharePoint Services. VSeWSS as of now does not support deployment to a remote machine.
Sorry we weren't able to support remote development. There are a few options of course but all of them need Visual Studio 2008 and Windows SharePoint Services 3.0 on the same machine.
That is what Paul Andrew said in first reply of this thread.
Only tool that I know of, which does this, is SPDeploy. Though I haven't tried it.
On our test and debugging system we have the problem that our web application is not reachable under http://localhost, which is the normal path VSeWSS uses to deploy a solution.
To solve this problem we've changed the URL within the "Start Action" option from http://localhost to http://our machine's name. You find this setting under "Project"-Menu >> "Properties" >> "Debug"-Tab >> "Start Action" settings.
In or case we still deploy the solution from and to the same machine, but under a different name than http://localhost, so this might also solve your problem.
put your MySolution.WSP in a common share
remote in
run stsadm like this
stsadm -o addsolution -filename ..\MyPath\MySolution.wsp
stsadm -o deploysolution -name MySolution.wsp -url MyUrl -immediate -allowGacDeployment
I am assuming that you are wanting to do this as part of your development process, i.e. quickly update the web part after you've made some changes and compiled it.
If not then ignore the rest of this!
The first time only - Deploy to the BIN directory manually using STSADM/tool of your choice
Ensure when you build that the Assembly Version doesn't change, but the File Version does
Create a batch file to run on the PostBuild step to copy your web part dll over to
//YOURMOSSSERVER/c$/inetpub/wwwroot/wss/80site/bin , or wherever they are in your setup.
In this way each time you build the web part dll will be copied over and automagically picked up by SharePoint on the next page load.
Obviously you wouldn't want to do this on a test/qa/production server.