- Details
- Written by: Stanko Milosev
- Category: Core
- Hits: 3129
Create new Asp.Net Core MVC application.
Add application to IIS, as physical path in my case I added "C:\Users\pera\Documents\Visual Studio 2017\Projects\WebApplication1\WebApplication1":
In Visual Studio right click on project go to properties:
Go to Debug, click on new:
In profile name write IIS:
Launch: IIS, Select the check box for Launch browser: http://test:2021/, the Environment variables section, select the Add button. Provide an environment variable with a Name of ASPNETCORE_ENVIRONMENT and a Value of Development:
Restart Visual Studio as administrator, if you haven't already.
Set the Start Debugging button to the IIS profile and select the button to start the app:
- Details
- Written by: Stanko Milosev
- Category: Core
- Hits: 3289
Server Error in '/' Application. Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: An error occurred loading a configuration file: Failed to start monitoring changes to 'C:\Users\pera\Documents\Visual Studio 2017\Projects\WebApplication1\WebApplication1' because access is denied. Source Error: [No relevant source lines] Source File: C:\Users\pera\Documents\Visual Studio 2017\Projects\WebApplication1\WebApplication1\web.config Line: 0In the article "Host ASP.NET Core on Windows with IIS" it is explained how to publish Asp.Net core to IIS. Here are my short notes. First install .NET Core Hosting Bundle. If you simply publish web site without installation you will receive error:
HTTP Error 500.19 - Internal Server ErrorIf you receive error like:
The requested page cannot be accessed because the related configuration data for the page is invalid. Detailed Error Information:
Module IIS Web Core
Notification Unknown
Handler Not yet determined
Error Code 0x8007000d
Config Error
Config File \\?\C:\projects\dotNet\asp.net\core\web.config
Requested URL http://test:2020/
Physical Path
Logon Method Not yet determined
Logon User Not yet determined Config Source:
-1:
0: More Information:
This error occurs when there is a problem reading the configuration file for the Web server or Web application. In some cases, the event logs may contain more information about what caused this error.
View more information »
HTTP Error 500.21 - Internal Server Error Handler "aspNetCore" has a bad module "AspNetCoreModule" in its module listThen you have to change AspNetCoreModule in IIS. Open Modules in IIS:
Either add AspNetCoreModuleV2 with code %ProgramFiles%\IIS\Asp.Net Core Module\V2\aspnetcorev2.dll or change existing one:
Then go to "Handler Mappings", and change aspNetCore to "AspNetCoreModuleV2":
- Details
- Written by: Stanko Milosev
- Category: Ajax
- Hits: 6685
<script type="text/javascript">
function ajaxFunction()
{
var xmlHttp;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
alert("Your browser does not support AJAX!");
return false;
}
}
}
}
</script>
Taken from here.
- Details
- Written by: Stanko Milosev
- Category: JavaScript
- Hits: 600
/*global google, $*/
(function () {
"use strict";
var mapOptions,
mapCanvas,
map;
mapOptions = {
zoom: 13,
center: { lat: 50.7787589, lng: 7.1877042 },
mapTypeId: google.maps.MapTypeId.ROADMAP
};
mapCanvas = document.getElementById('map-canvas');
map = new google.maps.Map(mapCanvas, mapOptions);
var gpsLatLng = new google.maps.LatLng(50.7787589, 7.1877042);
var marker = new google.maps.Marker({
position: gpsLatLng,
map: map,
icon: 'excaliburResized.jpg'
});
}());