Error: The project output folder is being used by a Service Fabric application - visual-studio

When I compile solution that contains 16 Service Fabric applications, Visual Studio hangs on several of them (2 or 3) from time to time.
Message in Error List:
The project output folder is being used by a Service Fabric application. The fabric application didn't release the lock on the output folder within 00:02:00 minutes.
Text in Output Window:
Build started 8/31/2017 11:11:20 AM.
_WaitForServiceFabricApplicationCleanupBeforeBuild:
Waiting for output folder cleanup...
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Service Fabric Tools\Microsoft.VisualStudio.Azure.Fabric.ServiceProject.targets(28,5): error : The project output folder is being used by a Service Fabric application. The fabric application didn't release the lock on the output folder within 00:02:00 minutes.
Build FAILED.
I understand that the reason is connected with Local Cluster but it's important tool and I want to continue to use.
Visual Studio 2015 Update 3.
Microsoft Azure Service Fabric 5.6.220.9494
Microsoft Azure Service Fabric SDK 2.6.220.9494
Local Cluster works in 1-Node mode.

As workaround to resolve this issue you can try to build project using only one thread. In Visual Studio go to
Tools -> Options -> Project and Solutions -> Build and Run
and set maximum number of parallel project builds = 1

I also faced same issue and I uninstalled SF SDK and VS tooling and installed latest version and it worked fine.
Here is the link to get latest SDK and VS tooling.
https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-get-started

Sometimes the SF cluster just gets into fritz and the only way is to Reset Local Cluster, and re-publish all applications. This usually happens after you install new SDK via Web Platform, but frankly it can happen anytime.

Related

How to Deploy a Windows Service using Visual Studio 2017 Community

Working with VS2017 Community I have written a service that works on my local machine. I followed the instruction here:
https://learn.microsoft.com/en-us/dotnet/framework/windows-services/walkthrough-creating-a-windows-service-application-in-the-component-designer
and installed it successfully using Installutil.exe (as per instructions in above link). All good.
I now want to deploy that across six servers in our organisation. In Microsoft's documentation about installing services (https://learn.microsoft.com/en-us/dotnet/framework/windows-services/how-to-install-and-uninstall-services) it says:
If you’re a developer who wants to release a Windows Service that users can install and uninstall you should use InstallShield
and links to a page that applies to VS2012 (can't post any more links as my reputation<10)
I have downloaded and installed the "Microsoft Visual Studio 2017 Installer Projects" package, which allows me to create a Setup Project. When I run it, it installs the project output correctly (i.e. copies the exe & dll files to the correct folder in Program Files) but does not create the service.
There's a detailed post about deploying services on this site (question 9021075) but when I follow those instructions I get a 1001 error on Install.
All the documentation I can find refers to earlier versions of VS or the previous Installer package, so I'm not even certain if I can do it with the software I am using.
So, with VS2017 Community using Microsoft Visual Studio 2017 Installer Projects, how to I create a stand-alone Installer to deploy a service that works correctly when installed locally using InstallUtil?
Or can I use InstallUtil on the target machines? I think I'd need to install Visual Studio on them for that, which I'd prefer not to. Is there a quicker way?
I only have 6 servers to install this on, so even some manual work-around might do.
Thank you for the responses. I now have a solution. I found InstallUtil on the Target Server (in my case it was in C:\Windows\Microsoft.NET\Framework64\v4.0.30319 but search will find it). I copied and added that to my project as content so when I now deploy it, I have InstallUtil in the same folder as my EXE.
To install, I run CMD as admin, cd to project folder and issue command:
installutil.exe myService.exe
This is a one-off task. Once the service is working, to update it I just need to stop it, upload the new myService.exe (& any DLLs) to overwrite the old ones and restart it again.
Further information about settings you're using for the serviceProcessInstaller1 and serviceInstaller1 files will be needed to debug this issue, as the 1001 error raised by the installer is a generic error.
An alternative way of doing this is to use Topshelf, which is a framework for hosting services written using the .NET framework. It simplifies the creation of services, allowing developers to create a simple console application that can be installed as a service using Topshelf. The reason for this is simple: It is far easier to debug a console application than a service. And once the application is tested and ready for production, Topshelf makes it easy to install the application as a service.
Alternatively, you could use InstallUtil.exe. It is part of the .NET Framework, so no need to install Visual Studio.

Develop an Azure Service Fabric Application with Visual Studio 2017 for Mac

my team is creating an Azure Service Fabric application using ASP.NET/Dotnet Core. Whenever I try to import the project into my Visual Studio 2017 for Mac I get the error
Error while trying to load the project '.../Project.sfproj: Unknown solution item type'
The solution contains several projects, some with a csproj (which I can open just fine), and some with a sfproj, that cause the problems. I can't even browse them in VS2017:
I can run msbuild from the shell (get some Compiler errors, but that's fine), but cannot manage to load the project into my IDE. I guess I'm missing the Service Fabric SDK, but that is not available for mac afaik. I managed to pull some jars from the vagrant image, as described here but that doesn't help me in a ASP.NET/Dotnet Core application.
Unfortunately, this feature is currently not available. If anyone wants it, vote for it on the visual studio user voice page.

"aapt.exe" exited with code 255

Trying to setup my build server for Xamarin Android builds, but i constantly keeps getting into this issue:
[error]C:\Program Files
(x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1832,3):
Error MSB6006: "aapt.exe" exited with code 255.
Anyone know what this error code means? We dont have this issue on the teams local computers. So i assume i am missing something on the build machine, but cannot figure out what.
Visual Studio Team Services Build Agent
MS 2012 R2 Datacenter
Visual Studio 2015 Community
Android SDK Manager w/all SDK's up til revision 24
Xamarin 6.1.1.0
There must be a problem in build tool. So, can you compare the installed build tool version in your local machine and build machine.
Note: Add the following line under PropertyGroup tag in your project file to specify the build tool version.
<AndroidSdkBuildToolsVersion>23.0.3</AndroidSdkBuildToolsVersion>
I believe you are probably missing some files in your SDK manager for android. Open the sdk manager and ensure you have downloaded all API levels you are targeting as well as the up to date build tools and extras.

How Do I configure my setup in Visual Studio 2010 using Visual Studio installer to check for updates?

I have built an Application using visual studio 2010 and a setup using the Visual Studio installer. Now what I want is whenever the exe is installed on a client machine it should check for updates regularly.
Any Suggestions . Please Help.
It's my experience that most people do this in the app itself, so that when it runs it checks your web site for updates.
Basically you need a web service call to which your app passes the ProductCode and Version of your setup, your MSI file build. At your web host you need a database (or Xml file) that has information on the latest available version and it's download location so that you can return that information to your app, assuming the latest version is higher than the running one.
You're in Visual Studio, so you build a RemovePreviousVersions updated MSI, and that's what you download and install. If the install needs admin rights and your app isn't elevated than you'd launch an external exe with an elevation manifest to get it installed.
I just finished a project similar to this, but instead of using Visual Studio installer libraries, I created a windows service that runs on a 10 minute loop, and when the service detects a new version, it kills the running application and performs a download and copies the new files into the application folder.
There are a few things you need to take into consideration; 1) A way to gracefully warn and then close the application so the user is not angry over a forced kill of the application. 2) A web location to store the upgraded application files, and a web service to advertise the available application versions. 3) A way to queue the upgrades so that when a new version is released not every client will be upgraded at once (flooding your web server with upgrade requests and downloads).
This technique is used by Adobe for upgrading and installing applications such as Acrobat Reader and Flash.

How do you test Windows Phone 7 app upgrades?

Version 1.5 of my Windows Phone app uses Version 1 of a 3rd party Isolated Storage library. I Version 2 of this library has performance improvements and bug fixes. I would like to upgrade my app (make it Version 1.6) to the new version but would like to test that data is not lost during upgrade.
I deployed version 1.5 to the phone and when I deploy version 1.6 from VS2010, the previous app and data are lost. My app is not upgraded but simply replaced.
How to I test the upgrade?
Thanks
You should deploy from within Visual Studio after rebuilding the xap, not using the xapdeploy tool - see this article for an example:http://gusperez.com/wp/2010/12/22/update-testing-your-windows-phone-7-apps/
I'm guessing that you have 2 separate project which each have the same ProductID (in WMAppManifest.xml). This would explain why the first app is being uninstalled when the second app is deployed.
I'd test this by manually setting the contents of Isolated on the first run of the new version of the app.
There are 2 approaches you can take:
- Manually set the contents of the files in IS (either in code or during debug)
- Use a tool like Isolated Storage Explorer
I would probably do something like:
You can use Isolated Storage Explorer Tool (ISETool) to copy the isolated storage files from your old version into a directory (which you would commit to source control).
Create a Build Configuration called "Debug - Upgrade from 1.5"
Define a Post-Build Event that copies the data from the 1.5 backup directory to the emulator (it will need to be running; you may want to create a separate command line that starts the emulator)
Now you should be able to just hit F5 (after the emulator is already running) to test your upgrade over and over.
(Ideally, if Visual Studio used MSBuild to do the Deployments to the emulator/phone, we could simply hook into that process and update the IS after deployment but before execution. Sadly, that is not the case)

Resources