I develop a web application on Microsoft .Net 4 and Entity Framework 5. When I upload the project on my web farm it doesn't work. I believe that Entity Framework is not installed on my web farm. So I contacted my host to support this particular issue.
They said:
Send us a download and installation instructions, with any
requirements to install Entity Framework.
Except we utilize a link from directly within Visual Studio through Nuget.
How do you load the proper deployment information onto a server, since you can't directly deploy with Nuget since they don't have Visual Studio installed?
Server Information:
Windows Server 2008 R2 64 Bit
Nuget link I used to install Entity Framework.
If possible please guide me or reference a place where I can solve this deployment issue. Any help would be greatly appreciated. Thank you for your assistance.
In order to successfully launch your project on a deployment server you should ensure that your application has a Deployment Package to be installed on the server.
Deployment Considerations can be found here:
You have a lot of things you need to consider, but Entity Framework does have a lot of choices and flexibility. Some of your choices:
Click Once Security and Deployment
Windows Installer Deployment
What Is a ClickOnce Application?
A ClickOnce application is any Windows Presentation Foundation
(.xbap), Windows Forms (.exe), console application (.exe), or Office
solution (.dll) published using ClickOnce technology. You can publish
a ClickOnce application in three different ways: from a Web page, from
a network file share, or from media such as a CD-ROM. A ClickOnce
application can be installed on an end user's computer and run locally
even when the computer is offline, or it can be run in an online-only
mode without permanently installing anything on the end user's
computer. For more information, see Choosing a ClickOnce Deployment
Strategy.
ClickOnce applications can be self-updating; they can check for newer
versions as they become available and automatically replace any
updated files. The developer can specify the update behavior; a
network administrator can also control update strategies, for example,
marking an update as mandatory. Updates can also be rolled back to an
earlier version by the end user or by an administrator. For more
information, see Choosing a ClickOnce Update Strategy.
Because ClickOnce applications are isolated, installing or running a
ClickOnce application cannot break existing applications. ClickOnce
applications are self-contained; each ClickOnce application is
installed to and run from a secure per-user, per-application cache.
ClickOnce applications run in the Internet or Intranet security zones.
If necessary, the application can request elevated security
permissions. For more information, see Securing ClickOnce
Applications.
How does a Windows Installer Deployment work?
Windows Installer
deployment enables you to create installer packages to be distributed
to users; the user runs the setup file and steps through a wizard to
install the application. This is accomplished by adding a Setup
project to your solution. When built, the project creates a setup file
that you distribute to users; the user runs the setup file and steps
through a wizard to install the application.
That is a brief description of a few ways, you can find examples here: Once you actually have your host load your deployment package it should run without any issues. Hopefully this points you in the correct direction.
Related
So, we finished a few wpf conversions to .net core, and now we have a need to ship one to an external client as an installer. Previously we used ClickOnce, but that has been deprecated in .net core and will not be ported according to MS, with them recommending MSIX. However, as we understood from docs, even though we'll sideload a WPF application it will still run in a sandbox with a virtualized file system. And that is a no go for us, it has obviously been designed with UWP+Marketplace delivery in mind. We need the application on the file system with full access to file system, the "good old way".
We could just ship them as a zip file and have the client unpack, but management deemed that as not-so-professional, so we need a delivery package similar to what msi/clickonce had. Has anyone delivered apps on core outside MSIX?
EDIT: Microsoft has announced they are going to include ClickOnce support in .NET 5
You can deploy .NET Core and .NET 5 applications internally in an organization by sideloading msix packages.
I have been successfully using Clickonce for deploying .NET line of business applications for years.
Now that I’m updating my apps to .NET Core I wanted something similar to Clickonce. In other words: publishing your installer in a network share and deploying your autoupdating app to your clients by simply coping a shortcut to your installer.
You can achieve this with msix packages. The problem is that you are limited to Windows 10 version 1709, and later
The solution came on December 19th with MSIX Core 1.1. Packaging your app with msix core support you can target Windows 7 SP1 and later, and this is something I needed because at work we are slowly transitioning to Windows 10 from Windows 7 and I still have to support old versions of windows.
The steps for packaging your .net core app using msix core are:
Create a Windows application packaging project in your solution.
Right click on the Applications subfolder of your Windows application packaging project and select Add Reference. Then select your target project.
Change your Package.manifest (reference: msix-packaging/MsixCore at master · microsoft/msix-packaging · GitHub) Right click your Package.manifest file and select View code Change your to:
<Dependencies>
<TargetDeviceFamily Name="MSIXCore.Desktop" MinVersion="6.1.7601.0" MaxVersionTested="10.0.10240.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.16299.0" MaxVersionTested="10.0.18362.0" />
</Dependencies>
With this you stablish your min version to MSIXCore.Desktop in other words Windows 7 sp1.
Right click your Windows application packaging project and select Publish then Create App Packages.
Choose Sideloading then check Enable automatic updates.
In order to install the package in the client machine you must sign it. I recommend you to create a self-signed certificate. You must install the certificate in the client machine so that the package is trusted and you can install it. If you are in a domain you can deploy your self-signed certificate with a group policy.
The optimal situation is to sign the package with a trusted certificate provided by a trusted root certification authority. My personal choice is to create a certificate in my own windows certification authority (which is trusted in my local domain). If you decide to sign your package with a trusted cert this is the command line:
.\SignTool.exe sign /fd SHA256 /a /f yourcert.pfx /p yourpassword *.appx
Select Generate app bundle to Never.
Select your network share for publishing the package
In order to execute your package installer in Windows 7 sp1 machines you must previously install msixmgrSetup-1.1.0.0-x64.msi or msixmgrSetup-1.1.0.0-x86.msi accordingly. You can find the installer here
Windows 10 machines will recognize the installer right away.
If you want to know more about msix packages you have a good explanation here
I hope this guide helps you to get your deployment system working.
Well, apparently, we are again faced with "our way or the highway" from MS, so we just used Inno Setup. Until such time we get a proper installation process or MSIX allows unsandboxed setup without unnecessary file system abstraction, this will have to do.
There are other tools such as Advanced Installer or InstallShield that can create a MSI/EXE installer now and later in case you decide to go with the MSIX, you will just add a new build to your current project.
The tool will automatically sync the content of the MSI with the MSIX, or at least this is what Advanced Installer does for you.
They also have a VS Extension, so you can build the installer inside your Visual Studio IDE.
I got a specific question about ClickOnce Deployment on .net. Here is the thing I got an windows application which powered .net framework 3.5 C#. The purpose for ClickOnce is auto update. We have a local network which is no internet access they have only access to server computer. I need to publish the application to the server computer which others should access through file share or something else. Most of the computers are have Windows XP.
Main question is how should I publish the application through ClikcOnce.
Please if you have some infomartion or example that can help me type it down.
If you are using Visual Studio, you can use the Publish section of the project properties to publish the application through ClickOnce. Then you can choose to publish it to a folder and assuming it will be a network share, you can specify it in the form
\\ShareServer\Folder\Subfolder
We have a web app and a desktop windows WPF app.
Windows app sends data to webapp (hosted on azure)
Users download app from website. There are occasionally new versions of desktop apps available.
What is the most efficient way to setup automatic updates for desktop app? We are using github.
I found "releases" in github but I'm not sure how to notify desktop app and how to create an updater. (I guess we need to check for github releases every time app is started. Do I need to use Github api for this?)
What is the best repository structure for releases?
I'm looking for best practicies on how to perform seamless updates to desktop apps. (In terms of repository setup, creating web api to pull version info maybe?)
You can deploy your desktop applications using ClickOnce Deployment mechanism. This will take care of updating the software. Your users download the software from a publicly accessible Internet site. Whenever you have a new version available, you can simply deploy the latest deployment files on the download link. ClickOnce deployed application automatically check for any updated version on that link and prompt the user to download and install the latest version.
From the same MSDN link, one of the problems solved by ClickOnce deployment is facilitating automated updates:
Difficulties in updating applications. With Microsoft Windows
Installer deployment, whenever an application is updated, the user
must reinstall the whole application; with ClickOnce deployment, you
can provide updates automatically. Only those parts of the application
that have changed are downloaded, and then the full, updated
application is reinstalled from a new side-by-side folder.
I was looking into accomplishing the same needs and came across this library which can do what you're asking for;
https://github.com/Squirrel/Squirrel.Windows
There's a lot of configuration, but what you're asking for is not trivial, but maybe you can get some ideas.
For our needs; we're going have our build server (teamcity) create an MSI using a Wix project then the app will download and execute the MSI. Once we go to production we'll move MSI hosting over to some more enterprise-y CDN type setup.
I want to publish my application using ClickOnce with some prerequisites (.NET 4.5 and SQL Server Express).
I did as it says in How to: Include Prerequisites with a ClickOnce Application (note that the package folders were at v8.1A folder instead of v8A folder), but it still says it can't find the files. I've tried both Visual Studio 2013 and Visual Studio 2015 RC.
To enable 'Download prerequisites from the same location as my application' in the Prerequisites dialog box, you must download file 'DotNetFX45\dotNetFx45_Full_x86_x64.exe' for item 'Microsoft .NET Framework 4.5 (x86 and x64)' to your local machine. For more information, see http://go.microsoft.com/fwlink/?LinkId=239883.
To enable 'Download prerequisites from the same location as my application' in the Prerequisites dialog box, you must download file 'SqlExpress2012\SQLEXPR32_x86_ENU.EXE' for item 'SQL Server 2012 Express' to your local machine. For more information, see http://go.microsoft.com/fwlink/?LinkId=239883.
To enable 'Download prerequisites from the same location as my application' in the Prerequisites dialog box, you must download file 'SqlExpress2012\SQLEXPR_x64_ENU.EXE' for item 'SQL Server 2012 Express' to your local machine. For more information, see http://go.microsoft.com/fwlink/?LinkId=239883.
To enable 'Download prerequisites from the same location as my application' in the Prerequisites dialog box, you must download file 'DotNetFX40ClientKB2468871\dotNetFx40_Client_x86_x64.exe' for item 'Microsoft .NET Framework 4 Client Profile (x86 and x64) and Update for .NET Framework 4 (KB2468871)' to your local machine. For more information, see http://go.microsoft.com/fwlink/?LinkId=239883.
You have a very wrong idea about what is possible in a ClickOnce deployment. The canonical MSDN page is this one. High-lighting the most significant sections in that web page:
Impact to the user's computer. With Windows Installer deployment, applications often rely on shared components, with the potential for versioning conflicts; with ClickOnce deployment, each application is self-contained and cannot interfere with other applications.
Security permissions. Windows Installer deployment requires administrative permissions and allows only limited user installation; ClickOnce deployment enables non-administrative users to install and grants only those Code Access Security permissions necessary for the application.
Does not affect shared components or other applications: Yes
Installation of shared files: No
Installation to Global Assembly Cache: No
Installation for multiple users: No
Install time registry access: Limited
These intentional restrictions were designed to make users feel good about installing .NET programs with ClickOnce. They don't need assistance from an administrator to get the program installed. And the installer cannot make drastic changes to the machine, the kind that cause other programs to malfunction. A very, very common problem with installers.
This is grossly incompatible with what you are trying to do. Both the .NET Framework and SQL Express are shared components and do require administrator access to install and do risk destabilizing a machine that already has .NET or SQL server installed.
So this simply cannot work. You can select them as Prerequisites but all that happens at install time is that the ClickOnce installer verifies that they are met. In other words, the machine must already have the correct versions of .NET and SQL Express installed. If it doesn't then the deployment will fail and the user gets the dialog that tells him where to download the installer. It is then entirely up to him (or his administrator) to download and run the installer. After which your ClickOnce install completes without trouble.
The deployment wizard is fairly crummy, it should have hidden the radio buttons at the bottom. Only "from the component vendor's web site" is a valid selection for these prerequisites. The bootstrapper .xml file format isn't sophisticated enough to limit the selection.
Only way to get ahead if you want to provide the user with these prerequisites included with the installer is to create a normal MSI installer.
The way I've done this scenario in the past is just to use the built in "publish" features. They seem to work well in my experience.
In the Publish configuration section of your application there is a "Prerequisites" button that you can click and check off .NET Framework and SQL Express, among other things. During the ClickOnce install, it will prompt the user to pull them down from Microsoft before installing your application.
I had windows application and I published it and I installed it in other pc and when I was installing in this error apeared(you cannot run application that require that assembly microsoft sql server.connection info 9.0.242.0 ......)
Random guess...
You need with either SQL Server native client or SQL Server SMO. or both
You say "published" so I'm guessing it's a ClickOnce deployment.
One gotcha of the automated ClickOnce deployment (at least, it was as of VS2008) is that it doesn't automatically pick up the dependencies of any projects you reference in the project you publish from - you have to add the references into your main project by hand, then they will be added to the manifest, and then deployed to client machines upon installation.
Hope this helps.