IIS Express and asp.net 1.0.0-Beta8 - iis-express

after updating my test project to beta8 (not without a huge pain), I finally managed to have my project up and running.
Now, every time I try to debug with IISExpress, I have explicitly point to the page "index.html" and this breaks my angularjs app.
There is a way to map index.html as default document in IIS Express?

I think you need to properly configure the middleware:
app.UseDefaultFiles();
It has some overrides if you need them. You can find more details here.

Related

No backend styling in OctoberCMS after deploying on IIS

I'm having a problem with the backend when I deploy my site to the IIS of my web host, it has no styling. At first I had this problem with my entire site but then I added the IIS configuration code from the documentation to my web.config file in the root map and it fixed the front-end but the backend is still broken. I can still login but there is just no styling, it's a bit difficult to navigate the backend that way ;)
Here is some more info:
PHP version 7.0.19
October system build 419
IIS webserver
This is how my backend login screen look right now
I added some other code snippets that I found on the internet to my web.config file but that didn't solve the problem. Has anyone encountered the same problem? If so, could you tell me what might fix this?
Edit: Chrome Network Tab
To deploying your octobercms to server, you need to change the url parameter in config/app.php file. It's should look like this:
'url' => 'http://yourdomain.com/',
Don't forget it should contain http:// or https:// string.
Hope it helps

Index.html file generated by apidoc.js shows a 404 error after deploying asp.net web api app to server

I used apidocjs to setup the documentation of my asp.net web api app. Everything works fine on my machine when I run my web api in visual studio but not on the server I deployed the app to.
I get a 404 error when I navigate to the index.html generated by apidocjs.
I think it's an issue with IIS.
I need suggestions on how to resolve this?
Ok. Found the problem kind of silly.
I did not include the ~ symbol as part of the path in my anchor tag.
Before I had
I added ~
<li>Docs</li>
<li>Docs</li>
and problem solved!!!
Update.
What I did earlier solved the problem on the deployment i did to my local IIS but not on my remote server.
I had move my static html file into the Content folder of my web-api, edited the link to look like this and the problem was resolved.
Docs
Got this from here. Ordinary html links in mvc razor

Posting site to IIS - cannot find files

I have created a small site, on IIS express all is working fine. I have created on IIS new application and deployed the package to the folder. the server side is asp.net webapi. the bundle configuration is loading fine when i try to enter the home page, how ever the java script files which are referenced on the cshtml page cannot be found
<script src="~/Client/lib/require/require.js" data-main="../../Client/app/requireConfig"></script>
i am getting -
require.js
/Client/lib/require --> 404 cannot be found
and the bundle which works
viewingPanelDirective.js
/NGWeb/Client/app/appComponents/viewingPanel
how can I over come it?
I think i know what might be the cause, i had the same problem myself
in you visualstudio, the js file was running on a url like this
http://localhost:/client/lib/require/require.js
now you published it, and added it as an application to your default site, you would have given it an alias (e.g) "testsite"
meaning that in reality the file is hosted at
http://localhost/testsite/client/lib/require.js
but in reality your site is looking for it (because of the ~) at
http://localhost/client/lib etc etc
Edit in response to comment:
rather than removing the ~ (which you will need to navigate you back to the url root), i would rather just include your app name in the bundles virtual path, like this:
bundles.Add(new styleBundle("~/yourAppName/Content/css")) ....... etc
I also came across this post, I haven't tried it myself but it seems an interesting alternative to my method.
Fixing Relative CSS Paths when using .NET MVC 4 Bundling

Problems hosting multiple ASP.Net MVC3 applications in an IIS7.5 website

Some specs:
IIS 7.5
ASP.Net MVC3
I have three MVC3 applications I would like to host:
Project A
Project B
Project C
I want to get the URLs to be like this, respectively:
http://domain/
http://domain/ProjectB
http://domain/ProjectC
So in IIS, I have the default website, which points to the folder for ProjectA. I then added two Applications to it, one pointing to ProjectB, and one to ProjectC, and their respective folders on the hard drive. I am storing the sites in C:\sites. Each project has a folder in C:\sites where the application's files reside. As you can see, the sites are not nested at all on the server.
When I load http://domain/ProjectB, it is trying to load configuration values from the ProjectA web.config. Obviously this is not what I want, and I'm not that awesome at server configuration. I got it working by wrapping most of the ProjectA web.config in a location tag like so:
<location path="." inheritInChildApplications="false" >
<!-- Lots of web.config stuff for ProjectA -->
</location>
I'm not really a fan of this, it feels wrong. To me, it seems like a nested Application in my site in IIS should not even know about the parent site. What am I doing wrong? I'm sure it is something really small. I would have made ProjectA an Application, but I don't want the alias on it, as I want http://domain/ to pull it up for the users.
Again, I am not that knowledgeable about server stuff, it just isn't fun to me, hence why I'm asking y'all!
Thanks!
That is how it works. By default, asp.net applications inherit their parents web.config, and you either need to override those values in your lower web.config or wrap it in an inheritInChildApplications="false" attribute like you did above.
One possible option is if you can make your home page at the root of the site NOT an asp.net application. If you can't, you're stuck doing this.
on goDaddy you can create iis virtual directories with "set application root", which then makes each director with "set application root" set act as a root directory (just as you want). The user don't notice anything. So you could look and see if you have that option?

Visual Studio Local IIS Web Server Project Url With Multiple Subdomains

I would like to try testing virtual hosting of an ASP.Net MVC website on my local machine. In Visual Studio in the Web tab of the properties file for the MVC project, I selected Use Local IIS Web Server. By "virtual hosting", what I really mean is that I'm trying to make sure that pages load correctly for urls of the form http://sub-domain-i.my-domain.com/MyMvcProject/Controller/Action, where I'm hoping to test multiple subdomains in place of sub-domain-i. In production, everything will be running under a single IP address on one server. I also hope to test https for urls of this form using a wildcard ssl certificate, but currently I'm having trouble configuring Visual Studio to just test regular http. Prior to worrying about sub-domains, the Project Url field in the Web tab of the properties folder for my MVC project said "http://localhost/MyMvcProject", and everything worked fine. However, after changing this to "http://sub-domain-1.my-domain.com/MyMvcProject" and then adding the following line into my C:\Windows\System32\drivers\etc\hosts file,
127.0.0.1 sub-domain-1.my-domain.com
Visual Studio produces the error "Unable to create the virtual directory. http://sub-domain-1.my-domain.com/MyMvcProject". Does anyone know what I might be doing wrong?
Many thanks in advance!
Edit: I've just discovered that if I select Use Custom Web Server instead of Use Local IIS Web server, it works and I don't get the popup error from Visual Studio. I'm still not sure why this solution works, though, or what I was doing wrong by selecting Use Custom Web Server...
A little late, but I hope it helps somebody.
You need to create the binding in the IIS website prior to add it to the project url of the project. That binding must be like
http | sub-domain-1.my-domain.com | 80 | * or 127.0.0.1
How to create a binding

Resources