Starting IIS Express cmd rather than VS2022 - swagger

The ASP.Net Core 6 Web Api runs under IIS Express via VS2022 just fine and allows me to load the swagger page (http://localhost:8084/swagger/index.html):
#Software: Microsoft Internet Information Services 10.0
#Version: 1.0
#Date: YYYY-DD-MM 17:49:22
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken
YYYY-DD-MM 17:49:22 ::1 GET /_framework/aspnetcore-browser-refresh.js - 8084 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/107.0.0.0+Safari/537.36 http://localhost:8084/swagger/index.html 200 0 0 6
YYYY-DD-MM 17:49:22 ::1 GET /swagger/index.html - 8084 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/107.0.0.0+Safari/537.36 - 200 0 0 3664
YYYY-DD-MM 17:49:22 ::1 GET /_vs/browserLink - 8084 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/107.0.0.0+Safari/537.36 http://localhost:8084/swagger/index.html 200 0 0 59
YYYY-DD-MM 17:49:22 ::1 GET /swagger/v1/swagger.json - 8084 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/107.0.0.0+Safari/537.36 http://localhost:8084/swagger/index.html 200 0 0 149
When running it from the cmdline:
"C:\Program Files (x86)\IIS Express\iisexpress" /config:applicationhost.config /site:TheWebApi
Swagger does not load returning a HTTP 500:
#Software: Microsoft Internet Information Services 10.0
#Version: 1.0
#Date: 2022-11-19 17:54:41
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken
2022-11-19 17:54:41 ::1 GET /swagger/index.html - 8084 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/107.0.0.0+Safari/537.36 - 500 0 574 8
2022-11-19 17:54:41 ::1 GET /favicon.ico - 8084 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/107.0.0.0+Safari/537.36 http://localhost:8084/swagger/index.html 500 0 574 0
Lex Li's blog How Visual Studio Launches IIS Express to Debug ASP.NET Core Apps was very helpful in me gaining more information on what is going on. Clearly, VS2022 is doing some magic to make things run in debug mode. In my case, I am trying to get a desktop app to launch the ASP.Net Core 6 application, so debugging is not a concern. When I looked into the event log, I found what might be the problem, but don't know the solution:
Application 'C:\Users\sam\source\repos\WebApplication1\' failed to start. Exception message:
Executable was not found at 'C:\Users\sam\source\repos\WebApplication1\bin\Debug\net5.0\WebApplication1.exe'
The problem is the application is .Net 6, not .Net 5. It was originally .Net 5, but it has been upgraded to .Net 6. This has me thinking...
I did just create a new .Net WebApi project (WebApplication2) to compare the applicationhost.conf generated vs the real project (WebApplication1). The WebApplication1 has the following section which was not in WebApplicaiton2:
<site name="WebApplication1" id="2">
<application path="/" applicationPool="WebApplication1 AppPool">
<virtualDirectory path="/" physicalPath="C:\Users\sam\source\repos\WebApplication1" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:8084:localhost" />
</bindings>
</site>
Since I don't want Visual Studio 2022 to be taken into account, should physicalPath="C:\Users\sam\source\repos\WebApplication1\bin\Debug\net6.0"?

In my particular case, there is a desktop application that is managing the execution of the ASP.Net Core 6 Web API application in question. It turns out that it is possible to publish the ASP.Net Core 6 Web API application into a single EXE, which is called a Self-contained deployment. This is what I needed.

Related

SignalR .NET client (xamarin) difference in debug and release

I have Xamarin Android App with PCL shared library where SignalR communication established.
In debug mode it's working.
See IIS trace:
2017-06-24 09:40:50 192.168.1.220 GET
/signalr/negotiate+clientProtocol=1.4&connectionData=[{}]&UserId=1137158
- 80 - 192.168.1.1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/58.0.3029.110+Safari/537.36
- 301 0 0 31
In release mode it's NOT working:
2017-06-24 09:53:54 192.168.1.220 GET /signalr/negotiate
clientProtocol=1.5&connectionData=[%7B%7D]&UserId=1137158 80 -
192.168.1.1 SignalR.Client.NetStandard/2.2.2.0+(Unknown+OS) - 500 0 0 31
And Server-side SignalR code throwing exception somewhere internally (spotted in logs).
It could be fixed by setting 'Linkage' to 'None' in Android compilation options, but i'm not sure if that's correct way to solve this.
(found here SignalR .Net Client fails with 500 server error on device, on simulator works fine)

'204 No Content' no data found in influxdb

Successfully installed influxdb on windows and everything is working as expected locally. But having trouble posting data from outside using http api.
I am able to connect to admin panel locally through
http://localhost:8083/
I am using below command for posting data from a remote server:
curl -i -XPOST 'http://172.29.6.195:8086/write?db=telegraf' --data-binary 'test_load,host=njxap1dbadm01 value=13.64'
I am getting below success message:
HTTP/1.1 204 No Content
Request-Id: d3b58c0c-f620-11e5-80a1-000000000000
X-Influxdb-Version: unknown
Date: Wed, 30 Mar 2016 02:40:55 GMT
log on server side:
[http] 2016/03/29 22:40:55 172.29.18.10 - - [29/Mar/2016:22:40:55
-0400] POST /write?db=telegraf HTTP/1.1 204 0 - curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.16.2.3 Basic ECC
zlib/1.2.3 libidn/1.18 libssh2/1.4.2
d3b58c0c-f620-11e5-80a1-000000000000 0
Even though I got the sucess message on client side some how the data is not getting saved on the database.
I checked for the data from admin panel and returning no data.Checked with curl get also no results.
I have retention policy of 1day for my database.
Please help me resolve with the issue of why the data is not getting saved to database.
I'm trying to reproduce this, but I'm not able to with the latest version on InfluxDB.
~$ curl -i -XPOST 'http://localhost:8086/write?db=telegraf' --data-binary 'test_load,host=njxap1dbadm01 value=13.64'
HTTP/1.1 204 No Content
Request-Id: 38fcfb17-fac3-11e5-8004-000000000000
X-Influxdb-Version: unknown
Date: Tue, 05 Apr 2016 00:13:28 GMT
Logs:
[http] 2016/04/04 17:13:28 ::1 - - [04/Apr/2016:17:13:28 -0700] POST /write?db=telegraf HTTP/1.1 204 0 - curl/7.43.0 38fcfb17-fac3-11e5-8004-000000000000 3.776752ms
Querying:
> use telegraf
Using database telegraf
> show series
key
test_load,host=njxap1dbadm01
> select * from test_load
name: test_load
---------------
time host value
1459815208633910164 njxap1dbadm01 13.64
Do you know what version of InfluxDB you are using?

Neo4J Community Edition Calling Home?

while working on our Neo4J graph application And setting debug logging for the root logger I came across the following statistics like message:
[DEBUG] HttpURLConnection: sun.net.www.MessageHeader#537f294a7 pairs: {GET /?totalmem=12758278144+propids=0+os.arch=amd64+edition=community+dist=unknown+source=maven+numprocs=4+mac=005056c00008+revision=2.1.5:2.1-maint:529/45c3cc04946c2b0e243e48c8252e40cb85931744+tags=spring,sdn,web+os.version=6.3+reg=unreg+relids=0+v=2.1.5+heapsize=47775896+os.name=Windows_8.1+id=641ca9a78ddc53ae+labelids=3+nodeids=0+p=-1 HTTP/1.1: null}{Cache-Control: no-cache}{Pragma: no-cache}{User-Agent: Java/1.8.0_51}{Host: 52.0.233.188}{Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2}{Connection: keep-alive}
[DEBUG] HttpURLConnection: sun.net.www.MessageHeader#167dbd419 pairs: {null: HTTP/1.1 200 OK}{Server: nginx/1.6.2}{Date: Sun, 30 Aug 2015 10:05:40 GMT}{Content-Type: text/html}{Content-Length: 164}{Last-Modified: Fri, 01 Jun 2012 09:48:29 GMT}{Connection: keep-alive}{ETag: "4fc88fed-a4"}{Accept-Ranges: bytes}
I'm more than a little surprised because I haven't configured anything in Neo4j that tells it to share my machine configuration with some web server on the internets.
By the way, I know it is neo4j due to the version number (2.1.5) and community edition keywords, and the ip number 52.0.233.188 which resolves to an amazon aws dns entry but identifies itself as udc.neo4j.org.
I've discovered that this is a by-default-on Usage Data Collector service that Neo4j documents here:
http://neo4j.com/docs/stable/usage-data-collector.html
It contains details about how to disable it also.. Having said that, I really don't like this kind of stuff getting more and more prevalent in software nowadays.
UPDATE 1:
I've tried to disable the udc by following the steps described (http://neo4j.com/docs/stable/usage-data-collector.html#_how_to_disable_udc), but the UDC is still contacted. This is running from my Eclipse IDE, haven't tested yet with packaged fat jar:
[DEBUG] HttpURLConnection: sun.net.www.MessageHeader#32bc2cb97 pairs: {GET /?totalmem=42932072448+propids=1323+os.arch=amd64+edition=community+dist=unknown+source=maven+numprocs=24+mac=005056c00008+revision=2.1.8:2.1-maint:687/5c83ce3a5ddf33259593f719153ce71a6fe89fc7+tags=spring,sdn,web+os.version=6.3+reg=unreg+relids=810+v=2.1.8+heapsize=156271600+os.name=Windows_8.1+id=b599d44d76a45a87+labelids=10+nodeids=409+p=-1 HTTP/1.1: null}{Cache-Control: no-cache}{Pragma: no-cache}{User-Agent: Java/1.8.0_51}{Host: 52.0.233.188}{Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2}{Connection: keep-alive}
[DEBUG] HttpURLConnection: sun.net.www.MessageHeader#77bea48a9 pairs: {null: HTTP/1.1 200 OK}{Server: nginx/1.6.2}{Date: Mon, 31 Aug 2015 11:05:30 GMT}{Content-Type: text/html}{Content-Length: 164}{Last-Modified: Fri, 01 Jun 2012 09:48:29 GMT}{Connection: keep-alive}{ETag: "4fc88fed-a4"}{Accept-Ranges: bytes}

Issue integrating Selenium test suite using jenkins

I am trying to integrate Jenkins with Selenium. I have prepared the following command:
java -jar "D:\CI\TWCP\Selenium plugins\selenium-server-standalone-2.32.0.jar" -htmlSuite *firefox "http://www.google.co.in" "C:\Users\....\Desktop\Test suites\GoogleTestSuite.html" "C:\Users\.....\Desktop\results.html" -firefoxProfileTemplate "C:\....\Mozilla\Firefox\Profiles\s980v5zn.default"
When I execute the command in the command line, it works Perfectly fine. Then I called the same command through Jenkins and I got the following error:
Started by user anonymous
Building in workspace D:\CI\Jenkins\jobs\Google Test\workspace
[workspace] $ cmd /c call C:\Windows\TEMP\hudson600399625489206831.bat
D:\CI\Jenkins\jobs\Google Test\workspace>java -jar "D:\CI\TWCP\Selenium plugins\selenium-server-standalone-2.32.0.jar" -htmlSuite *firefox "http://www.google.co.in" "C:\Users\N_chandanKumar\Desktop\Test suites\GoogleTestSuite.html" "C:\Users\N_chandanKumar\Desktop\results.html" -firefoxProfileTemplate "C:\Users\N_chandanKumar\AppData\Roaming\Mozilla\Firefox\Profiles\s980v5zn.default"
Apr 24, 2013 10:54:07 AM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a standalone server
10:54:08.647 INFO - Java: Sun Microsystems Inc. 1.6.0-b105
10:54:08.647 INFO - OS: Windows Vista 6.1 x86
10:54:08.662 INFO - v2.32.0, with Core v2.32.0. Built from revision 6c40c18
10:54:08.756 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
10:54:08.756 INFO - Version Jetty/5.1.x
10:54:08.756 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
10:54:08.756 INFO - Started HttpContext[/selenium-server,/selenium-server]
10:54:08.756 INFO - Started HttpContext[/,/]
10:54:08.787 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler#13c1b02
10:54:08.787 INFO - Started HttpContext[/wd,/wd]
10:54:08.787 INFO - Started SocketListener on 0.0.0.0:4444
10:54:08.787 INFO - Started org.openqa.jetty.jetty.Server#7ced01
jar:file:/D:/CI/TWCP/Selenium%20plugins/selenium-server-standalone-2.32.0.jar!/customProfileDirCUSTFFCHROME
10:54:09.941 INFO - Preparing Firefox profile...
10:54:12.041 INFO - Launching Firefox...
10:54:14.242 INFO - Checking Resource aliases
10:54:37.079 INFO - Checking Resource aliases
10:54:37.079 INFO - Received posted results
GoogleTestCase.html
GoogleTestCase</td></tr>
</tbody></table>
10:54:37.297 INFO - Killing Firefox...
Tests failed, see result file for details: C:\Users\N_chandanKumar\Desktop\results.html
10:54:37.921 INFO - Shutting down...
10:54:37.921 INFO - Stopping Acceptor ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=4444]
D:\CI\Jenkins\jobs\Google Test\workspace>exit 1
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE
result.html shows failure with below log
info: Starting test /selenium-server/tests/GoogleTestCase.html
info: Executing: |setTimeout | 1000000 | |
info: Executing: |openAndWait | http://www.google.co.in/ | |
info: Executing: |setTimeout | 1000000 | |
info: Executing: |pause | 20000 | |
info: Executing: |verifyTextPresent | India | |
warn: currentTest.recordFailure: false
info: Executing: |assertTitle | Google | |
error: Actual value &apos;Error Message&apos; did not match &apos;Google&apos;
warn: currentTest.recordFailure: Actual value &apos;Error Message&apos; did not match &apos;Google&apos;
If I run the same code adding debug tag i.e.
java -jar "D:\CI\TWCP\Selenium plugins\selenium-server-standalone-2.32.0.jar" -htmlSuite *firefox "http://www.google.co.in" "C:\Users\....\Desktop\Test suites\GoogleTestSuite.html" "C:\Users\....\Desktop\results.html" -firefoxProfileTemplate "C:\Users\.....\AppData\Roaming\Mozilla\Firefox\Profiles\s980v5zn.default" -debug
I get the following logs at the end
GoogleTestCase.html
GoogleTestCase</td></tr>
</tbody></table>
10:58:56.737 DEBUG - Handled by org.openqa.selenium.server.htmlrunner.SeleniumHTMLRunnerResultsHandler#14b7453
10:58:56.737 DEBUG - RESPONSE:
HTTP/1.1 200 OK
Date: Wed, 24 Apr 2013 05:28:56 GMT
Server: Jetty/5.1.x (Windows Vista/6.1 x86 java/1.6.0
Cache-Control: no-cache
Pragma: no-cache
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-Type: text/html
Transfer-Encoding: chunked
10:58:57.002 INFO - Killing Firefox...
10:58:57.018 DEBUG - java.net.SocketException: Connection reset
10:58:57.018 DEBUG - java.net.SocketException: Connection reset
10:58:57.018 DEBUG - java.net.SocketException: Connection reset
10:58:57.018 DEBUG - java.net.SocketException: Connection reset
10:58:57.033 DEBUG - java.net.SocketException: Connection reset
10:58:57.033 DEBUG - java.net.SocketException: Connection reset
Tests failed, see result file for details: C:\Users\N_chandanKumar\Desktop\results.html
D:\CI\Jenkins\jobs\Google Test\workspace>exit 1
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE
I have jenkins 1.509 and seleniumHQ2.32.0
Not able to make out how I am getting "java.net.SocketException: Connection reset" Any help in this regard will be appreciated.
Thanks & Regards,
cK
To check on the issue I ran the jenkins server in Interactive mode. The setting can be seen when you go to services.msc -> Jenkins process -> properties-> click on logon tab and you can select Local system account and tick "Allow service to interact with desktop".
This made jenkins to run the selenium test interactively instead of running in background.
There I could observe browser failing to open the website. This was tackled by following settings services.msc -> Jenkins process -> properties-> click on logon tab --> Select this account and give the account using which you have logged into this system.

Selenium Server - how to run tests I've written (and converted into ruby-rspec)?

I have a large number of unit tests contained within a few Suites in the Selenium firefox IDE.
I've exported the individual tests to ruby/rspec and saved the results.
I've also exported the test suites (they basically require all the unit tests).
I've installed java and downloaded the seleniumk server itself and started it ok (port 4444):
java -jar selenium-server-standalone-2.32.0.jar
Apr 30, 2013 11:46:11 AM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a standalone server
11:46:11.505 INFO - Java: Oracle Corporation 23.7-b01
11:46:11.508 INFO - OS: Linux 3.2.0-40-generic-pae i386
11:46:11.521 INFO - v2.32.0, with Core v2.32.0. Built from revision 6c40c18
11:46:11.634 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
11:46:11.635 INFO - Version Jetty/5.1.x
11:46:11.636 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
11:46:11.637 INFO - Started HttpContext[/selenium-server,/selenium-server]
11:46:11.637 INFO - Started HttpContext[/,/]
11:46:11.678 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler#fa3f1b
11:46:11.679 INFO - Started HttpContext[/wd,/wd]
11:46:11.684 INFO - Started SocketListener on 0.0.0.0:4444
So what do I do now to run the actual ruby-rspec tests that I exported from the IDE and saved on my (Ubuntu) machine?
Have you taken a look at this blog and this

Resources