Kentico 12 DancingGoat MVC SiteName is empty or null - kentico

I have installed DancingGoat MVC and i can access the IIS urls just fine
http://localhost:8080/Kentico12_DancingGoatMvc
http://localhost:8080/Kentico12_Admin/Admin/cmsadministration.aspx
When I try to debug the MVC application to look into the inner workings of the sample site, in StartUp.auh.cs file i get SiteName is empty or null exception.
The exception is on following line
// Register Kentico Membership identity implementation
app.CreatePerOwinContext(() => UserManager.Initialize(app, new UserManager(new UserStore(SiteContext.CurrentSiteName))));
How can i rectify this?

The MVC project is likely setup in your Visual Studio to launch under a different port than :8080. Open the MVC project's properties, go to the web tab and note the port after http://localhost in the Project URL field. Then, back in Kentico, go to the Sites tool, and for the Dancing Goat site, add the URL and port to your site's domain aliases (or change the default one in the site setting). Relaunch everything and you should be good to go. Barring that, make sure you have a valid license for your site and localhost, etc.

Related

edit web.config to pass parameters [duplicate]

I have an ISAPI DLL installed under a directory like:
c:\inetpub\wwwroot\emsserver\emsserver.dll
This is a Delphi RAD Server app.
In IIS Manager (Windows 10), under Root (computer name) -> Sites -> Default Web Site -> Emsserver, I have a handler set up to handle "*.dll" requests with that DLL. The end result is I can access the app like:
http://localhost/emsserver/emsserver.dll/some-action
That works fine. All good there, output as expected. But the URL isn't very end user friendly.
Question:
Using IIS Manager on Windows 10, how can I configure it so that I can access the application without the DLL portions of the URL? So, like "http://localhost/some-action"?
Seems like it should be a simple enough thing to do, but I'm not seeing how. I tried setting up a handler both in the root server entry in IIS manager, as well as for the 'Default web site', but neither did the trick. I haven't used IIS in 20 years (been almost exclusively Linux & Apache), so I'm a bit out of my usual neighborhood.
You can use url rewrite to achieve this. Download the module from here.
Here is the result of the rule.

Hosting ASP.NET 5 WebAPI in IIS using a virtual directory/application

I am trying to host a new ASP.NET 5 WebAPI project in IIS, and I am using the ASP.NET 5 RC 1 runtime. The project that I am using is the standard generated template for a new ASP.NET 5 WebAPI project. (No code changes.)
I have successfully published the project using the command line, and I can get the application to work in a new web site using a specific port, such as localhost:12345. For example, accessing localhost:12345/api/values returns the values.json data from the project template.
However, when I try to use an IIS Application folder for the project, I am getting a 404 error. In other words, localhost:12345/WebApi1/api/values returns a 404 error. But I can see Kestrel running on a random port in the Event Viewer, and if I access the data on that port, I do get values.json back, so I know Kestrel is running.
Is there something special that needs to be done to get an ASP.NET 5 WebAPI project working in an IIS Application folder under a web site?
Side note: if I use --server.urls to set a port for Kestrel, it's running both on the requested port and the random port logged in the Event Viewer. (So it's actually available from Kestrel from 2 URLs, not the single one configured by --server.urls.)
Kiran Challa's link above indeed does fix the problem. Put this in your Configure method in Startup.cs
app.Map("/IISApplicationFolderName", (myAppPath) => this.ConfigureApp(myAppPath, env, loggerFactory));
where IISApplicationFolderName is the name of the IIS application folder that you want to host under. The rest of the configuration code moves to the new method ConfigureApp, since you're delegating your configuration to that method.
This also looks to be a temporary patch until ASP.NET 5 RC2 is released.

How to redirect root web site to site collection

I'm having quite a hard time figuring out this problem and I need your help. Here's the scenario:
I have a sharepoint 2010 web application on my port 80. This has 2 site collections, the root, and the /sites/official. My problem is: The root site is empty, but in the future it will be my something (I don't know what yet), but my other site collection is ready to go and I already have an Internet address for it.
What I want to do is configure everything in way that I can type http://contoso.com and get as response my sub-site (yes, its a kind of redirect)...
how can I do it? What and where should I configure it?
add content editor webpart on your root site collection and put this javascript in that webpart
<script type="text/javascript">
window.location = "http://contoso.com/sites/official"
</script>
Open IIS manager
Right click on your SharePoint website -> Properties
Go to tab Home Directory
Choose A redirection to a URL
fill the URL for redirection. for example: http://contoso.com/sites/official
Notes:
Make sure to check A Directory below URL entered to avoid redirect loop
Link to another thread might interest the reader - immediate redirect page in sharepoint
Screenshot:
Add alternate access mapping for the sub-site collection from the central administration.
Central Administration > Application Management > Web Applications > Configure alternate access mappings

Create user friendly alias for a sharepoint site

I have a test Sharepoint server running on a Windows 7 machine. The url is http://liu-t500-01 and i want to create a user friendly alias http://temp for it. i have added
127.0.0.1 temp
to my hosts file (an A/host entry) and i have also created an alternate access mapping in Central Administration
http://liu-t500-01 Default http://liu-t500-01
http://temp Intranet http://temp
However when i try http://temp in the browser the sharepoint site does not come up. This is probably a simple problem but has me scratching my head...what did i do wrong?
Changing the IIS binding only will cause errors. You need to modify the alternate access mappings in SharePoint. There are tons of good articles our there that tell what to do in detail.
Here is just one: http://technet.microsoft.com/en-us/sharepoint/Video/ff679917
Try adding a host header in IIS
In IIS click on your site
choose the Bindings action
Click Add
In the Host Name field enter "temp"
click OK

Handling custom errors with a port in the URL for IIS

I am trying to specify a custom (ASPX) page to handle 404 errors.
I can't seem to do this with IIS because I use a port other than the default.
I have two versions of my site, one exposed (default port) and one on another port, for testing. I'm trying to do this in testing mode first.
If I do:
http://www.mysite.com/notapage ... I get the IIS 404 error.
If I do:
http://www.mysite.com:1234/notapage ... I get a Google error (I use Google Chrome) as if it cannot resolve my site even though http://www.mysite.com/ works.
Any ideas?
On which level you configure this ASPX page for 404? If you did that on default web site, it only works for first test link you provided.
port 1234 should be monitored by another web site. Please check your IIS settings and make sure that that site was configured correctly.

Resources