Adding Virtual directory under DNN website , - c#

I want to create virtual directory in my DNN website and make new database for this site , for this I go to IIs manager and click add virtual directory and browse that site it shows error
HTTP Error 500.19 - Internal Server Error The requested page cannot be
accessed because the related configuration data for the page is
invalid.
Module IIS Web Core Notification BeginRequest
Handler Not yet determined
Error Code 0x800700b7
Config Error Cannot add duplicate collection entry of type 'add' with
unique key attribute 'name' set to 'LogoffHandler*'
Config File \?\C:\Website\dnndev.me\web.config
Requested URL http://www.dnndev.me:80/VirtualDnn Physical
Path C:\Website\dnndev.me Logon Method Not yet determined
Logon User Not yet determined Config Source 116:
117:
118:
Please tell me how can i resolve this problem ........
Thanks

You might need to add
<location inheritInChildApplications="false">
To your web.config file so that DotNetNuke stops handling requests to that virtual directory.
Something along the lines of what is mentioned in this answer https://stackoverflow.com/a/782277/21362
An old blog post I wrote might also help
http://www.dotnetnuke.com/Resources/Blogs/cid/135153/DotNetNuke-Tip-15-Running-a-webservice-inside-of-a-DNN-site.aspx

Related

HangerFire shows 404 error in Production server while deleting faile jobs

When I am trying to delete the failed jobs in the production server i am getting 404 error but I am able to delete them in my local PC.
URL
https://mywebsite.com/hangfire/jobs/failed/delete
HTTP ERROR 404
URL
https://localhost:59141/hangfire/jobs/failed/delete
HTTP 200
Can anyone let me know why this is happening on the production server only.
There is only one server behind this url..
Thanks in Advance…
The issue actually I am facing was - I deployed the hangfire application inside the sharepoint website in IIS.
The path deleting the job was something like this on button click
http://SharePointWebsite/MyAapplicationWebSite/hangfire/jobs/failed/delete
This is the path that is getting generated by the hangfire code internally(I added the hangfire assembly reference to my project). My Share Point application due to some configuration issues is not accepting this huge path. So i changed the path to
http://SharePointWebsite/MyAapplicationWebSite/hangfire/jobs/faileddelete
(I removed one "/" in the path) which worked for me.
How to change automatic generated path :
Take the HangFire Code from GitHub which is opensource now
In the Dashboard Pages you will find FailedJobsPage.cshtml. Update this page contents with the short url that you want.
But this cshtml will not be rendered until you run the custom tool - "razor generator tool"(VS Extension) for this cshtml page which generates cs file
You can see these cs files already present in the GitHub Code (expand the cshtml page you will find the cs file)
After finishing the above steps make sure the same path is configured in the DashboardRoutes.cs file as well.
=========================
"ExtensionlessUrlHandler-Integrated-4.0" in "handlers" section
of SharePoint Application web Config is causing the actual issue

IIS custom errors over domain trust

We have recently implemented a two way domain trust between Company A and Company B.
A classic asp/asp.net application runs on a single instance of IIS6 (running on win server 2003) within Company A's domain. The application is configured to use Integrated Windows Authentication.
When testing from company B machine, the application can be accessed fine.
The issue that we have identified is with custom error pages configured in IIS.
For example:
Company B clicks on a link to '/non_existent_page.asp', it hangs for a bit and then we eventually receive a user/passwd prompt. We then receive the following error in event viewer
Event Type: Error
Event Source: .NET Runtime 2.0 Error Reporting
Event Category: None
Event ID: 1000
Date: 13/08/2014
Time: 16:00:11
User: N/A
Description:
Faulting application w3wp.exe, version 6.0.3790.3959, stamp 45d6968e, faulting module kernel32.dll, version 5.2.3790.5295, stamp 52f3551e, debug? 0, fault address 0x0000bf93.
This temporarily makes the site unavailable for all users.
The user receives the following error in browser:
You do not have permission to view this directory or page using the
credentials that you supplied because your Web browser is sending a
WWW-Authenticate header field that the Web server is not configured
to accept.
When we enter the same URL directly into the browser's address bar, there is no issue and the custom 404 page is displayed.
The site has been added to the 'Local Intranet' trusted zone.
Broken links to aspx pages are handled by the web.config - so no problem there.
As a work around, we remove the custom 404 page in IIS and use the default file version found in windows\help\iishelp\common - This resolves the issue, but we'd really like to use our own page for these errors.
Any ideas on how we could resolve/debug this would be greatly appreciated.
You might need to have a look at the Edit Custom Error Page under IIS.
IIS --> App --> ErrorPages --> Error Codes that you want to modify

Google+ signin "Getting Started" project - problems with IIS

Using the C#/.NET Google+ sign-in quick start project, I'm hitting problems with IIS6. Here are the steps I followed:
downloaded the project from Github
modified the index.html and signin.ashx files to contain my Client ID and Client Secret
running the project on my machine (using the built in web server for Visual Studio 2010) works fine
published to Windows 2003 server with IIS6
added "index.html" as a default document for the web site
set the web site to use an app pool configured for the 4.0 .NET framework
attempted to access the page from Chrome
Accessing the site with no page specified on the URL (https://myserver.com/gplussample/) brings up the Google+ signin button. This works great and I'm taken to the page with my profile photo, circles, etc.
However, when I click the "disconnect" button, nothing happens. Using Chrome DevTools to examine the process, I see this error:
POST https://myserver.com/gplussample//disconnect 404 (Not Found)
The problem is the //disconnect - there's no page name (I believe it should be signin.ashx, as that's what works when I'm running the app on the dev web server with Visual Studio 2010).
I then attempted to access the site with a page name specified:
https://myserver.com/gplussample/signin.ashx
That results in a blank page and again, looking at the Chrome DevTools, I see a 400 Bad Request error for the .ashx handler. I searched and searched for solutions for .ashx handlers and "bad request" errors, with no success in this particular case.
Thinking IIS6 was the culprit, I published the site to an IIS7 instance.
With no page name specified on the URL (http://localhost/gplusoriginal/), I encountered the same error with the "disconnect" button - no action and a 404 error.
When I changed the URL to http://localhost/gplusoriginal/signin.ashx, I received this error:
Could not create type 'GPlus_ServerSideFlow.Signin'.
Again, back to Google and checking on .ashx handlers and issues with IIS7. I found a post about the web.config and specifying the handler there, so I tried that.
<system.webServer>
<handlers>
<add name="GPlus_ServerSideFlow.Signin" path="*.ashx" verb="*"
type="GPlus_ServerSideFlow.Signin" resourceType="Unspecified" />
</handlers>
</system.webServer>
Adding this snippet to the web.config resolved the "could not create type" error, but resulted in another 400 Bad Request error.
So, my questions are: What has to be done with II6 or IIS7 to get this sample project working? Are there additional steps in configuring IIS that need to be completed? Or something missing from the project code?
Thank you
The way that the sample works is that the RESTful endpoints are intercepted by an ashx handler, signin.ashx.cs. The handler can't be directly addressed so routes are setup in global.ashx.cs to map endpoints (/, /connect, /disconnect, etc) to that route handler.
As the sample ships, it assumes the built-in web server running on the root port. When moving to IIS, you need to change the path matchers from Equals to EndsWith in order to match the virtual directory you are deploying to:
// Redirect base path to signin.
if (context.Request.Path.EndsWith("/"))
{
context.Response.RedirectPermanent("signin.ashx");
}
// This is reached when the root document is passed. Return HTML
// using index.html as a template.
if (context.Request.Path.EndsWith("/signin.ashx"))
{
Apologies for the delay on this... but hopefully that fixes it! This fork of the C# starter has the changes in it, tested with IIS, and this update may end up getting merged back into the official sample soon.

Fresh Windows + VS2012 = MVC3 Problems

I just recently got a fresh install of Windows 7 on a my PC running VS2012/VS2010. I have an MVC3 project that ran just fine before I pulled it onto this PC to run. The project still compiles on this PC and I can navigate through my site while running the app in studio (2010 or 2012), but when I tried to POST from ANY form in ANY view and pass an ID by means of the URL like this:
<form id="ScriptForm" action="/MyApp/ControllerName/ActionName/#ViewBag.IDNumber" method="post">
...
</form>
...I got this error. I did some digging and playing around to try to fix this, ultimately taking these steps to try to resolve:
Actually installed ASP.NET via the Windows Components form in Control Panel
Changed the application to use IIS Express
Well, when I changed it to run under IIS Express, I started getting a different error.
HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is
temporarily unavailable.
Most likely causes:
The directory or file specified does not exist on the Web server.
The URL contains a typographical error.
A custom filter or module, such as URLScan, restricts access to the file.
Things you can try:
Create the content on the Web server.
Review the browser URL.
Check the failed request tracing log and see which module is calling SetStatus. For more information, click here.
Detailed Error Information:
Module IIS Web Core
Notification MapRequestHandler
Handler StaticFile
Error Code 0x80070002
Requested URL http://localhost:51596/MyApp/ControllerName/ActionName/1
Physical Path C:\CODE\MyApp\ControllerName\ActionName\1
Logon Method Anonymous
Logon User Anonymous
Request Tracing Directory C:\Users\cbarlow\Documents\IISExpress\TraceLogFiles\MYAPP
More Information:
This error means that the file or directory does not exist on the server. Create the file or directory and try the request again.
View more information »
It's almost as if it is not recognizing that this is a route and is trying to resolve the URL to a physical file (like 1.html) which obviously does not exist. But why isn't it "doing the MVC thing" and using the route? I have this in my global.asax:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
}
And I know this is running because I can breakpoint it.
Specs:
Windows 7 | Visual Studio 2010/2012 | Microsoft MVC3 | IIS Express
I've read all these SO posts, none seem to apply in this situation or do not help (mostly, because they apply to actual aspx pages, where I am trying to load pages via controllers):
The HTTP verb POST used to access path '/' is not allowed
The HTTP verb POST used to access path is not allowed
The HTTP verb POST used to access path '/Membership/user/' is not allowed
The HTTP verb POST used to access path '/Main/[object Object]' is not allowed
The HTTP verb POST used to access path '[my path]' is not allowed
HTTP verb POST used to access path '/' is not allowed in Facebook app
Any ideas?
The problem is here (due to my lack of experience with MVC/CSHTML):
<form id="ScriptForm" action="/MyApp/ControllerName/ActionName/#ViewBag.IDNumber" method="post">
...
</form>
The MyApp used to work on my PC (I'm honestly not sure why it doesn't work now... maybe I had set something up for that name to resolve before?) but it no longer maps to anything. It DOES work on the server, but that's because there is indeed a mapping for "MyApp" in IIS. Simply changing this form to this:
<form id="ScriptForm" action="#Url.Content("~/ControllerName/ActionName/" + ViewBag.IDNumber)" method="post">
...
</form>
...does the job more elegantly and without errors.

what kind of error this Server Error in '/' Application

Server Error in '/' Application.
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "Off".
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's configuration tag to point to a custom error page URL.
That is the default generic error message in ASP.NET.
Re the more specific "what kind of error"; impossible for us to say; it could be a configuration error in web.config, it could be problems talking to the database, it could simply need a hug and some quiet time. Like the message says, either enable remote debug output, or look at the site from the server, and it'll tell you what is actually happening. Or look in the error log (event-viewer by default), which is perhaps more useful.
Note you can replace the error page with something more... user friendly if you like. Like the lolcatz on stackoverflow.com.
Edit the web.config file to have this
<system.web>
<customErrors mode="RemoteOnly"/>
</system.web>

Categories