Request.ServerVariables("HTTP_EMPID"). Is this CUSTOM (Warning: Classic ASP) - iis

I suddenly have to support a Classic ASP web app (yes, I know it's older than dirt).
I am using VS2017 to attach a debugger and debug it. When I debug the code I notice that the code appears to depend on the following variable being set
Request.ServerVariables("HTTP_EMPID")
and I don't see where this is set anywhere. Usually, I expect server variables to be read only and provided by IIS but this looks like a custom variable and is not in this list
https://www.w3schools.com/asp/coll_servervariables.asp
I don't have access to the web server. Is it somehow possible to configure a web site to populate this variable perhaps via an applet or some other means? If I could trace debug this code this would help me tremendously and this is one obstacle.

Related

Debugging a node.js project in Visual Studio 2022

I'm trying to expand a sudoku web application that I've checked out locally with visual studio 2022, namely this one: https://github.com/michel-kraemer/sudocle
My goal is to implement additional functionality and I'm using this as a learning experience in frontend development since I'm currently only doing backend. I can get the application to run in my localhost using node.js as detailed in the readme and I can modify some very basic things (e.g. changing texts) but to really get started, I would like to debug the application as it's running on my local server. The expectation is that I could set breakpoints in function that I want to modify to see the state of variables at runtime.
This is where I'm stuck. I've tried attaching the debugger to various processes and I can get it started from the next.config.js file, however I think it's not connected to my localhost then and I'm not sure how to trigger any functions from that point. Maybe I'm also misunderstanding the functions of a debugger in a web application.
For what it's worth, those are the sites I've been reading trying to solve my issue, so far with no luck:
https://github.com/Microsoft/nodejstools/wiki/Debugging
https://learn.microsoft.com/en-us/visualstudio/debugger/troubleshooting-breakpoints?view=vs-2022
https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_auto-attach
F5 or Start Debugging Button is Greyed Out for Winform application?
https://learn.microsoft.com/en-us/visualstudio/debugger/debugger-feature-tour?view=vs-2022
I hope a more experienced dev can help me out here.

Using Azure SDK for JS to create .NET 4.x App Service

I'm starting to wonder whether this is the right tool for the job, still here goes.
I'm attempting to automate the creation of our Azure Test environment using Azure SDK for JS. The environment spans many services (as you can imagine), including Classic ASP.NET app services.
Node is my safe space, so that is why I started with the JS SDK.
I have started scripting the creation of an app service using WebSiteManagementClient.webApps.createOrUpdate. I'm confused though, there is seemingly no way to configure any of the following:
Which app service plan the app service should be connected to. This feels fundamental.
The operating system, Windows or Linux.
The stack version, .NET 4.8, .NET Core, or whatever.
Is it possible to configure the above using the JS SDK, or am I going to have find another approach?
Update 23/03/21
Untested, but these are my findings so far:
App Service Plan - The plan is set using the serverFarmId property of the Site interface.
Operating system - Assuming Windows as the default, if you want a Linux app service, you change the kind property of Site from app, to app,linux.
Stack & version - In the SiteConfig interface, you have linuxFxVersion and windowsFxVersion. Again, I think the assumption is 'latest .NET' (e.g. .NET 4.8). For .NET Core 3.1, the setting looks to be DOTNETCORE|3.1.
It can be achieved using js SDK. I checked the source code and it is ok. But I don't recommend to use js sdk to do this.
Because you need to call the SDK, there are many internal logics that you need to code. This will waste a lot of your time. So I recommend you to use restapi.
The restapi method name is similar to the naming in the SDK, mainly because you can test api interfaces online to achieve the functions you want. So you can selectively choose the method you want to achieve the function you want.
Official doc
Web Apps - Create Or Update
As for your concerns, you only need to write all the configuration in json format and put it in the request body.
Tips:
First use the online interface, encode the json format, create a webapp according to your needs, and then integrate it into your code.

ASP.NET Core Application Insights adaptive sampling

TL;DR: Does ExcludedTypes in Microsoft.ApplicationInsights.AspNetCore SDK default to Exception and Trace?
I am running an ASP.NET Core 2.2 app with version 2.6.1 Microsoft.ApplicationInsights.AspNetCore SDK. I am reading: https://learn.microsoft.com/en-us/azure/azure-monitor/app/sampling#configuring-adaptive-sampling-for-aspnet-applications where they write that the default values for ExcludedTypes is Trace and Exception, which is just the way i like it, but I am wondering, since the default values is for ASP.NET (actually specified in the application insights config for the host), if these default values also apply for ASP.NET Core applications that doesnt have an application insights config file (all config is done through code).
I know that the SDK is open sourced, but I haven't been able to search through it and find the initial values: https://github.com/microsoft/ApplicationInsights-aspnetcore. Maybe I am just searching for the wrong things.
Update:
Yes, the default ExcludedTypes for asp.net core is Event. There'are 2 places mentionded that:
1.In this article, it says "In ASP.NET Core, exact same default behavior is enabled in code.":
2.In the source code, you can find it's defined here:
First, the default values for ExcludedTypes is not Trace and Exception, it is Event. There is a GitHub issue for that. And I also tested it myself, the default ExcludedType is Event indeed.
For asp.net core, the default ExcludedType should be same as asp.net, you can take a look at this section of the article you provided. I'll try to go through the code to find out what's in the code for asp.net core and will update you later.

Debugging a deployed cloud service app

How can a deployed cloud service application be debugged?
I am trying to render a RDLC report in my application using Topics & Subscriptions.
Whenever I run the cloud app locally, I don't receive any errors. But as soon as I deploy it over the cloud, I get an error which aren't described up to an extent so that it can be rectified.
I found that the error comes when the report is ready to be rendered and not anywhere else.
I am looking for a possible mechanisms (inserting breakpoints like we do locally, etc.) using which it is possible to debug a deployed cloud app.
Since I am using VS2012 Express & professional, intellitrace does not work here.
You need to enable Remote Debugging for your Role, and you will be able to debug your code in the cloud with any type of Visual Studio.
I don't think you can, however Intellitrace was build for that purpose. You enable Intellitrace in your cloud instances, and then you can "playback" that instance locally, thus debugging and spotting the exceptions thrown.
Here's MSDN's article on that
http://msdn.microsoft.com/en-us/library/vstudio/dd264915.aspx
Having Intellitrace only in the most expensive version of Visual Studio makes developing for Azure far more expensive than it is advertised at. There are some situations, such as when a role is starting up, that you pretty much can't do anything without Intellitrace. If you find that you are in one of those edge cases 'evaluate' VS ultimate in a local virtual machine. You may need to re-evaluate at some point in the future, in which case you will need another VM.

Runtime error: "Cannot find the library com.ibm.xsp.extlib.library" (browser)

I just created my first Xpage application, and I now wanted to port it to a simple mobile application, using the mobile controls in the Xpages Extension Library. Notes/Domino 8.5.3 Upgrade Pack 1 are installed on both client/Designer and server.
The Xpage application works fine in both client and browser.
I created a new Xpage, called "mobileMainPage", and simply add a Single Page Application control to it, save the file and attempt to open it through a browser (Safari first, then IE 9 just to test). In both cases I get the following error message:
Unexpected runtime error
The runtime has encountered an unexpected error.
Exception
Cannot find the library com.ibm.xsp.extlib.library, required by the application /Contacts.nsf.
I am opening the database on the server (entering the URL of the .xsp file in the browser). I am not using the preview browser feature of Domino Designer, but is calling the page like a user would.
How do I fix this? I even tried to install Upgrade Pack 1 once more. Still getting the same error message.
It really sounds like the library is not installed on the server.
type tell http osgi ss com.ibm.xsp.extlib on the server console and verify that the plugin is installed, that command should return a list of the extlib plugins and fragments and if they have been correctly resolved or not.
in your Domino console type:
tell http xsp diag com.ibm.xsp.extlib
also try:
tell http xsp diag com.ibm.xsp.extlib.mobile
This will tell you whether or not the plugin is resolved. If the plugin is not found it means the plugin is not installed the to correct location (domino/data/domino/workspace/applications/eclipse/plugins).. If a plugin that extlib depends on is not resolved it will show in the console.
Chapter 3 of the XPages Portable Command Guide goes into this in great detail :-)
Let me know the results of the above command
Make sure to tell your app that it should use the extension library. Open the Application Properties and go to the Advanced tab. Here, verify that the 'com.ibm.xsp.extlib.library' is checked.
I just encountered a similar issue when firing up a new server in a virtual machine (was testing out an issue with different server version). I included notes.ini setting OSGI_HTTP_DYNAMIC_BUNDLES and pointed it to a updatesite database I hastily replicated over from another server.
I am not certain for sure, but once I added my new server to the updatesite and restarted http, it took.

Resources