Set up Application Insights for Older WCF Library - wcf

I've "setup" AI through the context menu in VS 2017 when selecting the "Configure Application Insights" option. It doesn't set up like ASP.NET sites. it didn't add AI dll's and there isn't a ApplicationInsights.config
But it does state I've connected to the AI i created in Azure. yet i don't see the instrumentation Key anywhere. Also When I rum the WCF service noting gets logged. is there a specific way we need to set up AI for this? I couldn't find articles on how to do this. The only files that were generated was in the Connected Services AI folder and ConnectedService.json

I figured out the issue, of TFS for some reason it didn't allow checkout of project file so it created the files but couldn't add it to the project. I checkout the project manually and delete the files. Then added AI and it worked as expected.

Related

How to add WCF Service to .NET Core project in Visual Studio 2019?

I am unable to add a connected service reference to a WCF endpoint in VS 2019. I used to be able to do it in VS2017 with an extension. Now I can't find the extension anywhere, and when I try to add a connected service, I get lots of options but nothing for a WCF service.
Just to clarify, I am not trying to develop a WCF service, just trying to create a service reference to act as a client to a remote WCF service.
There is an article on how to use such a tool, here, but absolutely no information on where to find the tool or how to install it. I even found what may be the source code for the tool, but again with no installation instructions.
My project is a .NET Core project, targeting NetStandard 1.6.
.Net Core is still supporting client-side. You can use hosted service in it and add the ip:port/wcfinterface from the connected services.
You can try it by following this link.
I was able to resolve this issue by simply creating a new class library targeting NetStandard2.0. Right-clicking on Dependencies -> Managed Connected Services now showed an additional item below the Service Dependencies item, called Service References. Adding a new Service Reference, you are then presented with a WCF option.
I tried re-targeting this class lib back to NetStandard1.6, and all is still working. My original class lib was very old, and had some old stuff like dnxcore50 in the .csproj file, so maybe something there was screwing it up.
Thanks all for the suggestions.

Import profile VS Select existing - deployment in Azure app service

I have .net core web application developed in VS 2019 already running in Azure. I installed the VS 2019 in a new system and opened the solution. When I am trying to publish (may be after a simple code change) the application using Visual Studio. The window that is coming up having 3 options to publish. Regarding these options, what is the difference, and when to use what?
Below is the screenshot, options highlighted in red. Create New is for complete new deployment, as per my understanding. However, I'm not able to clearly get, "select Existing" versus "import profile" and when to use what?
Can you download the publish profile from the azure portal for the service in question and reimport it?
The window that is coming up having 3 options to publish. Regarding these options, what is the difference, and when to use what?
1.Create New option enables us to create a new App Service, create or use an existing App Service plan (Hosting Plan) and Resource group within your specific subscription, like below.
If you do not have any existing App Services that you create through Azure portal or VS etc, you can use this option to create a new one before you publish your project.
2.Select Existing option enables us to search and select existing App Services from specific subscription and Resource group.
If you'd like to publish your project to an existing App Service, you can use this option.
3.Import Profile... option provides a way to import publish settings that we got from Azure portal as below and then deploy our app.
Sometimes, developer does not sign in with same account (create Azure App Service etc resources using this account) in Visual Studio, to deploy app to an existing App Service, we can use this option and import a publish settings file.

How do I publish my project on Azure websites containing executable files

In my project I'm using Rotativa.dll to generate my PDF reports, it turns out that running the project locally everything works fine, but when I publish my site on Azure WebSites'm not getting. How do I publish an executable file in Azure?
Is there some setting for this?
You can publish any executable you want to an azure site. There is no limitation on the type of assembly you publish.
However there are some APIs that you can't call from an Azure Website for example GDI APIs.
I am not familiar with Rotativa.dll but since you say it's for PDF processing there is a very good chance it's using GDI APIs.

How to deploy a web site on IIS by using .dll file

I want to deploy on IIS my web site but I do not want to take whole project. I just need to take .dll file. Is their any way to do so.
I do not want to use visual studio only .dll file from the project to deploy.
The basic steps for deploying to IIS on windows server are as follows:
log onto the machine that is or will be hosting your application.
Use IIS Manager to create a new website for your application.
Create a new application in that site. I believe this also will automatically create an application pool with the same name for you and use it by default.
Specify the virtual directory for your application. This is going to tell IIS where to look for your mvc application. For this case lets assume it is C:\myApp
On your own machine Build the application however you build it with the correct solution configuration (i.e. Release mode). Let say the result of your build is located at C:\MyProject\bin
Copy C:\MyProject\bin from your machine onto your hosting machine at C:\myApp
You should be able to search these steps and find a step by step guide of how to accomplish them. Here is a link to some info on what sites, applications and app pools are to help you better understand.
http://www.iis.net/learn/get-started/planning-your-iis-architecture/understanding-sites-applications-and-virtual-directories-on-iis
Based on your sites requirements there will be some additional steps to set up security and alter bindings if you need to change them.
You don't need to deploy your entire website if you only make a change in a single assembly. You could copy the .DLL assembly directly to the bin folder of your website. This will trigger the Application Pool to be recycled in IIS and the changes will be taken into effect on the next request.

Issue with TFS build definition and WCF service in a Web Site "Project"

I'm trying to create a TFS build definition for a WCF service I'm working on. When I go to set the "Items to Build\Projects to Build," I can't choose any .*proj or .sln file. The source for the service is under the "Visual Studio\WebSites\SERVICE_NAME" directory which does not have a .proj or .sln file.I've been looking around for any material on the matter and nothing seems to be relevant to my situation.
You have chosen to use a Web Site "project". That was a mistake.
Web sites are not projects. They therefore do not have project files and do not build.
I strongly recommend never using web sites for any serious work. Use a Web Application Project instead (File->New Project and choose "WCF Service Application").
Don't use them for web applications, either.