MSBuild WebDeploy error when deploying to a virtual directory - tfs

I'm a newbie to TFS Deployment, I'm facing a strange issue when I try to deploy to a website in the form ABC\SomeVirtual
The error code is
Deployment on one or more machines failed. System.Exception: ERROR ( message:Can not set attribute "name" to value "ABC\SomeVirtual".. Reason: Invalid site name . )
If I put a site name without '\' it works...
I've tried either to put in the form ABC/SomeVirtual but nothing works... any suggestion?

Seems you are using TFS 2015, in TFS 2015 IIS Web App Management task can only create website name, it cannot create the virtual application name. So you cannot use '\' or '/' to create the virtual application name using this task.
Generally, if the website is not exist, then you can use IIS Web App Management task to create the website first, then use IIS Web App Deployment task to deploy to the website or virtual Application like Site/Application...
If the parent website already exist, then you can directly use IIS Web App Deployment task to deploy the virtual application, IIS Web App Management task is not necessary.
For example:
To create an application named Site/Application (Test0906/0928 in below sample), you need to make sure the Site (Test0926 in below sample) already exist there... Reference below screenshot:

Related

404 error on azure for Asp.Net Web Api Project

I have deployed exact same solution on two servers, one is my own server in my basement and the other one is Microsoft Azure. The project is developed using Asp.Net Web Api 2.
On my own windows server running IIS 8.5 it totally works. For test, you can simply browse this link in your browser and see the error message {"Message":"The requested resource does not support http method 'GET'."} which shows the API has been hit.1
But exact same project on my Azure domain here, you just get a message saying
The resource you are looking for has been removed, had its name
changed, or is temporarily unavailable.
Everything about these two deployments is the same (to the best of my knowledge) and I was wondering if there is any further steps necessary on Web Api app deployment in MS Azure which I am missing.
I finally found the answer to this issue. If there are multiple apps deployed as one single website so each app is located in its own subfolder, you have to go to the configuration section of your web app on Azure and create virtual directories for each of those sub folders.
Ah, my problem was probably a common one. I was using
rootconfig = System.Web.Configuration.WebconfigurationManager.OpenWebConfiguration(null);
and that was returning the root web because the parameter was null.
When I ran it local that worked fine, but after I deployed the root Config was NOT what I wanted and my code was failing.
Switched to direct access via
stringVal = WebconfigurationManager.AppSettings["Foobar"].ToString();
Nice. Plus less overhead.

Multiple applications in one IIS website with MS Release Management

I am using the IIS Web App Deployment Using WinRM extension for MS Release Management vNext template (TFS 2015 Update 2). I can deploy a simple website so I think that my permissions and everything must be set-up properly.
My issue is that I would like to have multiple web applications hosted in a single website and deploy it automatically.
The WinRM - IIS Web App Management task does not seem to have an option for doing this. How can I do it?
I have tried adding a / to the Website name however this gives me an exception:
Exception calling "SetRight" with "2" argument(s): "Could not obtain the user information.".
I found an issue on github.com/Microsoft/vsts-rm-extensions which says that you should do the following:
Add a Manage IIS task which creates the website
Add a Deploy IIS task which deploys to website\app and set the Override Parameters to name="IIS Web Application Name", value="$(WebAppName)" where WebAppName=website\app.
It would be a lot better if the deploy task had an option to add the website application or something.

MVC3 deployment to IIS6 causes page not found but wildcard application maps have been set

I am deploying an MVC3 app to IIS6. If I navigate to the starting point of the application myserver/myapp it redirects to myserver/myapp/Account/LogOn?ReturnUrl= but it then show a 404 page not found error.
The views are in the correct folders. Security permissions are correct. If I deploy locally it works on my local iis7.5 perfectly. wildcard application maps have been set (isapi stuff). After creating a new default MVC3 app and deploying it to the iis6 website that works so there must be something different with the build? The build specifies any cpu. The application pool, the website and the virtual directory all specify .net4. We can't update iis and we can't change servers. Now, I'm out of ideas, any thoughts?
Thanks
Uncheck "Verify that file exists" on the Add/Edit Application Extension Mapping dialog window for your wildcard mapping.

ASP.NET deployment issues (Not working in release mode)

I have an asp.net mvc 2 application which works fine when run from visual studio either in release or debug mode. When the application is deployed to either a remote or local IIS 7 server in release mode it doesn't work.
The error displayed is as follows:
HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.
Now this is a bit misleading however I have worked out why this error message is being displayed.
The application does not have a default.aspx as this is not needed when running mvc apps on IIS7+
I am using attribute routing which is explained in the link below which uses reflection to build the RouteTable. When interrogating the assembly the attributes are not accessible therefore the RouteTable does not get populated
Since there are no routes the web server attempts to list the directory contents and it does not have permission to do that.
Attribute Routing:
http://itcloud.codeplex.com/
ASP.NET MVC Routing Via Method Attributes
Now my question is what is preventing the application from being able to interrogate the assembly using reflection?
DaTribe
Lack of ReflectionPermission is a likely cause. Many hosting companies over-restrict permissions. Reflection is one that is often problematic. GoDaddy and RackSpace both restrict it.
What trust level is your application running? What hosting provider are you using? Do you have RDP access?

Routing problem with particular controller name using ASP.NET MVC 1 in IIS 7

I have joined a team developing an ASP.NET MVC version 1 application. I run this app on my local machine using IIS version 7.5. My operating system is Windows Server 2008 R2 Enterprise Edition. I use Visual Studio 2008 SP1 for development.
One of the controllers in this app is called ReportsController. The route table entries for this controller use 'Reports' as the controller name part. The problem I have is that, using IIS 7.5 on my local machine, I simply cannot access any of the Reports action methods. If I try to access, say, '/Reports/Index' from Chrome or Firefox, I get a 401 Unauthorized response (as seen using Fiddler) and the browser displays its username/password entry dialog.
Please note the following:
All other non-Report pages in the application work correctly.
If I add a breakpoint to Application_BeginRequest, it is not hit when requesting a Reports page.
If I change the Reports routing entries in the route table registration code so that I have to access paths like '/Reportss/Index' (note the extra 's') then these Reports pages work correctly.
I have tried deleting then recreating my Web application in IIS.
The Reports pages work fine if I run the application using the Visual Studio 2008 development server (Cassini).
There is no directory called Reports in the application directory.
The Reports pages work correctly on our UAT environment, also under IIS 7.5.
I have reviewed my IIS setting several times, including comparing them with those on UAT, and I can't see a problem.
While I can use Cassini to access the Reports pages, I would really like to understand what is causing this issue.
If you have Reporting Services installed on your machine. try to create a new web site and use it. If you have SSRS installed on your machine it uses /reports for hosting reports.
I have had problems using the directory name 'Reports' at the root of a .net 2.0 website on IIS 7.5. It generates a 503 Error, indicating that there is an error at the system level before IIS tries to serve the page. I am not sure if reporting services is installed on my server. I just changed the directory name, all links and everything worked.
I have the exact same issue in my MVC Application with reporting services installed on the same server where code was deployed. I have changed the Reporting Manager URL in "SQL Server Reporting Services Configuration" which was hostName/Reports and assigned a new name i.e. SSRSReports so the virtual directory is now hostName/SSRSReports.
Now my application as well as SSRS Reports are working as expected.

Resources