How do I install the Entity Framework on my build server? - asp.net-mvc

How do I install the Entity Framework on my build server? I only have MS Visual Studio Shell installed there and there is no Package Manager Console.
Thanks.

Do one of the following
Add the EF assemblies to source control so they can be downloaded on checkout
Enable nuget package restore and allow the build server access to the internet to download the packages.

You don't need to install EntityFramework on your build server. EntityFramework is part of the BCL, so all you have to do is install .NET on your build server. Now if you need to use some extensions that are available through NuGet packages, all you need to do is to add reference to those packages in your project and then all the necessary assemblies will be part of the web application. Thus the web application is self-contained. All you have to do is to put them under source control so that the build server is able to retrieve them.

Related

Cannot create Q# projects

I'm new to quantum computing and I've been trying to follow instructions on https://learn.microsoft.com/en-us/azure/quantum/install-command-line-qdk?tabs=tabid-vscode to dive into this field, but I've run into a problem. Every time I'm trying to create a new Q# application project, I get the following error message
The project file cannot be opened. Unable to find package Microsoft.Quantum.Sdk. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages C:\Program Files\dotnet\sdk\5.0.202\Sdks\Microsoft.Quantum.Sdk\Sdk not found. Check that a recent enough .NET SDK is installed and/or increase the version specified in global.json.
and I can't find that package myself either.
I've tried to install Microsoft.Quantum.Development.Kit-0.16.2104.138035 several times, with both .NET 3.1.408 and 5.0.202. I'm using VS 2019 16.9.4 Community Edition on Windows 10.
Looks like nuget.org is not listed as a valid package source in your computer, so dotnet can't find the QDK packages online.
Try running this command:
dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org
And then try building your Q# project again.
It's unclear to me why nuget.org is not listed as a source, though; it should be included by default when you install the .NET Core.

How to configure older version of package with packages available on TFS server

I have a VS 2008 file that runs on my computer perfectly fine and does everything it needs to do. When I update the TFS version of it its copies exactly, just as you'd expect. However when I build my solution on TFS it can't find a package in my packages folder in my project folder.
This all makes sense, the .gitignore has it set so that packages in the project are removed (unless necessary), and my company uses nuget to deal with all common 3rd party packages used. That being said, how do I get a reference to the package (with appropriate version) from the TFS server to my code on TFS?
P.S. This is my first time dealing with this tech so apologies if the lingo is being misused. Thanks!
How to configure older version of package with packages available on TFS server
If you are using the TFS version is 2015 or above, there is NuGet Installer or NuGet Restore task, which you could use to restore the nuget package from the package source to the work directory when you build your project:
Check the document Azure Artifacts and NuGet restore Vs NuGet installer.
If you are using the TFS version is 2013 and below, you can
check the document Integrate NuGet Package Restore TFS Build 2013 or Older to restore nuget packages.
Hope this helps.

How to deploy Nuget package '.nupkg' to IIS

we are using NuGet command line( https://www.nuget.org/downloads ) to create deploy-able NuGet package (.nupkg).
The project is in .net framework 4.6, project is build using MSBuild & created the deployment package using Nuget.exe . We need to deploy the NuGet package(.nupkg) in IIS(Internet Information Services) on windows platform.
Tried to web-search but didn't worked out. need open-source tools or mannual automated step by step process to do so.
please guide.
What do you mean by "deploy the NuGet package(.nupkg) in IIS(Internet Information Services)"?
Anyway nupkg is just an archive so you can simply get dlls out of it with and use them where you need.

Visual Studio 2013 Web Deploy Missing Dependencies

I have recently run into an issue where (for some reason this behaviour has appeared out of nowhere) during web deployment of a project to Azure Websites - some reference assemblies of the dependent projects are not automatically included into the deployment package.
SO this is a rough structure of my project:
1) ASP.NET MVC project that references class library project
2) Class library project that references some NuGet packages
Now, when I web deploy the ASP.NET MVC project to Azure Website - not all of the NuGet packaged assemblies from the reference class library are deployed (it seems that some are included automatically and others are not). Everything works fine when run locally. All of the required assemblies are copied over to the bin folder of the ASP.NET MVC project.
Now, the only way that I have found to work around this issue is to add the NuGet package of the missing reference directly to ASP.NET MVC project. I really don't like this workaround - since it breaks the modular structure of my project.
Surely there must be a way to specify which assemblies are to be included with Web Deploy? I have tried some pretty extensive google searches on the topic - but that didn't yield an working solution.
Try the following for each of the offending Nuget packages:
Open the Package Manager Console. Make sure the Default Project dropdown is set to your MVC project.
Run Uninstall-Package [Package Name] -Force
Run Install-Package [Package Name]
If you need to keep a particular version of a package instead of just pulling the latest in, you can add -Version [Version Number] to the end of the last command.
That will essentially refresh all the references and other bootstrapping for the package, then try to web deploy again.

Where to download the latest version of Entity Framework?

I am using EF 4.0, at the time I am writing these lines I heard that EF 4.1 update 1 has been released and EF 4.2 is in beta. From wikipedia
A refresh of version 4.1 named Entity Framework 4.1 Update 1, was
released on July 25, 2011. It includes bug fixes and new supported
types.
But I only found a link of Version 4.1.10311.0 from Microsoft which date published is 3/21/2011. So I wonder if version 4.1.10311.0 is the latest release so far. If it's not, where can I download the latest release ?
ps : For some reasons I can't use live update, I need to download package to install manually.
From Arthur Vickers:
What if I can’t use NuGet? What if you can’t connect to the Internet
from your development machine. Or what if you are not allowed to
install NuGet on your machine. Don’t worry; all is not lost.
First you need to get the NuGet package. For this you do need to be
able to connect to the Internet from some machine—but it doesn’t have
to be your development machine. You’re reading this so presumably
you’re not completely off-the-grid. :-)
You can get the package by using NuGet in Visual Studio on a machine
connected to the Internet in the normal way—just install the package
you want into a dummy project. After installing the package you can
find the .nupkg file either in the dummy project folder or by browsing
the Package Cache from the Package Manager Settings menu option.
You can also get the package without Visual Studio by using NuGet.exe.
If you are able to install NuGet on your development machine then do
so and setup a local feed. This may sound daunting but it’s really
easy. Copy the .nupkg file to your local feed and then use NuGet to
install it in the normal way—with no connection to the Internet
required.
If you can’t install NuGet on your development machine then take the
.nupkg file and rename it to .zip—yep, it’s a zip file. You can now
extract EntityFramework.dll from the zip file and use it as you would
any other assembly. Note that you will not get any of the automatic
project-level integration I mentioned above, so you may have to do
more manual configuration of your project.
If you are using EFv4.0 you mostly don't need EFv4.1 or EFv4.2. Those versions bring new type of mapping (code first / fluent) and new DbContext API which can be used instead of ObjectContext API. So unless you want to start a new project with those "new" features or completely migrate your existing project you don't need it. Real new functionality for you will be included in .NET 4.5. DbContext API and code first is shipped only as NuGet package since EFv4.2.
use the package-manager in VS2010 to install
Tools + Library Package Manager + Nuget package manager
EF 4.2 has just been released: http://blogs.msdn.com/b/adonet/archive/2011/11/01/ef-4-2-released.aspx
This is a minor update over 4.1.
The runtime components are available via NuGet. The designer etc. updates for VS are a separate install.

Resources