How to update nuget packages in ASP.NET "Websites" using CLI - asp.net

ASP.NET Websites is legacy application type - it doesn't have a solution or project file.
That being said, can I use Nuget's CLI to update an ASP.NET Website? I'm guessing that it's not possible since Nuget's CLI requires a solution/project file but I'm hoping that I'm wrong. Please prove me wrong people.
Thanks

Related

NuGet Server for .NET Core

The NuGet.Server package is used to create a ASP.NET MVC NuGet server and it works just fine. There is another package NuGet.Server.Core that is expected to do the same when hosted within a ASP.NET Core (perhaps 1.0 or 1.1?).
The first one creates 'Packages' folder right beneath the main folder used as a package repository.
No such things happens after installing the Core version. I tried both root and a dedicated folder. Googling a bit, I found no info about installing the package and integrating it in a ASP.NET Core app.
Has anyone succeeded in installing the Core version? Also, there's another version NuGet.Server.V2 which depends on NuGet.Server.Core, however it requires .NET Framework 4.6.1. This makes me think that NuGet.Server.Core is not targetting .NET Core at all.
If so, the name must be somewhat misleading, I guess...
Yes, this is the answer:
No .NET Core whatsoever! Just .NET Framework 4.6.1. Not a big discovery but a warning to all devs who, like me, were (and, more importantly, will be!) misled by 'Core' in the package's name.
Here's a 3rd party option (free)
https://github.com/loic-sharma/BaGet
Nuget.Server.Core seems to be one of the dependencies of Nuget.Server. So it's not a .NET Core project. Guess that's one of those snags you run into when you call your framework "Core". :)
I think you can use BaGet.
There is my article about that.
Check this :
Create your own NuGet server and package feed

What default dll's are imported into an asp.net webforms project

I've inherited a legacy code base that doesn't currently compile and has no project or solution file (there are multiple repositories including winforms and asp.net).
I'm not certain what .net version the original code was written in, nor what the project template was, although I know some are web forms.
I'm re-creating new solution and project files to import the code into, but need to find some of the default dll's included in old Visual Studio project templates (e.g. webforms).
Any ideas where I might find this information?
Anyone know an MSDN link with this on it?
P.S. I don't have access to the production code, although it is running in production.

What is the purpose of Microsoft.AspNetCore.Razor.Tools?

What is the purpose of Microsoft.AspNetCore.Razor.Tools?
I'm using visual studio code on os x
From the git hub page https://github.com/aspnet/RazorTooling I can see
The Razor syntax provide a fast, terse, clean and lightweight way to combine server code with HTML to create dynamic web content. This repo contains tooling that interacts with the DNX Design Time Host to provide a Razor editing experience.
Does visual studio code use this assembly? What is a DNX Design Time Host? When would I need to include this assembly in a project?
I found a reference to it in the project.json of a web application project that I generated using yo aspnet.
At least here: https://www.nuget.org/packages/Microsoft.AspNetCore.Razor.Tools/ you can see a brief description of library:
TagHelper tooling for .NET Core CLI. Contains the dotnet-razor-tooling
command used to resolve TagHelperDescriptors for projects at
design-time.
And here you can find a bit more details: https://docs.asp.net/en/latest/mvc/views/tag-helpers/intro.html#intellisense-support-for-tag-helpers
On mac you can run the same command:
dotnet razor-tooling
but it doesn't make any sense because for now VS Code doesn't provide any intenseness for Razor views. So probably you can remove this dependency from project.json.

Remove Application Insight from application on Visual Studio 2013

On Visual Studio I added application insight to a project which creates a ApplicationInsights.config and not sure what other files were added to the project.
Thing is, doing right click and press Add Application Insight was pretty straight forward. Now I'm looking with no success a way to remove the application insight for that project.
How can I achieve that ?
On production server, using DebugView, I see the telemetry logs, even after shutting down the Application Monitor Services on the server.
Any help is appreciated, I want to completely get rid of application insight on that application.
I just wanted to add to the answers already given, having just gone through this process with an ASP.NET MVC 5 project.
Uninstall Using NuGet
As the other answers say, the best way to remove Application Insights is through Nuget: Tools -> NuGet Package Manager -> Manage NuGet Packages for Solution.
I found it best to remove Microsoft.ApplicationInsights.Web and all its dependencies first, then Microsoft.ApplicationInsights.Javascript API.
This removed everything except:
the ApplicationInsights.config file,
a script snippet in _Layout.cshtml,
both of which I removed manually.
What Microsoft has to say
The Microsoft Azure documentation here: https://azure.microsoft.com/en-gb/documentation/articles/app-insights-troubleshoot-faq/, says:
What does Application Insights modify in my project?
The details depend on the type of project. For a web application:
Adds these files to your project:
ApplicationInsights.config.
ai.js
Installs these NuGet packages:
Application Insights API - the core API
Application Insights API for Web Applications - used to send telemetry from the server
Application Insights API for JavaScript Applications - used to send telemetry from the client
The packages include these assemblies:
Microsoft.ApplicationInsights
Microsoft.ApplicationInsights.Platform
Inserts items into:
Web.config
packages.config (New projects only - if you add Application Insights to an existing project, you have to do this manually.) Inserts
snippets into the client and server code to initialize them with the
Application Insights resource ID. For example, in an MVC app, code is
inserted into the master page Views/Shared/_Layout.cshtml
Remove Manually
To remove Application Insights without NuGet, or if like me you don't trust it and want to know which files are removed, I followed these steps:
Remove application insights from the web.config, under system.webserver.modules, search for ApplicationInsightsWebTracking.
Remove all Microsoft.AI (Application Insights) prefixed references from project references.
Remove all Microsoft.ApplicationInsights packages from package.config.
Delete ApplicationInsights.config file.
Remove script from _Layout.cshtml:
var appInsights=window.appInsights||function(config){
function r(config){t[config]=function(){var i=arguments;t.queue.push(function(){t[config].apply(t,i)})}}var t={config:config},u=document,e=window,o="script",s=u.createElement(o),i,f;for(s.src=config.url||"//az416426.vo.msecnd.net/scripts/a/ai.0.js",u.getElementsByTagName(o)[0].parentNode.appendChild(s),t.cookie=u.cookie,t.queue=[],i=["Event","Exception","Metric","PageView","Trace"];i.length;)r("track"+i.pop());return r("setAuthenticatedUserContext"),r("clearAuthenticatedUserContext"),config.disableExceptionTracking||(i="onerror",r("_"+i),f=e[i],e[i]=function(config,r,u,e,o){var s=f&&f(config,r,u,e,o);return s!==!0&&t["_"+i](config,r,u,e,o),s}),t
}({
instrumentationKey:"RemovedKey"
});
window.appInsights=appInsights;
appInsights.trackPageView();
Remove ai.0.15.0-build58334.js & ai.0.15.0-build58334.min.js from Scripts directory.
Clean & Rebuild all.
Unless I'm misunderstanding the question, you should only have to remove one extension and possibly one nuget package.
Uninstall the Application Insights Tools for Visual Studio extension and remove the Application Telemetry SDK for Services nuget package. The telemetry package is installed along with Application Insights but must be removed separately.
In my experience the telemetry package is not required if you wish to keep using Application Insights' other features. Removing the telemetry package will stop all telemetry logging but Application Insights will continue to report non-telemetry information just fine.
I would prefer to do this:
UnInstall-Package Microsoft.ApplicationInsights.Web -RemoveDependencies
If you use the NuGet Package Manager for the solution (Tools -> NuGet Package Manager -> Manage NuGet Packages for Solution) you can search for ApplicationInsights and uninstall the package, and there is an option to remove dependencies. There may be several. This is the easiest way to cleanup ALL the dependencies, not just some.
With a new ASP.Net Core 1.1 project:
Remove the Microsoft.ApplicationInsights.AspNetCore nuget package
Remove inject Microsoft.ApplicationInsights.AspNetCore.JavaScriptSnippet JavaScriptSnippet from the _Layout.cshtml page
Remove #Html.Raw(JavaScriptSnippet.FullScript) from _Layout.cshtml
Remove .UseApplicationInsights()from program.cs
I solved this by first uninstalling all Application Insight packages from (Tools -> NuGet Package Manager -> Manage NuGet Packages for Solution)
Then ran
Uninstall-Package Microsoft.AspNet.TelemetryCorrelation -Version 1.0.0 -RemoveDependencies
in the Nuget console.
That fixed it for me.

Adding a new .NET SDK to Visual Studio

I am relatively new to Visual Studio and .NET and VB.NET. I recently installed the Amazon Web Services .NET SDK and I am trying to figure out how to get things running, specifically do I need to do anything to include the SDK in an existing project? I know there is some sample code, but its in C# and the project is already set up so I don't find it very helpful. Thank you.
I'm not a VB expert but you should be able to include the AWS dll to your existing project. That way you can use AWS API functions.
You can locate the dll using the sample project. (As I remember the name of the dll is AWS2SDK.dll or something like that..)

Resources