0

I have built and application in angularjs (using angular routing feature) which calls web api services for CRUD operations. Everything works fine when i run the application from visual studio. When I deploy the application on IIS web server script files do not load as they are searched in path which is prefixed by application name. Start up page of my application is Index.html which has following code to load scripts.

<title></title>
<base href="/" />
<meta charset="utf-8" />
<script src="/Scripts/angular.min.js"></script>
<script src="/Scripts/angular-route.min.js"></script>
<script src="/Scripts/app.js"></script>
<script src="/Scripts/xeditable.js"></script>
<link href="/css/xeditable.css" rel="stylesheet" />
<link href="/Content/bootstrap-theme.css" rel="stylesheet" />
<link href="/Content/bootstrap.css" rel="stylesheet" />

When i run the application after hosting on IIS I see files are not loading as below:

script issue

My application url is http://localhost/RoutingSample/index.html

so if change index.html to add application name script files load properly.

<title></title>
<base href="/" />
<meta charset="utf-8" />
<script src="/RoutingSample/Scripts/angular.min.js"></script>
<script src="/RoutingSample/Scripts/angular-route.min.js"></script>
<script src="/RoutingSample/Scripts/app.js"></script>
<script src="/RoutingSample/Scripts/xeditable.js"></script>
<link href="/RoutingSample/css/xeditable.css" rel="stylesheet" />
<link href="/RoutingSample/Content/bootstrap-theme.css" rel="stylesheet" />
<link href="/RoutingSample/Content/bootstrap.css" rel="stylesheet" />

my question is - is there any way of configuring in IIS so that I don't need to modify all html files to add this application name before file paths?

1
  • no answer to this ? Commented Feb 21, 2017 at 19:07

1 Answer 1

0

I resolved the problem by deploying application as new website rather than deploying as web application under default web site.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.