I am working on an ASP.NET MVC4 application. When I publish it to a server I want to be able to tell it to go to a specific app pool, and if it is not present then I want it to be created.
Currently when I deploy it gets put in the wrong app pool and I have to change it manually in IIS. I would like to automate this step.
Has anyone got any hints about how I could do this?
Thanks
Related
can someone explain whats the difference between these settings?
The reason im asking: default pick was IIS Express and multiple processes used my logger and created duplicates in the log. But when i picked Project, there were no duplicates in the log.
The first is IIS Express that will use IIS Express to host this project and the second is Project that will run this project and debugging it.
If your project include Main that you can select Project to Launch and VisualStudio will debugging it.
The last one is Executable that will use the other application to run this project like dotnet run xx.dll and you should set the running application path when you select Executable and set some arguments. The VisualStudio will debugging the running application like use attached process.
See:Working with Environments and Launch Settings in ASP.NET Core
Use multiple environments in ASP.NET Core
I have a solution A with a web site project that it needs to call another web site project B that is in another solution. I mean different visual studio instances
I don't know how to attach them to debug them at the same time like in a single trace.
Does anyone knows how can i do that?
Thanks
You can do this using two running Visual Studios:
You set up one of the projects in IIS and the other you can run out of Visual Studio directly then you can debug in both.
On the first project (the one running in IIS) you can 'Attach to a process' and attach to the w3wp worker process. See this:
Attach Debugger to IIS instance
Then in the second project just run the project using Debug --> Start Debugging option from the VS menu.
Optionally you can run them both out of IIS and attach to both processes.
Make sure you have debug allowed in your web.config files.
What i can think of is, you can deploy project B with pdb file onto a server and attach remote debugger to that server.
My application can not deploy because of the following error:
Web deployment task failed. (The application pool that you are trying to use has the 'managedRuntimeVersion' property set to 'v2.0'. This application requires 'v4.0'.)
Right now, I'm attempting to deploy my .NET application to IIS. VS is attempting to target the "DefaultAppPool" application pool. I want it to instead target the "ASP .NET v4.0" application pool. How do I do that in Visual Studio?
I am trying to not change any settings within IIS if possible.
I don't know if this would be considered a hack, but it got the job done without any issues.
What I did was I first created a folder in IIS and then converted it to an application. After which, I had it target the .NET 4.0 application pool and voila, Visual Studio was able to deploy the application without the error.
I hope this helps people in the future that Google their issue and come upon my question.
Update
Alright, I've done more research and I'm getting closer.
I specified the application pool in the parameters file but it's still going to wrong pool?
Original Post
I'm in Visual Studio 2012 and would like to know if there is a way to specify which app pool is desired when using web deploy for publishing my web site?
I currently am in the process of deploying a MVC 3 Web App to an IIS 7 server. When I work on the web app from visual studio and deploy through development server, the web app has no problem using a custom .dll that interacts with a local server. However, when I deploy onto IIS 7, the same dll fails to pull data from the server through the dll. I am assuming this is permissions related. I have assigned the AppPool to use an account I created that is a member of the local 'Adminstrators' account. No Success. My account is a member of this group. One quirk I noticed was when I tried to modify security setting in the %WINDIR%\inetsvr folder, which holds the process that runs web server for IIS, I was unable to modify these setting even tho I am a member of the 'administrator' account. Confused about this, and have been running around in circles trying to figure this one out. Any help would be appreciated.
Your web app's associated user definitely don't need to have access permission to %WINDIR%\inetsvr.
Assuming that your website runs on C:\interpub\myWebsite and .Net 4.0, your web app's user needs to have at least reader access to following folders :
C:\interpub\myWebsite
%windir%\Microsoft.NET\FrameWork\v4.0.30319\Temporary ASP.NET Files
If you don't grant those access to those folder then it is so likely that your app won't run.
Also, visit your site with a browser inside your production server and see the detailed IIS error. That might help to narrow the problem down.
NOTE
Also, be sure that your app pool is in integrated mode because ASP.NET
MVC won't work properly under classic mode if you have extensionless
Urls. It is highly likely that you will get 404.