asp.net web api system dlls in GAC? - asp.net-mvc-4

When I create ASP.NET Web API project, it references all system dlls which are stored in packages folder. When I deploy it to production environment, can I drop those dlls in GAC? I don't know why those system dlls not installed in GAC already when I stall asp.net MVC 4. Are they moving away installing DLLs in GAC?

No, do not deploy those DLLs to the GAC.
See this answer: https://stackoverflow.com/a/2451201/48082
Deploy those DLLs to your app bin directory.

Related

.NET Core 2.1 How to provide nuget packages to a heavily modularized deployment with shared runtime

Setup:
single offline (blocked from inet) server
multiple applications
apps load .net core assemblies (plugins with their own assembly or nuget deps) at runtime through reflection
Problem: What is the most efficient way to deploy the application set?
Currently I publish application per application, so that all required nuget packages and assemblies are available. However, this means the complete .net core and asp.net assembly set is copied over multiple times.
To have a shared deployment with an installed .net core runtime or sdk, there does not seem to be an easy way to make the required nuget packages available on an offline machine?
Any suggestions on the best-practices setup for these kind of deployments?
Cheers.
Sounds like you could use the global packages folder.
If your projects use PackageReference they consume their dependencies directly out of that folder instead of copying them locally, so if you're worried about disk space that would be a way to avoid duplication if that's what you're really worried about.

How to publish .net core project to smarterasp.net from vscode?

I need to publish .net core project to smarterasp.net server. I use visual studio code. How can I deploy my project?
I've run into bugs with Web Deploy, so I use a Folder (aka 'File') deploy to a local folder and then FTP the content of that folder to the root website folder at SmarterASP.NET. The main trick is that when you set up your publishing profile, you must change to 'self contained' and target x86. If you leave the default settings, your site won't work. I'm referring to Core 3 here....
since I don't know the smarterasp.net provider, but unless you have a free hosting plan, smarterasp.net declares that ASP.NET Core 3.x is already installed for which you only need to build your project and inserting it in the root of your IIS site without installing the core framework on the server would not work.
Good luck.

.net core 2.0 does not publish nuget dll

In .net core 2.0 I add some nuget package.Project work in local but does not work in server-production.I click solution and click publih to folder and move that folder to server.But in published folder there is no this nuget dll
how can I publish that nuget dll?In that folder I didnt find that dll
C:\Users\HC.nuget\packages
I think the problem is all of those packages are included in the ASP.NET Core Implicit Store. These are only present however, if the SDK is present on the target machine. If this is the case you have 3 options.
Install the .NET Core SDK (not just the runtime) on the target machine. In this case the implicit store will be present.
Set the following property to false:
<PropertyGroup>
<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
</PropertyGroup>
This will cause the build to include dependencies that are in the implicit store so that the final published product only relies on the .NET Core Runtime and not the API.
Build a self-contained deployment
This will bundle everything (runtime and implicit dependencies) into your application.

Why does .NET Core not add the reference Dlls from the nuget packages to the bin folder

.Net Core projects do not put the reference DLLs from the nuget packages in the bin folder. Is there a way of any properties that helps in doing that?
It's needed for some third party tools to understand the reference DLLs.
.NET Core, unlike .NET Framework, can resolve assemblies from half a dozen locations. This includes the NuGet cache, servicing cache, runtime store, local app directory, and shared framework folder. During development, these are typically found in the NuGet cache (%USERPROFILE%.NuGet\packages) This makes it unnecessary to copy referenced assemblies to the build output folder (bin) until you publish your application. For more details on how that works, see https://github.com/dotnet/core-setup/blob/master/Documentation/design-docs/corehost.md
You can force the SDK to copy assemblies to your build folder by setting the proper below, but it increase disk use and build time.
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
Or you can use the deps.json and runtimeconfig.json file to locate required assemblies.

Deploying external files from visual studio with .NET CF application

I am working on a .NET CF 3.5 application. There are few external files\assemblies that the application is consuming. These files are not part of the project, therefore while debugging when I deploy the project, these external files are not deployed to the device.
Is there any way I can deploy these files with project without including them in the project?
You can't get Studio to deploy arbitrary files without telling it what files to deploy. The only way to tell Studio to deploy files is to either add the files to the project (as a Resource or a Content file) or by adding a reference to them (for .NET assemblies).