How to stop NewRelic from running on my local machine? - asp.net-mvc

I am using the New Relic monitoring service with the .NET agent. It runs on the production server.
However, I also get statistics from my local machine when I am testing/developing the application. I used the New Relic Server Monitor Configuration tool to stop the service, and also disabled it with services.msc. But I still see my local machine in the "servers" section when I check my application on newrelic.com.
What should I do (either in my application or with my machine) to stop this?

The Windows Server Monitor is a different application from the .Net Agent. You will need to disable the .Net Agent in order for your development system to stop sending data to your application. If you don't want to have the .Net Agent run at all on your development system you can alter the newrelic.config file in %ALLUSERSPROFILE%\New Relic\.NET Agent to disable it by changing the following:
<configuration xmlns="urn:newrelic-config" agentEnabled="true">
to
<configuration xmlns="urn:newrelic-config" agentEnabled="false">
This has the advantage of being set globally, but if you want to turn it on and off per application you can add the following in the web application's web.config:
<appSettings>
<add key="NewRelic.AgentEnabled" value="false"/>
</appSettings>

I have multiple Azure service configurations (ServiceConfiguration.(Release/Local).cscfg. I simply removed the licensekey from the Local configuration. And uninstalled the two agents on my Windows machine (via Change or Remove a Program).
When I ran the project again locally, it didn't report, so all is good ;)

Related

Visual Studio Team Services error: "The target of the specified cmdlet cannot be a Windows client-based operating system."

When I try to deploy my artifact on IIS, I am getting the error as shown in the below screenshot. Any help will be greatly appreciated.
The "IIS Web App Management" screenshot is shown below:
The error message is pretty clear: You can't use it to install IIS on a client OS (such as Windows 10). You have to use a server OS (such as Windows Server).
There's nothing you can do about it other than to use a server OS or use an alternate tool to deploy.
Using Windows Remote Management (WinRM), connect to the host
machine(s) where IIS or SQL Server is installed, and manage the Web
application or deploy the SQL Server Database as described below:
Create a new website or update an existing website using AppCmd.exe.
Create a new application pool or update an existing application pool using AppCmd.exe.
Deploy a Web Application to the IIS Server using Web Deploy.
Deploy a SQL Server Database using DACPAC and SqlPackage.exe.
Your log mentioned the task was installing IIS, and it seemed the tasking was installing IIS on a windows client OS. You need to check your target machine to see whether it has IIS installed.

Deploying MVC file system publish on IIS7

I have created an MVC application in Visual Studio 2013 and I now wish to deploy this on the IIS of the server so that all employees from within the company will be able to access it via their windows login credentials.
When I run this in localhost via Visual Studio debug it works as expected but I have been trying unsuccessfully to deploy this to a network server and I am unsure of the process and would be grateful for some clarification.
I chose a file system publish from the publish options but I am unsure as to how to get this accessible as an application. I have tried adding the files via the new website wizard and tried the url of 'holidays/' which I had entered but without success. I then tried to add the same virtual directory location as an application from within this website but again this was unsuccessful.
I use Web Deploy with VS. Your target server needs to also have Web Deploy:
Installing and Configuring Web Deploy on IIS 7
Once your target server is ready, you can deploy from VS. Here's a guide on doing that (you can jump right to "Publish to IIS" section if you like):
ASP.NET Web Deployment using Visual Studio
With Web Deploy, you can choose to publish directly or use a deployment package. Once you are happy the publishing works locally, you have a level of confidence your publishing will work in your Live environment.
I would suggest that before you publish direct to a live environment, that you test publish it to your local machine or a test environment that has the same IIS version, and .NET Framework installed.

MobileFirst Server 7.0.0 as service on Windows Server 2012 not recognizing runtime environments

We are encountering a problem running the MobileFirst Enterprise Server on Windows Server 2012 R2. When we start using a batch file as Administrator, as long as we stay remote connected the server is working OK, we see the Runtime Environments. But when we log out, server is unreachable. We created a Windows Service that starts the server with same command:
*sc create WASLibertyV85 binPath= "C:\Program Files\IBM\WebSphere\Liberty\bin\server.bat start worklight" DisplayName="IBM WebSphere Liberty V8.5 Worklight" start=auto*
But the Runtime is not displayed, we only see:
No runtime environment deployed in this server.
Is there a way to enable MobileFirst Server seeing the Runtime Environments when was started as service?
Here's our complete solution:
1. Start CMD as administrator and run this:
sc create WASLibertyV85 binPath= "C:\Program Files\IBM\WebSphere\Liberty\bin\server.bat start worklight" DisplayName="IBM WebSphere Liberty V8.5 Worklight" start=delayed-auto
2. under Services.msc open the properties of the „IBM WebSphere Liberty V8.5 Worklight“ service and set this (if not already):
Tab GENERAL -> Startup type: Automatic (Delayed Start)
Tab LOG ON -> Log on as: Local System account + Allow service to interact with desktop
++ When the server restarts, it can take up to 2 minutes, until the runtimes are displayed in the Worklight Console!++
MFP is not being run as a service. MFP is simply a web app (a .war file, a .jar file and some artifacts) running on-top of WebSphere Liberty, in your case. So all of this is related only to Liberty and not to MFP.
As long as the Liberty instance is launched correctly, it should handle everything on its own, including the web apps that are deployed to it, MFP being one of them.
You could perhaps follow the instructions provided in this forum topic explaining how to use Apache Commons Daemon to run Liberty as a Windows service. There are other tools that can do this as well.
The problem was cause by starting the service with a log on account set as current windows user. When we've chaged to Local System Account and enabled Allow system to interact with desktop, the Runtime became visible on MobileFirst Server.

MSDeploy WMSVC is not working in .net environment

I have a build/test server which is currently running Jenkins for my continuous integration and it also is acting as my test server where code will be deployed to once built (i hope to rectify this and seperate these at a later date when budget allows)
I have a .NET web solution (nothing complex just Umbraco essentially) that i have in SVN and Jenkins is now building correctly. I now want to deploy it onto the same server using MSDeploy. After the build completes the package is generated but the deploy fails with the error
ERROR_DESTINATION_NOT_REACHABLE: Web deployment task failed. (Could not connect to the remote computer ("xxxxx.xxxxxxx.xxx.xxxx"). On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Management Service") is started
Here is my msbuild parameters that Jenkins uses
/P:Configuration=Release
/P:DeployOnBuild=True
/P:MSDeployPublishMethod=WMSVC
/P:DeployTarget=MSDeployPublish
/P:PublishProfile=GetSomePixels
/P:MsDeployServiceUrl=https://build.########
/P:AllowUntrustedCertificate=True
/P:CreatePackageOnPublish=True
/P:UserName=#######
/P:Password=########
I've checked the server and the Web Management Service is running and is starting up manually
I've also gone into IIS 8 manager (server 2012) and checked the "Allow Remote Connections" box under "Management Service". Restarted IIS and the WMSVC and still not working.
If i go to https://myserver.co.uk:8172/MsDeploy.axd in a browser it resolves (gives you the warning about an untrusted cert) and then displays a blank page.
Anyone got any ideas as to what i can do? I thought that it may be firewall related and even though it had added an exception to windows firewall for 8172 i have turned the entire firewall off to completely rulle that out and still no luck.
Have run this on the server to check its listening on the correct port
C:\Users\Administrator>netstat -a | findstr 8172
TCP 0.0.0.0:8172 GSP-BUILD:0 LISTENING
TCP [::]:8172 GSP-BUILD:0 LISTENING
Ok i've resolved this. It appears you have to activate the web management service first and then install web deploy and i'd done it the other way round. I uninstalled WebDeploy and re-installed it, restarted the server and its working
Agree with comment.
We had a similar issue. Initial installation even post Web Management Service activation appeared to be incomplete. In our case, even though the service said it was started we couldn't achieve the "green tick" when testing the connection from the Publish dialog when defining a profile.
Reinstalling WebDeploy 3.6 made it function properly.

Using port 80 with IIS Express inside of VS2010

I've got an app that I am trying to run on my dev system under IIS Express from VS2010 that I need to use port 80 for, but I can't get it to work. I've looking up information talking about port 80 being reserved.
http://learn.iis.net/page.aspx/1005/handling-url-binding-failures-in-iis-express/
But even after doing that I still get an error from vs2010 that says
"Unable to launch the IIS Express Web server. Port '80' is in use."
I don't know what else to try. I've used Process Hacker to track down port 80 and it seems to be used by System running on process ID 4, which is the NT Kernel and System process. I don't know if that would prevent me from using the port though. I thought maybe that was a result of http.sys holding that port so nothing else could use it?
I did managed to get IIS Express to run on port 80 by modifying the default binding of the C:\Users\[MyUser]\Documents\IISExpress\config\applicationhost.config file, and while I can start IIS Express manually this way, VS then gets an error because a binding already exists on that port. So I change it back to 8080, create the virtual directory using the button within VS2010 (which I'm guessing is the same as entering a site binding) but I still get an error when I go to debug the application. Is there something hardcoded in VS2010 that won't let it start IIS Express on port 80?
UPDATE & FIX: Ok, so I found a few more things to check and I did resolve my problem but not completely. One post suggested making sure I did not have SQL reporting services installed as it can monitor on port 80, I used to have it installed but not anymore and was not the problem I was encountering. I did however realize that I have WebDeploy installed. It was bundled with the VS2010 SP1 bundle from the Web Platform Installer. This is fine as I do want the client tools from WebDeploy, but it also installed the agent on my system which was monitoring on port 80. I went to my list of services and stopped the Web Deploy Agent Service. Soon as I did this I can now use port 80 for IIS Express from within VS2010.
New Issue related to running on port 80 in IIS Express
However my application is an MVC3 App, and I've run into a problem because the MVC3 isn't capturing my request at all, so It's not firing my controller actions or anything like that, but a txt file in the root of my app can be reached so I know it's my site that IIS Express is serving up. Anyone have any issues running an MVC3 (I don't know if it's exclusive to MVC3 or not) in IIS Express on port 80?
Just posting my own answer for this problem so I can mark the question as answered.
Check http://learn.iis.net/page.aspx/1005/handling-url-binding-failures-in-iis-express/
Disable the Web Deploy Agent service if you have it installed.
in my case i solved the issue by stop "SQL Server Reporting Services"
you can find it in
control panel -> sevices
THANK YOU very much for you discovering of the 'Web Deploy Agent' service! This is something that only recently got turned on as I had all this working perfectly and just today installed the updated version of IIS Express, and ran into the exact same problem with port 80. So now that I have turned off the Web Deploy agent, my system works correctly again.
As for ASP.NET MVC3, that works great for me on port 80 and port 443. It was quite a bit of work to bind both those ports so that IIS Express was able to use them as a normal user (most of it from the link you posted above), and to install the SSL certificate we use. I manually created all the entries in my applicationhost.config file to get this working, and the appropriate sites section is below:
<sites>
<site name="PHP: A Main" id="2144116512">
<application path="/">
<virtualDirectory path="/" physicalPath="C:\var\www\amain\www" />
<virtualDirectory path="/images" physicalPath="C:\var\www\images" />
</application>
<application path="/admin">
<virtualDirectory path="/" physicalPath="C:\var\www\amain\www\admin" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:80:test.amainhobbies.com" />
<binding protocol="https" bindingInformation="*:443:test.amainhobbies.com" />
</bindings>
</site>
<siteDefaults>
<logFile logFormat="W3C" directory="%IIS_USER_HOME%\Logs" />
<traceFailedRequestsLogging directory="%IIS_USER_HOME%\TraceLogFiles" enabled="true" maxLogFileSizeKB="1024" />
</siteDefaults>
<applicationDefaults applicationPool="Clr4IntegratedAppPool" />
<virtualDirectoryDefaults allowSubDirConfig="true" />
</sites>
Note that my site is a combined PHP and ASP.NET MVC3 site, as we are in the process of re-writing the entire thing to run on ASP.NET MVC3, so most of the site is still PHP but lots of new stuff is now running ASP.NET MVC3, and that stuff works for me.
Does your IIS Express work properly with MVC3 outside of Visual Studio, or is the MVC3 stuff just not working at all?
I didn't have the Web Deploy Agent installed but ran into this issue. You can also fix this by running this command to find out which application or service is using the port and then trace it down in Task manager.
netstat -o -n -a | findstr 0.0:80
Then open Task manager, go to Processes, click the checkbox "Show processes for all users" and then click the View menu and Go to the Columns, add the PID column.
Match the Process ID from the netstat command to the PID in task manager and you will find the service or application that's using the port.
That solution helped me.
On Windows 7 or Windows Vista, from an elevated command prompt, run the following command:
console
netsh http add urlacl url=http://localhost:80/ user=everyone
This command will allow any user's application (including your own IIS Express instances) to run using port 80 without requiring administrative privileges. To limit this access to yourself, replace "everyone" with your Windows identity.
Taken from that source -> https://learn.microsoft.com/en-us/iis/extensions/using-iis-express/handling-url-binding-failures-in-iis-express

Resources