ClickOnce Deployment of multiple EXEs and Config files - wpf

I have a WPF solution (C# & VS 2012) that calls an external EXE. I've added a reference to the external EXE in the main (Dashboard) project.
The solution is getting packaged into the ClickOnce package and published. The issue I'm running into is that the CONFIG file for the external EXE is not getting picked up in the ClickOnce package.
When I open the Application Files window on the Publish tab in VS2012 it shows the external EXE.
But the configuration file for external EXE is not listed, even with the "Show All Files" checkbox selected.
So my question is:
Is there a way to either manually add a config file to the ClickOnce deploy package or somehow coerce it to see the config file?
This is my first ClickOnce deployment project so I'm struggling a little here and any assistance would be appreciated!
Thanks!
UPDATE/SOLUTION FOUND:
After much web surfing I found an fix for this issue. Here's the posting on MSDN that helped me MSDN: ClickOnce and External config. This at least solved the issue for me in the short term. As noted in the MSDN post it can cause issues down the road if the external config changes frequently.

UPDATE/SOLUTION FOUND: After much web surfing I found an fix for this issue. Here's the posting on MSDN that helped me MSDN: ClickOnce and External config files. This at least solved the issue for me in the short term. As noted in the MSDN post it can cause issues down the road if the external config changes frequently.

Related

Publish Windows form application how change the installation path

I have built one windows forms application and I published for client installation. While installing the setup file, it should ask the user to select the installation directory path; instead, it's installing in default path as below :
C:\Users\Mysys_t\AppData\Local\Apps\2.0\434YBBVC.Z2H\TNYPR09N.1JZ
Is there any settings to do this, so that, while installing, user is able to select the installation directory?
In general, the answer is no. See a related MSDN forums discussion among other online references that explains why: ClickOnce was designed to automatically manage installation directories to prevent deployment collisions.
Now...the referenced MSDN forums discussion also links to one way to possibly work around this. Certainly anything is possible with some ingenuity and work (e.g. publishing a setup wrapper with ClickOnce to leverage ClickOnce's auto updates but use indirection to control where your actual app ultimately gets installed); but this is not possible using ClickOnce "straightforwardly".
this can be achieved by
Creating an MSI Package for C# Windows Application Using a Visual Studio Setup Project
pls follow the link below :
http://www.c-sharpcorner.com/UploadFile/1492b1/creating-an-msi-package-for-C-Sharp-windows-application-using-a-v/

I am getting "myApp stopped working" after installig my WPF(+telerik) application

I created a WPF application using telerik control suite (WPF telerik controls and ORM access control) and SQL Express R2 2008 in VS 2012.
Then I created its setup files (using install shield LE and also Advanced Installer) which works on my win7 system, properly () .but when I install the setup file on any other win7 system, it doesn’t work( I am getting this error: “MyAPP has stopped working”).
I installed .NET framework and SQL Express R2 2008(the service’s status is running) and I also copied the mdf and ldf files related to the database in right path that specified in app.xaml.
When I install my setup files, it just copy my project’s debug folder (contains the telerik control dll files, the dll file related to my ORM access control project, built exe file and etc.). I think that’s enough. Isn’t it?
Edit:
The project's Solution's Explorer:
\bin\Debug
I have no idea what to do.
I would really really appreciate any hint or comment.
Regards,
Hiva
I know this is a very general answer although without knowing the details of your project it's the best I can do. I remember when I was creating an app using telerik controls, when I went to publish it I was getting errors in the with the assembly which was a result of including the obj / Debug / Release folders in my project. I tried everything that people listed to get rid of the errors but the only thing that helped was creating a new project, copying in the code and NEVER including(Never right clicking and hitting include in project) those folders in my project.
Is it working when you debug it?
Could you please let me know what steps you are taking to publish the app ?

MvvmCross Network Plugin WPF

I am working on an mvvmcross solution. I am making a wpf project as well to speed up the core development. Today I ran into an issue running a wpf project using a core that has the network plugin. When the setup.Initialize() is called I end up with the exception "Could not load file or assembly 'Cirrious.MvvmCross.Plugins.Network.Wpf' or one of its dependencies. The system cannot find the file specified.". I did include the network plugin from NuGet to my wpf project as well. Anyone know what might be the issue here?
Thank you!
i only added the wpf version of that plugin 5 days ago - https://github.com/slodge/MvvmCross/commits/TibetBinding/Plugins/Cirrious/Network/Cirrious.MvvmCross.Plugins.Network.Wpf
It hasn't yet made it to nuget - when it will depends on my work schedule and my hotel wifi - 'soon' is all I can say.
You can build it for yourself if you need it urgently - on the tibetbinding branch (see link above)

Error MSB4018: The "CreateRiaClientFilesTask" task failed unexpectedly - Attempted to access an unloaded AppDomain

This question is different from the questions posted here and here even though the titles are the same.
The problem arises intermittently. The error always occurs if the project has been cleaned or is being built from a fresh checkout. Pushing build again immediately usually results in the build succeeding. The stacktrace I get is:
error MSB4018: The "CreateRiaClientFilesTask" task failed unexpectedly.
System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain.
at System.IDisposable.Dispose()
at Microsoft.ServiceModel.DomainServices.Tools.CreateRiaClientFilesTask.GenerateClientProxies()
at Microsoft.ServiceModel.DomainServices.Tools.CreateRiaClientFilesTask.ExecuteInternal()
at Microsoft.ServiceModel.DomainServices.Tools.RiaClientFilesTask.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__1c.MoveNext()
The problem also occurs intermittently during regular edit-build-execute cycles, and sometimes a restart from Visual Studio is required to make it work on these occasions.
The problem occurs both in MSBuild and Visual Studio 2010. I have all of the latest updates installed (WCF RIA Services SP2). It occurred when using the Silverlight 4 tools, and upgrading to Silverlight 5 has not solved the problem. The problem also still occurs in the beta of VS 11.
I've not been able to change the order of the build as described here (referenced from here) as MSBuild complains of a circular dependency and Visual Studio says that I can't reference a non-Silverlight project from a Silverlight one. From that page I have also tried following this link and changed the default ToolsVersion from 2.0 to 4.0 in the registry.
I'm definitely using the 32 bit version of MSBuild, as trying to use the 64 bit version fails with failing to Hydrate the entity framework model. I'm not using the /m switch to build it in parallel either.
The project was initially a web project (which hosts the site that the Silverlight control lives on, RIA services, and contains the Business logic) and a Silverlight project. Changing this to 3 projects (with a class library containing the logic) doesn't make any difference.
The next thing I'm planning on trying is having the project hosting the RIA service separate from the one hosting the Silverlight app, but that's not ideal for us (and I'm not even sure it will work).
In my case, this exception was caused by McAffee's anti-virus application. Disabling the 'On-Access' (or was it 'On-Demand') feature resolved the issue.
I had a similar issue in the past with Microsoft's Security Essentials which was resolved by adding the exclusions below. I suspect that it is the 'Temporary ASP.Net Files' folder exclusion that would be required to solve the issue here.
Excluded Files and Locations
C:\Temp\Default\NuGet.exe
C:\Temp\NativeImage\NuGet.exe
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files
NuGet.exe
Excluded Processes
C:\Program Files (x86)\Common Files\microsoft shared\DevServer\11.0\WebDev.WebServer40.EXE
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Microsoft.VisualStudio.Web.Host.exe
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
This exception is driving me crazy! I also tried to clean ASP.Net temporary folder, clean all projects in the solution, run VS as administrator etc. But still I have this problem. My solution to the problem is twice rebuild Web project.
In our case we ran into the same problem as reported in another answer to this same question (https://stackoverflow.com/a/14125687/223837): McAfee strangely interfered with the files in 'Temporary ASP.NET Files'. But in our case we could not disable McAfee or change the excluded folders because of company policy.
But we found a different solution: what we did is update the machine.config file (in our case C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config), and add a <compilation tempDirectory="..."/> element, as follows:
<configuration>
<!-- snip -->
<system.web>
<!-- snip -->
<compilation tempDirectory="c:\A_FOLDER_THAT_IS_SKIPPED_BY_MCAFEE\TempASP.NETFiles\"/>
</system.web>
<!-- snip -->
</configuration>
(Inspiration for this solution direction came from an answer to a related question: https://stackoverflow.com/a/1255303/223837.)
I had the exact same thing happening to a couple of my projects. I found (inferred really) it was related to my upgrade path of RIA and Silverlight. I got a new machine, with all the updates on and it STILL happened. However, when I re-created the projects from scratch (copying the files over, and settings, NOT the 'generated' assembly information), the problem went away.
Not a definitive answer you'd expect I suppose, and to be honest, re-creating the solution from scratch was a pain. I do suspect (and the only conclusion I could bring) it was related to some GAC declaration or other that was asking for an earlier version of the RIA framework.
I HAD installed a version of RIA and coded using it, and there were a couple of Silverlight updates that happened in quick succession during this time. I have had no problems since.
I found a solution to this problem which has so far fixed the issue on every server and client that I've run it from.
My initial project layout had a Web Project which acted as a host for both the RIA components and the Silverlight app itself. I created a class library for the RIA services, moved all of my RIA logic into there and added a reference to it from the Web Project. Then I updated the RIA link in Silverlight to point to this new project.
I had to add the following line into the Silverlight app.xaml.cs file so that authentication worked.
((WebAuthenticationService)WebContext.Current.Authentication).DomainContext
= new RiaNamespace.AuthenticationDomainContext();
Remove or disable your virus-scanner during build. Worked for me too!
I had the same problem.
I just changed the "Assembly Version" number and my project was OK.

Including winforms installer in UppercuT code_drop

Does anyone know how to specifically include a winforms setup project to be included in the code_drop folder generated when running UppercuTs zip.bat? With the default settings my web applications and WCF services are included, as are the dll's for the solutions core, but not my winforms application/installer
I was just playing around with UppercuT last night, and I ran into the same question.
One tip I found for putting console apps and windows services into the code_drop is to use this Nuget package in your console/windows service projects:
http://nuget.org/packages/publishedapplications
See this for more info:
http://devlicio.us/blogs/rob_reynolds/archive/2011/03/22/published-applications-aka-publishedapplications.aspx
Using this will cause your console/windows service projects to be "published" similary to how a web app is published in the code_drop. However, this isn't what you're asking for, just wanted to point it out if its useful. This also doesn't work for installers.
If your installers are using the default Visual Studio setup projects (.vdproj projects), I haven't tried that, so I can't help there. I do know that MSBuild refuses to build those types of projects (not sure why...), so you might be better off using WiX or another installer technology. You can do an automated build on a vdproj if you run the build by calling devenv.exe directly from the command line, but you can't build those with MSBuild. I did try adding a WiX setup project to my sln, and UppercuT will build the Wix setup project and drop the .msi in the "build_output" folder, but it doesn't copy it over to the code_drop. My thought would be to add a custom post build step to just copy that file over from build_output to code_drop. I haven't had a chance to figure out the logic in the build scripts to see how it chooses which files to copy from build_output to code_drop. If I figure anything out, I'll update this answer.

Resources