13

I'm running into a problem all of a sudden. I recently re-deployed my .net application on AWS elastic beasnstalk instance and now have an extra segment appended to my web root.

Now my URL structure looks like this:

http://domain.com/Project Name.Web_deploy/default.aspx

I have not made any changes to either my project or AWS configuration. What could be causing this?

When I logged in to RDP instance, I found one web.config on IIS root with some rules where I found project_name.Web_deply.

I am not using any FTP or AWS console to update my recent code instead I am using AWS explorer for Visual Studio 2010 which internally using git.

I am using windows server 2012 with sql server 2008 on server.

kingdango
  • 3,979
  • 2
  • 26
  • 43
Naman Goyal
  • 375
  • 2
  • 17
  • Have you try to do this without AWS explorer means using AWS console for deployment? if yes, same issue occur or that time your application working properly? – Tarun Mathur Sep 10 '13 at 13:05
  • @TarunMathur: Yes I had tried with AWS console. I have created a package zip and deployed using AWS console, but still the issue persist. – Naman Goyal Sep 10 '13 at 13:07
  • 1
    Have you include that extra folder in your zip, if yes than you can directly include your projects pages and folder. If possible can you please share your root folder path. – Tarun Mathur Sep 10 '13 at 13:14

2 Answers2

21

It seems that in the latest updates to Visual Studio 2012 and 2010, VS removed those configuration options from the project properties page (IIS Web Site/application name to use on the destination server). Instead you can directly specify the website/application name by editing the .csproj file. You can add the to the appropriate element.

If you want it to apply to all Configurations and Platforms and deploy at the root, you can include it in the element, i.e.

<PropertyGroup>
        .....
        <DeployIisAppPath>Default Web Site/</DeployIisAppPath>
</PropertyGroup>

Or for Release|AnyCPU build target and your own virtual directory:

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
        <DeployIisAppPath>Default Web Site/MyVirtualDirectory</DeployIisAppPath>
</PropertyGroup>

Hope this will work

Tarun Mathur
  • 865
  • 1
  • 8
  • 25
4

When applications are deployed to virtual directories, the Elastic Beanstalk on-instance tools will create a web.config at the root level which uses URL rewrite rules to redirect requests for the root to the virtual directory.

In Visual Studio 2010, you can open the project properties, choose the Package/Publish Web tab, then find the field on that tab labeled IIS Web Site/application name to use on the destination server.

By default, the value will be a virtual directory like Default Web Site/MyApplication_deploy. If you want to deploy your application to the root, change this to Default Web Site/ and redeploy.

Jim Flanagan
  • 2,129
  • 15
  • 19