Installshield LE with ASP.NET MVC - installshield-le

I am trying to build an ASP.NET MVC installation using installshield LE with VS.NET 2012. I have chosen the solution configuration manager to SingleImage and trying to build the project. I have a UAT web.config transformation in place. After installation web.config in the installed folder is empty. How can I force the installation to pick up the right web.config file while packaging.Any help on this is greatly appreciated.
-George

In your Msbuild command you want the
Target=Package
and Configuration="Release"
This way it will use the Config transform you specify..
Also you will need to then add the config file through dynamic linking in the install shield.

Related

References and .dll missing from TFS get latest

I'm having an issue related to team foundation server with Visual Studio 2012.
I've checked in a new solution to the server, however when i get latest version for other machines, most of the references are missing and the .dll files in the bin cannot be located.
Is this because the files are not being pushed when i check in.
Any help is appreciated thanks
In Solution Explorer, right click the DLLs that aren't being included, go to Properties, and be sure that the Build Action is set to "Content".
Check whether you are using MSBuild-Integrated solutions or using Automatic Package Restore. If you use MSBuild-Integrated solutions, migrating MSBuild-Integrated solutions to use Automatic Package Restore.
If you haven't used Nuget to restore package. Check: https://docs.nuget.org/consume/package-restore
Check whether your project link to other projects. Don't reference output assemblies. Make a project reference or create a NuGet package.

Deploying WPF Application with 3rd Party DLLs

I've been extremely frustrated trying to deploy a C#/WPF application I've created that has some references to 3rd party DLLs. I created a folder in the project, called lib, where I placed all of these DLLs. In VS2012, I added the references by browsing to that folder, and selecting all the DLLs. Copy Local is set to true for all. Everything is fine when I build and run, but when I choose publish, and create a OneClick Installer, things aren't so smooth. During the publish wizard, I set it to install from disk, and set it to never check for updates. I take that folder, place it on a flash drive, plug it into another PC, run the setup, and it throws an Exception. I believe I know what is happening, but I cannot figure out how to package this in order to deploy it correctly.
One of my DLLs is a C# wrapper to a DLL that is designed for a C++ project. We'll say, Application requires DLL1 and DLL1 requires DLL2. DLL2 cannot be added as a reference in the project because is not a .NET DLL. DLL1 requires DLL2 to be in the same folder in order to pick it up. I'm using CefSharp which wraps the Chromium Embedded Framework.
I've tried placing the required DLLs for CefSharp.dll in the publish/Application Files directory, but it did not work. I noticed that all of the DLLs that are there from VS2012 have a .deploy extension on them, I even went and added that extension on to see if it was scanning for that to pick up, but it did not work either. This is my first time doing development and deployment for a Windows application and all of the tutorials on MSDN or blog posts I've read do not seem to cover this case, and I do not see any other options in the deployment manager to handle these types of cases.
If it helps, the Exception Code that is thrown is: CLR20r3
When I catch and display Exception, all of the info I am provided basically says CefSharp.dll or one of it's dependencies cannot be loaded. Which I've gotten before when DLL2 was not in the same folder as DLL1.
Can anyone provide help on how to deploy from VS2012 with a situation like this?
Thanks in advance!
Edit: Info Update
I was attempting to push a debug build version to a test machine without Visual Studio installed. When building for CefSharp or any other C++ Runtime DLL, it will look for all of the Debug versions of the DLL which are usually the same name, but with the letter 'd' added to the end. As mentioned below, the Debug version of the C++ Runtime is not redistributable. Not that you can't manually add those DLLs to your project and set them as Copy Always, but that's kind of a hack job. I started a new project from scratch, added all Release versions of the DLLs, built, and everything was fine.
I've been tearing my hair out trying to fix this very problem this morning and eventually found the solution. It seems you already know which DLLs etc. you need for CefSharp to work but I thought I would run through this in case anyone else is having the same problem. I have a C# WPF application and I'm using CefSharp as the web view. I'm using CefSharp v1 because I need the JavaScript -> C# bridge they provide which isn't yet implemented in v3. Here are the rough steps I went through in setting up the project (I'm using VS2013 but this will probably work in VS2012).
Installing CefSharp
Install CefSharp.Wpf through NuGet (I'm using v1.25.7)
That should put the relevant files in $(SolutionDir)packages\CefSharp.Wpf.1.25.7\cef
Configuring Build
To get the CefSharp DLLs to copy to our build folders, right-click on your project, select Properties -> Build Events and enter the following in the "Post-build event command line":
xcopy "$(SolutionDir)packages\CefSharp.Wpf.1.25.7\cef*" "$(TargetDir)" /s /y /i
That should now copy all of the required DLLs from the cef folder as well as the devtools_resources.pak file and the locales folder plus its contents. I require them in my project as I need the chromium dev tools.
Double-check your project references contain CefSharp and CefSharp.Wpf. That should have been taken care of by NuGet.
Taking care of Visual C++ 2012 Runtime Files
I didn't want the user to have to download the whole Visual C++ 2012 Runtime Files as part of the deployment so through Visual Studio, add the folder Lib\Microsoft.VC110.CRT and add the 3 DLLs (msvcp110.dll, msvcr110.dll, vccorlib110.dll) from the following folder on your machine to the folder you just created in your project:
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\redist\x86\Microsoft.VC110.CRT
Select the 3 DLL files in Visual Studio, right-click -> properties. Make sure Build Action is set to "None" and Copy to Output Directory is set to "Do not copy". Now you need to add another post-build event to make sure these are copied properly (i.e. copied to the root so they sit alongside the CEF dlls and your project exe) for debug.
Right-click on your project, select Properties -> Build Events and enter the following in the "Post-build event command line" just after your other xcopy command for CEF:
xcopy "$(ProjectDir)Lib\Microsoft.VC110.CRT*.*" "$(TargetDir)" /s /y /i
At this point, everything should be building. To publish the app with ClickOnce, I need it to push all of the CEF DLLs out as well as ensuring the files/folders required for chromium dev tools are present. If you don't need the dev tools or all of the DLLs then you can tweak this accordingly.
Ensuring CEF and C++ runtime files are deployed with ClickOnce
Right click your project in Visual Studio and select "unload project".
Right click and select to edit the csproj file.
Before the closing </Project> tag add this
<ItemGroup>
<Content Include="$(SolutionDir)packages\CefSharp.Wpf.1.25.7\cef\**\*">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
<Visible>false</Visible>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="$(ProjectDir)Lib\Microsoft.VC110.CRT\**\*">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
<Visible>false</Visible>
</Content>
</ItemGroup>
That will add everything from the cef folder into the project and make sure the C++ binaries are copied to the root of the project on deployment. In my case for CEF, I'm using the \**\* syntax at the end of the Include and %(RecursiveDir) to ensure all of the files are copied as well as the locales folder with its contents and structure preserved. Having set <Visible>false</Visible> you won't see the items in the solution explorer.
Relax
Now if you publish your app, it should copy over all of the required files and folders.
You could try this which solved a similar issue for me:
Add the DLL's that are not .NET libraries to the solution as files:
Right click project > Add > Existing Item
Then set their build action to Content and "Copy to output directory" to "Copy Always".
That way the libraries will be included in the output directory.
Since you already tried manually adding the suspect dll and it still does not work, the next thing I would do is run fusion and see what it really is complaining about, in other words what exactly is the dependency that can not be loaded. Here is a good tutorial on how to hunt down these types of errors:
Back to Basics: Using Fusion Log Viewer to Debug Obscure Loader Errors
Maybe you can work it out from the https://github.com/Code52/DownmarkerWPF sources?
They have at least a working ClickOnce installer for their app embedding CefSharp. I know because that's the way it got installed on my machine!
update just saw in comments that it's the VC Redist that you say you are missing then Distributing the Visual C++ Runtime Libraries (MSVCRT) seems relevant.
Also I seem to remember something vaguely about that for "VCRedist reasons" you are not supposed to distribute debug versions of your application. Can't you just switch from a Debug to a Release version? With this I think you can either bundle the needed VCRedist files as suggested in the CefSharp FAQ or add VCRedist as a prerequisite in your installer. DownmarkerWPF does it with their WIX installer setup which you can find on a branch in their GitHub repo. Something similar is AFAIK possible with the VStudio bundled installer if that's what you use.
Thanks to Barrie's answer to this, it helped me greatly. I'm using his answer below, but updating it to work for the latest CEF using Visual Studio 2015.
NOTE: I am only building/targeting the x86 platform. You may need to change or include x64 in the copy commands below to suit your needs.
Installing CefSharp
Install CefSharp.Wpf through NuGet (I'm using v51.0.0)
NuGet Library After Install
That should put the relevant files in
$(SolutionDir)packages\CefSharp.Wpf.51.0.0\CefSharp (CefSharp.Wpf)
$(SolutionDir)packages\CefSharp.Common.51.0.0\CefSharp (CefSharp.Common)
$(SolutionDir)packages\cef.redist.x86.3.2704.1432\CEF (Cef x86 redist)
$(SolutionDir)packages\cef.redist.x64.3.2704.1432\CEF (Cef x64 redist)
Configuring Build
To get the CefSharp DLLs to copy to our build folders... I don't believe this is necessary anymore with the later versions of CefSharp. I found that I didn't need any of the "Post-build event command-line" xcopy stuff to get Click-Once to ship it out. (And yes, DevTools works too!)
Taking care of Visual C++ 2012 Runtime Files
(Switched to VCR 2013) I didn't want the user to have to download the whole Visual C++ 2013 Runtime Files as part of the deployment, so through Visual Studio, add the folder lib\Microsoft.VC120.CRT and add the 3 DLLs (msvcp110.dll, msvcr110.dll, vccorlib110.dll) from the following folder on your machine to the folder you just created in your project:
C:\Windows\SysWOW64
(Didn't see them in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist)
At this point, everything should be building. To publish the app with ClickOnce, we need it to push all of the CEF DLLs. You can tweak this accordingly...
Ensuring CEF and C++ runtime files are deployed with ClickOnce
Right click your project in Visual Studio and select "unload project".
Right click and select to edit the csproj file.
Before the closing tag add the following:
<!-- BEGIN: CUSTOM ITEM GROUP INCLUDES INTO THE PROJECT (SO CLICK-ONCE PUBLISHES THEM) -->
<ItemGroup>
<Content Include="$(SolutionDir)packages\cef.redist.x86.3.2704.1432\CEF\**\*" Exclude="$(SolutionDir)packages\cef.redist.x86.3.2704.1432\CEF\x86\**\*;$(SolutionDir)packages\cef.redist.x86.3.2704.1432\CEF\locales\**\*.pak">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
<Visible>false</Visible>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="$(SolutionDir)packages\cef.redist.x86.3.2704.1432\CEF\**\en-GB.*;$(SolutionDir)packages\cef.redist.x86.3.2704.1432\CEF\**\en-US.*">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
<Visible>false</Visible>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="$(SolutionDir)packages\cef.redist.x86.3.2704.1432\CEF\x86\**\*">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
<Visible>false</Visible>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="$(SolutionDir)packages\CefSharp.Common.51.0.0\CefSharp\x86\**\CefSharp.BrowserSubprocess.*">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
<Visible>false</Visible>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="$(ProjectDir)lib\Microsoft.VC120.CRT\**\*">
<Link>%(Filename)%(Extension)</Link>
<Visible>false</Visible>
</Content>
</ItemGroup>
<!-- END: CUSTOM ITEM GROUP INCLUDES INTO THE PROJECT (SO CLICK-ONCE PUBLISHES THEM) -->
That will add everything from the cef folder into the project and make sure the C++ binaries are copied to the root of the project on deployment. Having set false you won't see the items in the solution explorer.
REMEMBER: I am only building/targeting the x86 platform. You may need to change or include x64 in the copy commands below to suit your needs.
Publish
Now if you publish your app, it should copy over all of the required files and folders.
(EXTRA INFO) Supporting Older Operating Systems Info Below
If you need to use CefSharp for older machines (XP & Vista), simply
install CefSharp.Wpf through NuGet using the older v47.0.0 version and change your .NET targeting to .NET 4.0 Client Profile.
Chromium ended support for XP and Vista in April 2016, CefSharp version 47 (or there abouts) still had support for it.
Another note on a problem and fix for XP:
There is a Chromium issue for XP deployments. Below is the article describing the fix followed by steps to deploy fix for JBCB.
Here's the link to the article:
https://bitbucket.org/chromiumembedded/cef/issues/1787
...in it you'll see a reference to download a "dbghelp.dll". Download and extract.
YOU CAN TAKE A POST-INSTALL APPROACH LIKE BELOW OR CHOOSE TO INCLUDE THE DLL ALONG WITH YOUR OTHER PUBLISHED FILES. I'M CHOOSING NOT TO DEPLOY THE EXTRA DLL AND ONLY DEPLOY ON XP MACHINES (WE ONLY HAVE FEW) MANUALLY.
Take these steps to fix deployment on an XP machine:
Install the CefSharp Browser on the XP machine (via Click-Once)
Copy the "dbghelp.dll"
Paste it in the local install directory on the XP machine (per the instructions in previous link: along side the "libcef.dll" file).
NOTE: For click-once installs, will be in a sub-folder under this location:
C:\Documents and Settings\<UserName>\Local Settings\Apps\2.0\<auto-gen ostificated ID>
Read very carefully the official list of CefSharp dependencies - there are a lot of them! You need to get them all into the ClickOnce bin folder somehow.
Here is how I solved it:
Before deploying, install the latest version of Visual C++ Redistributable. on each PC you are deploying to (using group policy or just manually).
Start with a blank test project.
Add project references to CefSharp, CefSharp.Core, etc.
Add each dependency into a single folder in the project directory to keep them organised (Files\CefSharp\).
Ensure all files are configured with Build Action: Content, and Copy to Output Dir: Copy always.
Make a function Initalise_CefSharpFiles() to copy the files/folders into the bin root folder (where CefSharp looks for them). For example, copy from: Bin\Files\CefSharp\* to: Bin\*.
And finally at run time, call Initalise_CefSharpFiles() once after the app loads, and before initialising CefSharp's settings.

how to use CruiseControl.Net to do automatic build for Asp.net 4.0 web application

I am new to Cruise-control.Net and Automatic build concepts. Could you please suggest me how to use cruise control.net to perform automatic build for a sample asp.net 4.0 build application. Please let me know what are the prerequisites in order to use Cruise-control.net
If you are using visual studio, it will give you a project file (.csproj or. vbproj).
You can use the msbuild task in cruise control to build this project which will build the website.
If you need to you can execute aspnet_compiler to compile/validate the other resources in your website, such as in line code in an aspx Page, or. Cshtml razor views.
There should be no other prerequisites for cruise control to do this.
A blog post I wrote a while ago is just what you're looking for. Continuous Integration with Cruise Control .NET
This method doesn't require you to have Visual Studio installed on your build machine. You will need to have .NET 4.0 installed on the build server, though.

How can I host a isapi extension on windows azure

I would like to deploy a web applicaction (ISAPI DLL 32 bit) on windows azure as hosted service.
Now, I have developed my isapi dll and works under IIS, and I would like how can I create a azure package and config file.
I need Visual Studio ? or can I create package using any tool ?
My Isapi dll have been created using delphi xe2.
Regards
You don't have to use Visual Studio, you can use CSPack that is part of the Azure SDK:
http://msdn.microsoft.com/en-us/library/windowsazure/gg432988.aspx
As Tom mentioned, you can use CSPack to create the package. As for the configuration file, you can either create it manually, or use the /generateConfigurationFile switch when using CSPack. This switch will automatically generate a skeleton of the cscfg file. If you don’t have anything to configure, you can just leave it as is. Please also refer to Tom’s link for more information about CSPack. Bottom line is you need a csdef file, which has to be created manually or using a Windows Azure development tool (such as Visual Studio). If you want to create it manually, I would like to suggest you to check http://msdn.microsoft.com/en-us/library/windowsazure/ee758711.aspx for its schema.
Best Regards,
Ming Xu.
Also note please use a startup task to install the ISAPI filter. You can refer to http://msdn.microsoft.com/en-us/library/windowsazure/gg456327.aspx for more information about startup task. Inside the startup task, you can run the Appcmd to install the ISAPI filter, or start a custom C# application, or use PowerShell.
In addition, please check http://learningpcs.blogspot.com/2011/08/powershell-iis-7-adding-isapi-filters.html for the various options to install ISAPI filters.
Best Regards,
Ming Xu.

installshield sharepoint deployment

I am new to sharepoint and installshield. My responsiblity is to build and deploy the sharepoint solution as a package using istallsheild. Previously I was using solution package wsp and content database restoration. But now the client wants to deliver the total solution i.e. dlls, ascx files, xml files, servce files(.cs), feature files using installsjield from development server to another (test and/or client) server.
Can any body help me on this: how to do the sharepoint deployment using installshield?
thanks in advance.
I presume you are using SharePoint solutions to package dll's, ascx and xml files for deployment to a sharepoint server. These solutions are built using a tool like WSPBuilder.
If not: YOU SHOULD!
If so: Why not use SharePoint Installer? It is an installer wrapper around a .wsp (SharePoint solution) file. It will check for the existence of a sharepoint installation, if the required services are started etc.
For deployment to a test machine: Why would you need the .cs files? If you want to test (debug) code on a test machine, I suggest you use either continuous integration using a tool like CruiseControl.NET, or just install Visual Studio on the test machine (which I presume to be a dev test, not a client test machine) and get the latest version, do a build, then roll out the solution.
And what do you mean with "client" server? is there some windows app that's communicating with sharepoint included in the installer? If so, I suggest separating the SharePoint solution from the actual windows app. They might share DLL's but are not supposed to be in the same installer.
We are using a tool (open source - saf.codeplex.com) to automate the Sharepoint components using MSBuild/Features/STSADM etc. Recently they have upgraded this to use WIX so that we can deploy any SharePoint components.
saf.codeplex.com
It has got an very good documentation and also we got a good support in fixing and implementing the SharePoint automated deployment in our premise.
Thanks
BalamuruganK

Resources