MVC Sitemap is not working when I deploy it as IIS website - mvcsitemapprovider

I have added the MVC SiteMapProvider to the ASP.NET MVC4 App through nuget
Added the sitemap menu & sitemap path html helper in the layout.
When running the web application in Visual Studio Development Server i got the sitemap menu and sitemap path breadcrumb got generated successfully for the links i specified in the Mvc.Sitemap.
But when i try to run the same application in IIS Express or through IIS, Nodes are not getting generated. Just the generated without any nodes. No errors were thrown. In IIS i run as .net 4.0 integrated.
Any more configuration need to add or need to add any modules in order to run under IIS apart from the configuration generated from nuget in web.config.
Thanks in advance.

I suspect that you haven't deployed your HTML helper templates. Be sure you copy over the contents of the /Views/Shared/DisplayTemplates/ directory to your server.

Related

Deploy angular 4 App in IIS

I have a multi-tenant Angular 4 and .Net core 2.0 application.
I have hosted .Net core API in IIS with deployment time debugging and for that I have followed this link.
https://learn.microsoft.com/en-us/aspnet/core/publishing/development-time-iis-support
With this configuration in IIS, I can access my API any time and if I want to debugg it, I can run it in VS.
Now, Is it possible to run Angular app directly with IIS. I mean is there any way that npm start will directly open app in specific IIS url like app.myapp.local, and not at localhost:4200
what I have did so far?
I have added one folder in wwwroot/myapp, and I have pointed it to Default web site in IIS.
then, I am building my app with ng build, copying all content of dist folder to wwwroot/myapp.
Is there any proper way in Angular, to handle this kind of scenario?
this question is not same as this Deploy angular application on IIS
because as I specified, I want to start my app in debugging mode at specific URL without building it, So please don't add it in duplicate without understanding question.

MVC 5 View Looks Different On Production Server vs IIS Express

I have a site that is built using c# in MVC5. Everything works fine in testing environment which is hosted on IIS Express. But as soon as I published the site to the proper IIS that will host it online the pages render very differently. Not all css is changed but some is and it seems to effect the js code as well. Here is an example of what the difference looks like between iis express and production.
What makes all of this so strange is that there is no error in either Visual studio of the dev console.
Any help would be greatly appreciated as i cannot figure this out for the life of me.

Missing Documentation for web.config for a Node.js application on Azure Website

I'm running a Node.js server as API for my mobile app on a Windows Azure Website. And I'm having some trouble with it due to the needed web.config - but I couldn't find any really helpful documentation about it. Everything I can find is googling for specific problems on it and with a bit luck I can use the config snippets.
is there any general documentation about the contents the web.config can contain and their meaning?
in the start I had the problem that errors were modified by IIS to a general error. But since it's a REST API I want the HTTP status codes to be returned. I got around that with the <httpErrors existingResponse="PassThrough" /> element, but it doesn't seem to work for every error.
The only documentation I found so far are example configuration files of the iisnode module.
If you see the following error:
web.config not found in project, to create a project to deploy to
Windows Azure you must create a Windows Azure Node.js project.
....you may have created the wrong type of Visual Studio Project. You want a "Windows Azure Node.js Application" not a "Node.js Web Application". The former creates a few extra files that are needed for Azure (Web.cloud.config & Web.config).
You may be able to create a dummy VS project of the correct type and then copy these files into your existing project. Alternatively create a new project of the correct type and copy your source files into the new project.
Create Azure Basic Node.js Express Application

Is it possible to make a self-hosted project of a ServiceStack+MVC3 like SocialBootstrapApi?

I am learning how ServiceStack works with the help of self-hosting projects.
Self-hosting projects are much easier to debug and understand, since no magic happens inside IIS.
I followed these steps, read http://www.servicestack.net/mythz_blog/?p=785 and applied them backwards.
It worked fine for Docs, but not for the SocialBootstrapApi. The code in Application_Start() from Global.asax is the problem I think
Steps for ServiceStack Docs
Download the ServiceStack Docs sample project
Create a new console project (.Net 3.5 since Docs is still 3.5)
Copy all files from old web project except web.config. (I first used drag and drop, but that only moved the file, it didn't update the .csproj file, so I had to use an editor to copy some ItemGroup sections.)
Move AppHost into a separate class file, changed to inherit from AppHostHttpListenerBase
Copie the Programs.cs file from the RazorRockstars project
Change the baseUrl: var baseUrl = "http://localhost:2001/"; // ConfigUtils.GetAppSetting("WebHostUrl");
Copy the app.config file from RazorRockstars project (but this wasn't needed)
Change output path for console project to .\ because otherwise PageManager.Init got the wrong path and most files were not found
When you done this, download the complete ServiceStack source code and recompile in Debug mode, replace all ServiceStack references in the Docs project by the newly compiled things. Now, you can easily step through all ServiceStack-code, set breakpoints etc, and understand what is happening and when. Console projects also have some other advantages, they start faster, Edit-and-Continue works more often.
For SocialBootstrapApi I did the same except/and
Renamed web.config to app.config
Commented away // [assembly: WebActivator.PreApplicationStartMethod(typeof(SocialBootstrapApi.AppHost), "Start")]
Now, the normal ServiceStack part of the project works, although the url is without the initial /api/
Tried moving Application_Start() from Global.asax to AppHost.Configure ==>> Refuses to start
ASP.NET MVC can't be hosted in a self-hosted HttpListener (since it's coupled to ASP.NET), but ServiceStack does support hosting it's Razor and Markdown view engines inside a self-hosted HttpListener app.
The Razor Rockstars website is a show case website of ServiceStack's Razor and Markdown view engine support. razor-console.servicestack.net is the same website hosted in a HttpListener self-host. The source code of RazorRockstars is on GitHub with the RazorRockstars.SelfHost example contains the source code for razor-console. The one thing you have to remember with self-hosted websites is that the Razor view pages Build Action in VS.NET needs to be set to Copy if Newer so the views are copied in the /bin directory so they can be found by ServiceStack at runtime.

system.webServer/fastCgi/application not working in web.config

How do I register an IIS FastCGI application in a MSDeploy's web.config file as documented?
I'm trying to build a simple test MS Web Deploy package installable by
the Web Platform Installer via a custom feed. I'm trying to
register a FastCGI application in the packages web.config as the
docs indicate is possible. You can see the web.config file below
or in github:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<fastCgi>
<application fullPath="C:\Python27\python.exe" arguments="-u C:\Python27\Scripts\iiswsgi-script.py" monitorChangesTo="C:\Python27\Scripts\iiswsgi-script.py" maxInstances="1" />
</fastCgi>
...
This doesn't work when installed via the Web Platform Installer and then tested through Web Matrix/IIS Express. However, as soon as I run the appcmd.exe command as below and in the install.cmd batch file:
set IIS_BIN=%ProgramFiles%\IIS Express
"%IIS_BIN%\appcmd.exe" set config -section:system.webServer/fastCgi /+"[fullPath='%SystemDrive%\Python27\python.exe',arguments='-u %SystemDrive%\Python27\Scripts\iiswsgi-script.py',maxInstances='1',monitorChangesTo='%SystemDrive%\Python27\Scripts\iiswsgi-script.py']" /commit:apphost
...the FastCGI app works just fine. IOW, it seems like the <fastCGI><application> elements in web.config don't take effect, but they do in IIS's applicationhost.config even though the docs indicate this is possible in web.confg.
Is there a way to get this to work in the specific app (through web.config or otherwise) without changing the global IIS config?
I'm doing all this under Windows 7 Professional, Web Platform
Installer 4.0, and Web Matrix 2.0 RC whose about dialog says:
Version 2.0 RC
WebMatrix: 7.1.1587.0
IIS Express: 8.0.8298.0
.NET Framework: 4.0.30319.17379 built by: FXBETAREL
Web Deploy: 7.1.1516.0
SQL Server Compact: 4.0.8854.1
Web Platform Installer: 7.1.1586.1
ASP.NET Web Pages: 2.0.20505.0
ASP.NET Web Pages: 1.0.20105.407
The code behind all this is in IISWSGI on GitHub, use this commit to test. To reproduce the
environment I'm using, see the IISWSGI documentation.

Resources