MSBuild does not create ClientBin folder? - silverlight

I have a silverlight application. When i build the application using VS 2013, it creates ClientBin folder under web project and copies all XAP files into clientbin folder as expected.
However our build process use MSBuild to build all the applications. We have custom .proj file which has bunch of tasks to build the applications. When i execute .proj file using Msbuild command it doesn't not create ClientBin folder

After checking around for problems similar to yours and looking at some of my silverlight projects I would suggest the following:
As you stated you are using a custom .proj file, you should check the custom .prog file and make sure this exists in a <PropertyGroup/>
<SilverlightApplicationList>{GUID}|..\Silverlight_Project_Folder\Silverlight_Project_Name.csproj|ClientBin|False</SilverlightApplicationList>
This value tells MSBuild to copy the XAP in the ClientBin directory.
Take note of the silverlight projects GUID. It can be obtained from the Silverlight app .csproj file:
<ProjectGuid>{00000000-0000-0000-0000-000000000000}</ProjectGuid>
There was also a mention of including the CopySilverlightApplications; task on the build server's Microsoft.WebApplications.targets
Hope this helps
References:
New Silverlight app doesn't generate XAP
How to get the Silverlight XAP copied to the clientbin on build
Silverlight xap file not being copied to ClientBin on Build Server
MSBuild SilverlightApplicationList

Related

Where can I download RiaServices.msi nowadays?

Where can I download RiaServices.msi from the web, after Microsoft removed it?
I need to prepare a new virtual machine to host a legacy Silverlight application.
Thanks!
As far as I know, downloading ria.services separately may not be easy to find at the moment, you can use NuGet to install it.
After the hint from #Jiayao, I decided to forget about the RiaServices.msi installer and manually copy the necessary files to the target host machine, where the Silverlight app was published.
Luckily the files simply need to be copied to the silverlight "bin" folder.
The files I copied were:
System.ServiceModel.DomainServices.Client.dll
System.ServiceModel.DomainServices.Client.Web.dll
System.ServiceModel.DomainServices.Hosting.dll
System.ServiceModel.DomainServices.Server.dll
These libraries are available in the "lib" folder of riaservices.silverlight.4.2.0 and riaservices.server.4.2.0 NuGet packages. You can download the packages, rename the .nupkg files to .zip and extract them.
If I have the chance to compile the Silverlight application from the source, I plan to add these NuGet packages as dependencies of the project, so they can be normally deployed within the Silverlight application.

Wpf application as a single executable

I'm trying to package my wpf application as a single executable.
I use Fody Costura which works fine packaging all the dll into the exe.
However the exe still requires the application config file and it has to be in the same folder as the exe
So for instance if my application executeable is
"myapp.exe"
then the configuration file
"myapp.config.exe"
is required.
Can I package (embed the app config) such that only myapp.exe is required to run my application?
Can I package (embed the app config) such that only myapp.exe is required to run my application?
No, an application configuration file cannot be embedded into an assembly. At least not if you intend to use the App.config file as usual, using for example the ConfigurationManager class.
You could remove the configuration file but if you are storing some settings in it, you will need to move these to somewhere else and also implement your application to retrieve them from there.

Published ClickOnce app deploying .exe

I am using MSBuild to publish a WPF click once app. I am calling something to the effect:
msbuild /t:publish /p:PublishDir=[some directory] /p:ApplicationVersion=1.2.3.4
The output is including the startup WPF project's .exe in the top level directory:
\Output\
\MyApp.exe
\MyApp.application
\Application Files\MyApp_1_2_3_4
Why is it including MyApp.exe in the output? How can I disable this behavior?
* additional info *
I created a brand new test project to reproduce this. Publishing from the project properties does to result with the .exe being copied. But if I publish it from MSBuild it does. Still trying to figure out why MSBuild is including this useless file.

How to copy folder of images into WFP app in Visual Studio?

I have a folder of images I want to embed as resources into a WPF app built using Visual Studio 2015. How can I do this dynamically at build time so that the folder contents is copied as-is and the app can access the images using Uri("pack://application:,,,/Resources/" + path)?
To be precise, I do not want to add the images from the folder one by one to the project as the contents of the folder is not constant.
Ideally the folder itself would be embedded as a resource so that the URIs would be Uri("pack://application:,,,/Resources/" + "MyFolder/" + path).
I eventually figured it out based on this other question: the solution is to manually edit the .csproj file using Notepad or equivalent and insert another group like this:
<ItemGroup>
<Resource Include="..\..\_App_\Resources\*">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
</ItemGroup>
Then whenever you re-open the Visual Studio solution, it will show all files in that folder under the project in the explorer and copy them to the app as resources.
Unfortunately, it doesn't appear possible to put these files under their own folder in the app resources.

Deploying a XAP file into ~/ClientBin using VSeWSS

I have a SharePoint (using VSeWSS 1.3) project that creates a WSP file which installs my custom content types. One of the type also installs a custom version of DispForm.aspx which is hosting a Silverlight control, located in the ~/ClientBin as a XAP file.
Is there a way in the ListDefinition.xml file to instruct VSeWSS to deploy my XAP file into ~/ClientBin as part of the WSP solution? I know how to deploy images to the TEMPLATES\images folder, but not to ~/ClientBin .
Philipp
To get the XAP file into the ClientBin directory you could try this. Let the solution deploy the XPA file to a folder within the TEMPLATE directory (12 Hive). With a FeatureRecevier that triggers on the FeatureInstalled event you could then copy the XAP file from its location in the sub folder of the TEMPLATE directory to the ClientBin folder.
The FeatureUnistalled event can be used to remove the XAP file from the ClientBin folder when the solution is retracted.
WSP can place the Files in following locations
Any Sub Folder inside 12 Hive
GAC
Bin directory of the Web Application.
Considering the above I recommand you to Change the Location where you keep the XAP file. You can think about placing it in the _Layouts. That is how I Did

Resources