How to Fix: An assembly specified in the application dependencies manifest was not found:package: 'System.Data.SqlClient' - windows

We are new to .Net Core and are trying to deploy our first application that uses it. We are deploying to a Windows server which has .NET Core Windows Server Hosting Module (2.2.0), the .NET Core Runtime (2.2.0) and I even installed the SDK (2.2.103) to see if that could solve the problem, which it did not.
Error:
An assembly specified in the application dependencies manifest (accesslog.deps.json) was not found:
package: 'System.Data.SqlClient', version: '4.5.1'
path: 'runtimes/win/lib/netcoreapp2.1/System.Data.SqlClient.dll'
So, here is my issue...the above error is being generated when we try to run a .NET Core application via the "dotnet filename.dll" method. We "publish" the application to generate all needed dependencies, or so I thought. The publish (and thus application) folder contain "A" version of this file (System.Data.SQlClient.dll), but apparently not the right one (version in publish path shows 4.6.26606.5), but yet that is the one being generated by Visual Studio.
Oddly, we also have an ASP.NET application on this same server which runs fine and references the same file.
Any help, guidance, troubleshooting steps, etc would be GREATLY appreciated.

Related

How to create new core 2.0 project?

I've just reinstalled VS 2017 15.6.2 using web installer and tried to create new
empty Asp.net core 2.0 project.
But when i open it i got error:
Project file is incomplete. Expected imports are missing.
My version of SDK is 2.1.101, which was installed with visual studio.
I selected web and .net core development features during install, what am i missing?
I tried to create empty core console app and everything works fine.
UPDATE
this error is related to folder structure
C:\Novatek.Monitoring.WebUI // no errors
C:\Svn\Monitoring\trunk\Novatek.Monitoring.WebUI // Project file is incomplete. Expected imports are missing.
Try follow this tutorial:
https://www.asp.net/get-started
Remember to check your dotnet-core version with 'dotnet --version'
You can follow this simple and basic steps :) This link will help get started in creating your first dynamic ASP.NET Core MVC Web App connected to MS SQL Server.
https://deanilvincent.github.io/2018/01/12/steps-in-creating-simple-but-dynamic-powerful-web-app-using-asp-net-core-mvc-connected-to-a-database/

Azure Full IIS deployment issue - TypeLoadException

I have an application using the Azure 1.4 SDK (previously 1.3 with same problem). If I try and deploy the application as Full IIS I get the following error in Intellitrace logs.
System.TypeLoadException: Unable to load the role entry point due to the following exceptions: System.IO.FileLoadException: Could not load the file or assembly 'System.Web.Mvc, Version=2.0.0.0..blah..The located assemblies manifest does not match the assembly reference.
The web site is using ASP.NET MVC 3, not version 2. It seems the Full IIS is looking for the wrong versions of the dll's. I have set the MVC dll's in the project to Copy Local so they should be deployed in the bin directory.
If I deploy the site as a legacy hosted web core by commenting out the sections in the ServiceDefinition.csdef it all deploys and works fine.
This seems like it was an application that may have been created as an MVC2 application, and then later you migrated it to MVC3, correct? The reason it is failing is that you have both MVC2 and MVC3 installed on your machine, and when you're running it locally, your application is loading MVC2 out of the GAC. When you deploy it to Azure it can't find MVC 2, since MVC is not installed on the base Azure images that you get when you create a new Deployment.
I would check through my config files and look very closely for any references to MVC 2.0. Take a look at a reference like this and make sure you haven't overlooked any steps. You may have neglected to change the project type guid, or missed one of the config files.

Visual Studio 2010 - Web deployment project includes framework DLLs

I have just upgraded a solution with two web deployment projects from VS 2008 to 2010 (upgrading all the projects to .net 4.0 as I went).
I installed the new VS2010 web deployment projects to allow me to open my old build projects (these build up my web sites, clean up a few files and zip them for upload).
I've got these working again, but when I look at the built files, all the referenced .net framework files (e.g. System.Web.dll etc) have been included in the deployed site. Does anybody know why this might be happening and how to turn it off?
Maybe you are using a component (DLL) which is using that files probably by needing specific file version of some framework libraries. VS will automatically copy dependencies of a dependency.
It seems you're using .Net framework Client profile version. Please check the .Net framework version selected for upgraded projects under Project properties.
Here is the MSDN article on .Net framework client profile:
http://msdn.microsoft.com/en-us/library/cc656912.aspx
One reason could be the Copy Local = True property of the referenced .net framework files.

VS 2010 Setup Project Requires .NET 4.0, but it is already installed

I have a VS 10 project using .Net 4.0 and I use lots of stuff that do require 4.0. I created a VS Setup project added the primary output from my project and built it. I then installed it and everything worked fine. A few days later I am ready to do a new build so I rebuild my project and then the setup project. Now when I run the msi it tells me that .Net Framework 4.0 is required.... I figured I screwed it up so I just create a new setup project, and that works fine. But again a few days later (restarted VS in there probably and maybe even the computer) I rebuild and get the error telling me that .Net 4.0 is required. I did it a few times just to verify and it consistently happens and I cannot figure out why.
The project I am building and installing has a windows service that is set as the startup project. I will switch that to a console app object for local testing purposes and build and test the project (not the setup project). This is the only thing I can think of that may be impacting the build, but again, I cannot figure out why.
Any help is appreciated.
This error message is thrown when the Launch Conditions in the Setup Project aren't met.
Go to View > Editor > Launch Conditions
Change the .Net Framework version value to
match the version your setup project
is compiled into. By default, the 2010 setup and deployment project condition is set to .NET 4.0 Client Profile.

Why does Windows application is requiring .Net 3.5 framework

I have the Target Framework set to 2.0 on my windows application, yet when I try to install my app on the server, after publishing it through VS 2008, it is trying to install .Net 3.5 on the server.
I do not want to install 3.5 on my server.
When I copy the files from my local /bin/debug/ to the server and double click on the exe, nothing happens. On my local machine, my app runs.
How can I make this app run on the server without it needing the .Net 3.5 framework?
Do any of your dependencies require .NET 3.5? Do you have anything in any config files which might require .NET 3.5?
I suggest you take a copy of what you've got for safekeeping, and then cut it down to the very smallest app which demonstrates the problem. In fact, you might want to start from scratch with a "no-op" app and see whether that has the same behaviour.
Check unused references, perhaps? Are you actually getting an error about the 3.5 framework?
Try building the application in release mode and deploy it to the server. You will need to grab the application from the /bin/release folder instead of the /bin/debug folder.
Also, check the target framework under the application section of the project properties.
If you're using Visual Studio to build your setup project, open the setup project's properties and look through the settings. One setting says which .Net version will be demanded by the installer package. You have to set that; it doesn't inherit from known properties of your other projects.

Resources