Quantcast
Channel: Microsoft Visual Studio/.Net Framework Setup & Deployment Tips & Tricks
Viewing all 75 articles
Browse latest View live

An error occurred while signing: SignTool.exe not found

$
0
0

While publishing a ClickOnce application using Visual Studio 2010, it may fail with the following error message:

Error 1 Cannot publish because a project failed to build.   
Error 2 An error occurred while signing: SignTool.exe not found.

Build output:

Building WindowsFormsApplication...
Error: Cannot publish because a project failed to build.

The signtool.exe is located at the following location:

%programfiles(x86)%\Microsoft SDKs\Windows\v7.0A\Bin   for x64 system

%programfiles%\Microsoft SDKs\Windows\v7.0A\Bin          for x86 system

Please make sure that the file is available there. Signtool.exe is part of the windows platform SDK. If the file is not present on the system, please install/repair  windows platform SDK OR copy the file from a working system.

Now try to publish the ClickOnce application. If you still find the same issue, please check if you installed the Microsoft .NET Framework 4.5 Developer Preview on the system. The Microsoft .NET Framework 4.5 Developer Preview is a prerelease version of the .NET Framework, and should not be used in production scenarios. It is an in-place update to the .NET Framework 4. You would need to uninstall this prerelease product from ARP. 

4.0beta

After uninstall please reboot the system and install the .Net Framework 4.0 RTM. It can be downloaded from the following link also: http://www.microsoft.com/download/en/details.aspx?id=17718 
Then launch Visual Studio 2010 and publish the ClickOnce Application.


“Current thread must be set to single thread apartment (STA) mode before OLE calls can be made”

$
0
0

While calling a OpenFileDialog (http://msdn.microsoft.com/en-us/library/system.windows.forms.openfiledialog.aspx) via Installer class as a Custom Action in the Visual Studio Setup project, it just hangs there. When we attach a debugger we receive an error: "Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it. This exception is only raised if a debugger is attached to the process."  

The same code works fine on Win XP and 2003. It only occurs on Win Vista and higher version of Operating Systems. The sample code is mentioned below: 

            MessageBox.Show("Cannot Locate Config File");

            MessageBox.Show("Pid : " + System.Diagnostics.Process.GetCurrentProcess().Id.ToString());

            String Location = String.Empty;

            OpenFileDialog frm = new OpenFileDialog();  

            frm.InitializeLifetimeService();

            frm.Filter = "Config Files (*.config)|*.config| (*.xml)|*.xml";

            frm.Title = "Browse Config file";

            DialogResult ret = frm.ShowDialog();

            if (ret == DialogResult.OK)

            Location = frm.FileName;

            InitializeComponent();

 

The problem is that the MSI thread is running as an MTA thread, but the FileDialog.ShowDialog requires an STA thread.  To achieve this you will need to start a STA background thread and call the dialog from that thread. Basically I did the following:

-          Added the DialogState class.  This keeps track of the input and output for the thread.

-          Added the STAShowDialog function.  This function takes a FileDialog, calls ShowDialog on a background STA thread, and then returns the results.

-          Changed the call from DialogResult ret = frm.ShowDialog(); to DialogResult ret = STAShowDialog(frm);

 

You may need to add exception handling separately. 

Here is the complete code:

  

using System;

using System.Collections;

using System.Collections.Generic;

using System.ComponentModel;

using System.Configuration.Install;

using System.Linq;

using System.Windows.Forms;

 

 

namespace WindowsFormsApplication1

{

    [RunInstaller(true)]

    public partial class Installer1 : Installer

    {

        public Installer1()

        {

            MessageBox.Show("Cannot Locate Config File");

            MessageBox.Show("Pid : " + System.Diagnostics.Process.GetCurrentProcess().Id.ToString());

            String Location = String.Empty;

             OpenFileDialog frm = new OpenFileDialog();

             frm.InitializeLifetimeService();

            frm.Filter = "Config Files (*.config)|*.config| (*.xml)|*.xml";

            frm.Title = "Browse Config file";

            DialogResult ret = STAShowDialog(frm);

 

            if (ret == DialogResult.OK)

                Location = frm.FileName;

             MessageBox.Show(Location);

             InitializeComponent();

        }

 

        /* STAShowDialog takes a FileDialog and shows it on a background STA thread and returns the results.

         * Usage:

         *   OpenFileDialog d = new OpenFileDialog();

         *   DialogResult ret = STAShowDialog(d);

         *   if (ret == DialogResult.OK)

         *      MessageBox.Show(d.FileName);

         */

        private DialogResult STAShowDialog(FileDialog dialog)

        {

            DialogState state = new DialogState();

            state.dialog = dialog;

            System.Threading.Thread t = new System.Threading.Thread(state.ThreadProcShowDialog);

            t.SetApartmentState(System.Threading.ApartmentState.STA);

            t.Start();

            t.Join();

            return state.result;

        }

    }

 

    /* Helper class to hold state and return value in order to call FileDialog.ShowDialog on a background thread.

     * Usage:

     *   DialogState state = new DialogState();

     *   state.dialog = // <any class that derives from FileDialog>

     *   System.Threading.Thread t = new System.Threading.Thread(state.ThreadProcShowDialog);

     *   t.SetApartmentState(System.Threading.ApartmentState.STA);

     *   t.Start();

     *   t.Join();

     *   return state.result;

     */

    public class DialogState

    {

        public DialogResult result;

        public FileDialog dialog;

 

        public void ThreadProcShowDialog()

        {

            result = dialog.ShowDialog();

        }

    }

}

 

A device attached to the system is not functioning

$
0
0

ClickOnce application may fail with the following error message:

A device attached to the system is not functioning. (Exception from HRESULT: 0x8007001F)

As per the ClickOnce log:

                                 + Exception reading manifest from file:///C:/TEMP/Application%20Files/app_1_0_0_1/app.exe.manifest: the manifest may not be valid or the file could not be opened.

                                + Parsing and DOM creation of the manifest resulted in error. Following parsing errors were noticed:

                                                -HRESULT:           0x8007001f

                                                Start line:            0

                                                Start column:    0

                                                Host file:            

                                + A device attached to the system is not functioning. (Exception from HRESULT: 0x8007001F)

Stack Trace:

                --- Inner Exception ---

                                System.Deployment.Application.InvalidDeploymentException (ManifestParse)

                                - Parsing and DOM creation of the manifest resulted in error. Following parsing errors were noticed:

                                                -HRESULT:           0x8007001f

                                                Start line:            0

                                                Start column:    0

                                                Host file:            

                                - Source: System.Deployment

                                - Stack trace:

                                                at System.Deployment.Application.Manifest.AssemblyManifest.LoadCMSFromStream(Stream stream)

                                                at System.Deployment.Application.Manifest.AssemblyManifest..ctor(FileStream fileStream)

                                                at System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)

                                --- Inner Exception ---

                                System.Runtime.InteropServices.COMException

                                - A device attached to the system is not functioning. (Exception from HRESULT: 0x8007001F)

                                - Source: System.Deployment

                                - Stack trace:

                                                at System.Deployment.Internal.Isolation.IsolationInterop.CreateCMSFromXml(Byte[] buffer, UInt32 bufferSize, IManifestParseErrorCallback Callback, Guid& riid)

                                                at System.Deployment.Application.Manifest.AssemblyManifest.LoadCMSFromStream(Stream stream)

 After debugging, I found that the following lines were included in the app.manifest file:

<?xml version="1.0" encoding="utf-8"?>

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >

  <asmv3:application>

    <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">

     <dpiAware>true</dpiAware>

    </asmv3:windowsSettings>

  </asmv3:application>

</assembly>  

 

The above lines are needed to declare a DPI-aware application.This is a new element in a new namespace, so ClickOnce runtime is not compatible with it. Installing ClickOnce published applications is not possible if there is a tag in the manifest file about the dpi-awareness. This is not something that ClickOnce explicitly supports. So you may need to exclude the DPI-aware part for ClickOnce deployment.  Alternatively, you may try calling SetProcessDPIAware function though it is not recommended.

ClickOnce on Roaming Profile

$
0
0
 
 
Let’s first talk about Roaming Profile: 
Roaming Profile allows users with computers on a Windows Server domain to log on to any computer 
on the same network and access its documents. While on Roaming Profile, the user profile information 
is stored on a centralized file server accessible from any network-joined desktop computer instead of 
local storage.
Here’s a link to a guide to managing Roaming Profile data:
http://technet.microsoft.com/en-us/library/cc766489%28v=ws.10%29.aspx

Why isn’t ClickOnce supported on Roaming Profile?
ClickOnce is a per user installation. When the application is deployed through ClickOnce, its files are 
stored under the profile folder of the user (<USER PROFILE>\AppData\Local\Apps).
By default, the Appdata\Local folders and all their subfolder like History, Temp, and Temporary 
Internet Files folders are excluded from the user's Roaming Profile. So when the user logs off the 
machine on Roaming Profiles, these folders are not copied to the centralized server. Interestingly, 
shortcuts created by the application will be copied to the centralized location and will roam with 
the user profile (Shortcuts and desktop folders are allowed to roam). However when users launch 
such a shortcut, it will try to search for the files under the current user profile (Appdata\Local), but 
it fails to find it as this folder is not copied to the centralized location. 
This in turn may ask users to reinstall the application. 

Can folder redirection make Clickonce work with Roaming Profile?

The answer unfortunately is No. Folder redirection can only be done for only some of the shell known

folders. And “AppData\Local” is not a shell known folder. Also ClickOnce can install files at a very

deep level (upto N+10th  folder)

eg.

--------------------------------------------------------------------------------------------------------------------------------------

“C:\Users\username\AppData\Local\Apps\2.0\Data\RNLVHZMG.D0C\Z3MKJ8WN.00D

                                      \1              \2       \3       \4    \5      \6                          \7

\ngim..tion_c3bce3770c238a49_000f.0001_16a9459e29f27733\Data\15.0.225.0”     
\8                                                                                                               \9       \10

--------------------------------------------------------------------------------------------------------------------------------------

This article contains the list of the folder’s that can be redirected :
http://technet.microsoft.com/en-us/library/cc732275.aspx

Note
: A few
application models for roaming settings are available, however these variation have not

been tested for this requirement.

Content by-

Keshav Deo Jain, Soumitra Mondal

Error 1939. The service 'My_Service' could not be configured

$
0
0

Problem: MSI 5.0 package fails with an ERROR 1939 during "MsiConfigureServices" standard action execution. I tried to use "MsiConfigureServices" standard action in the msi package to configure a custom service. The MSI package fails to execute on Win 7 + OSs. The exact same issue can be found at this forum discussion

As per the MSI failure log:

MSI (s) (DC:09) 11:44:00  am:342): Executing op: ServiceConfigureFailureAction(,Name=ServiceConfigRepro,Event=5,ResetPeriod=604800,RebootMessage=[~],Command=[~],Actions=1,DelayA

MSI (s) (DC:09) 11:44:00  am:342): changing configuration of failure action for service ServiceConfigRepro.

MSI (s) (DC:09) 11:44:00  am:420): Error: 5. Failed to change current configuration of failure action for service ServiceConfigRepro

MSI (s) (DC:09) [11:44:00  am:420): Failed to change configuration of failure action for service ServiceConfigRepro

MSI (s) (DC:09) 11:44:00  am:420): Note: 1: 2205 2: 3: Error

MSI (s) (DC:09) 11:44:00  am:420): Note: 1: 2228 2: 3: Error 4: Select 'Message' from 'Error' where 'Error' = 1939

MSI (c) (30:10) 11:44:00  am:732): Font created. Charset: req=0, ret=0, Font: req=MS Shell Dlg, ret=MS Shell Dlg

Error 1939. The service ‘My_Service’ (ServiceConfigRepro) could not be configured. There may be a problem with the package, or with your authorization. Make sure that your permissions are sufficient to configure the system services.

In MSI 5.0 the MsiServiceConfig and the MsiServiceConfigFailureActions tables are introduced and more information is available at Windows Installer team blog http://blogs.msdn.com/b/windows_installer_team/archive/2009/03/04/enhanced-service-configuration-with-windows-installer-5-0.aspx?Redirected=true 

After debugging, I found it was due to a bug in MSI 5.0. Here are the details:

I tried to configure failure action for service (i.e. My_Service) if the service fails and action ‘SC_ACTION_RESTART’ (i.e. Restart the service) is set. We can see this field (i.e. 1, that specify action ‘SC_ACTION_RESTART’, refer this for more detail) in Action table of ‘MsiServiceConfigFailureActions’ table of the MSI package.  I noticed that it returns ACCESS_DENIED while calling with SC_ACTION_RESTART and the service handle does not have SERVICE_START rights. So MSIEXEC fails due to Authorization issue. The solution would be to choose another failure action than restating the service (as per below options).  I have tried with ‘SC_ACTION_RUN_COMMAND’ field for failure Action, where we can run command like ‘SC Start <ServiceName>’ to start service.  It perfectly worked for me. 

 

Actions

This field contains an array of integer values that specify the actions taken by the SCM if the service fails. Separate the values in the array by [~]. The integer value in the Nth element of the array specifies the action performed when the service fails for the Nth time. Each member of the array is one of following integer values.

Constant

Description

 SC_ACTION_NONE 

0

       No action.

 SC_ACTION_REBOOT

2

Restart the computer.

 SC_ACTION_RESTART

1

Restart the service.

SC_ACTION_RUN_COMMAND

3

   Run a command.

  The table would like this after making the required changes.

 

 

 

 

LightSwitch Extensibility Toolkit for Visual Studio 2012 Failing With a Generic Error message

$
0
0

Issue Description:

Installation of LightSwitch Extensibility Toolkit for Visual Studio 2012 Failing With a Generic Error message dialog box

Environment:

Windows 7 SP1 (x86 and x64)

Windows 8 (x86 and x64)

Windows Server 2008 R2 (x64)

Windows Server 2012 (x64)

Symptom and inference:

Download LightSwitch Extensibility Toolkit for Visual Studio 2012 from http://visualstudiogallery.msdn.microsoft.com/2381b03b-5c71-4847-a58e-5cfa48d418dc and launch the installation via the , ideally by extracting the Microsoft.LightSwitch.Toolkit.exe file and launching the Microsoft.LightSwitch.Toolkit.vsix file-

clip_image001

The installation might fail within a couple of minutes from the launch with the following screen-

clip_image002

The above error message is indeed generic and does not really tell you about the exact point of failure.

However, if you take a look at the detailed log under the  %temp% folder (start >> run >> %temp%), it will provide you with the required details. Sample excerpt-

-------------------------------------------------------------------------------------------------------------------

03-Sep-13 11:33:40 PM - Beginning to install extension to Microsoft Visual Studio Ultimate 2012...

03-Sep-13 11:33:40 PM - Install Error : Microsoft.VisualStudio.ExtensionManager.MissingReferencesException: This extension cannot be installed because the following references are missing:

- Microsoft Visual Studio SDK

   at Microsoft.VisualStudio.ExtensionManager.ExtensionManagerService.CheckForInstallBlockers(InstallableExtensionImpl extension, IInstalledExtensionList modifiedInstalledExtensionsList, Boolean isNestedExtension, Boolean& olderVersionInstalled)

   at Microsoft.VisualStudio.ExtensionManager.ExtensionManagerService.InstallInternal(InstallableExtensionImpl extension, Boolean perMachine, Boolean isNestedExtension, IDictionary`2 extensionsInstalledSoFar, List`1 extensionsUninstalledSoFar, IInstalledExtensionList modifiedInstalledExtensionsList, AsyncOperation asyncOp, UInt64 totalBytesToWrite, UInt64& totalBytesWritten)

   at Microsoft.VisualStudio.ExtensionManager.ExtensionManagerService.BeginInstall(IInstallableExtension installableExtension, Boolean perMachine, AsyncOperation asyncOp)

   at Microsoft.VisualStudio.ExtensionManager.ExtensionManagerService.InstallWorker(IInstallableExtension extension, Boolean perMachine, AsyncOperation asyncOp)

-------------------------------------------------------------------------------------------------------------------

Resolution:

As is now apparent from the log above, you need to have Microsoft Visual Studio 2012 SDK installed. You can get this installed from: http://www.microsoft.com/en-in/download/details.aspx?id=30668

Once this is done, you can re-launch the setup for the extension and this time it should run through successfully.

--

Content by: Ritwik Sinha

Installation of Silverlight fails without any specific error message

$
0
0

ISSUE DESCRIPTION:

Installation of Silverlight from http://www.microsoft.com/getsilverlight or http://www.silverlight.net/downloads fails without any specific error message

ENVIRONMENT:

Windows 7 SP1 (x86 and x64)

Windows 8 (x86 and x64)

Windows Server 2008 R2 (x64)

Windows Server 2012 (x64)

SYMPTOM AND INFERENCE:

The installation of Silverlight may fail with the installation failed dialog box-

clip_image002

Unfortunately this is all the information provided by this screen!

To get more details on this failure, enable verbose logging on the machine as per http://support.microsoft.com/kb/223300 and rerun the setup of Silverlight. The verbose log will be formed at-

%userprofile%\AppData\Local\Temp\SilverlightMSI.log

You will find lines similar to excerpt below-

-------------------------------------------------------------------------------------------------------------------

MSI (s) (68:64) [01:01:49:567]: Product: Microsoft Silverlight -- Error 1303. The installer has insufficient privileges to access this directory: C:\Program Files (x86)\Microsoft Silverlight\5.1.20913.0.  The installation cannot continue.  Log on as administrator or contact your system administrator.

MSI (s) (68:64) [01:01:49:578]: Note: 1: 2265 2:  3: -2147287035

MSI (s) (68:64) [01:01:49:579]: User policy value 'DisableRollback' is 0

MSI (s) (68:64) [01:01:49:579]: Machine policy value 'DisableRollback' is 0

Action ended 1:01:49: InstallFinalize. Return value 3.

-------------------------------------------------------------------------------------------------------------------

When we wanted to check the permissions on the folder name found in the log we see a message, “You must have Read permissions to view the properties of this object” -

clip_image003

It is interesting to note that this can occur even for users who have been added to the administrator group.

RESOLUTION:

To resolve the issue, you can add ‘full control’ permissions to this folder manually, for the logged in user. In fact it is a good idea to remove this folder altogether once you have added the required permissions, allowing the new setup to recreate the required folder.

In case it is not possible to add permissions at this location for the logged in user, you will need to contact an administrator who can either provide you with the required permissions, or who can run this installation from his account (when the Silverlight installation is run from an administrator account, then it gets installed as per-machine).

Content by: Ritwik Sinha

XBAP:Reference in the manifest does not match the identity of the downloaded assembly

$
0
0

Any ClickOnce (browser based XBAP) Application fails on x86 operating systems with the below error message:

An exception occurred while downloading the application. Following failure messages were detected:    
  + Reference in the manifest does not match the identity of the downloaded assembly WpfBrowserApplication1.exe.

- Stack trace:    
   at System.Deployment.Application.DownloadManager.ProcessDownloadedFile(Object sender, DownloadEventArgs e)     
   at System.Deployment.Application.FileDownloader.DownloadModifiedEventHandler.Invoke(Object sender, DownloadEventArgs e)     
   at System.Deployment.Application.FileDownloader.OnModified()     
   at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)     
   at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()     
   at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)     
   at System.Deployment.Application.DownloadManager.DownloadDependencies(SubscriptionState subState, AssemblyManifest deployManifest, AssemblyManifest appManifest, Uri sourceUriBase, String targetDirectory, String group, IDownloadNotification notification, DownloadOptions options)     
   at System.Deployment.Application.DeploymentManager.SynchronizeCore(Boolean blocking)     
   at System.Deployment.Application.DeploymentManager.SynchronizeAsyncWorker()

I have already posted an another blog post on the same issue but it is applicable for a different scenario. The current issue does not occur on X64 OSs. Even, I created an exact similar sample XBAP application on my system and compared the application and deployment manifest files to check if there is any mismatch identity. But there was no mismatch. Hence, I reviewed the repro package using Visual Studio IDE and identified the root cause. The summary is mentioned below:

The repro CSPROJ file (WpfBrowserApplication.csproj) has an invalid entry, which generates binary that is not supported.

Here is the entry:   <Prefer32Bit>true</Prefer32Bit>

If you create a new project and select .Net 4.0 as target, you will notice in project properties that a check box “Prefer 32-bit”, on the build tab, is greyed out – not selectable. It seems that the CSPROJ file was modified outside of VS and this flag was set inappropriately..

As per the MSDN doc, this Prefer32-bit check box is available only if all of the following conditions are true:

•On the Compile Page, the Target CPU list is set to Any CPU.    
•On the Application Page, the Application type list specifies that the project is an application.     
•On the Application Page, the Target framework list specifies the .NET Framework 4.5.

So the summary is that the Prefer32-bit check box shouldn’t be selected for building .net framework 4.0 applications as it is designed for .net framework 4.5. The resolution would be to manually edit the csproj file and remove all entries of "<Prefer32Bit>true</Prefer32Bit>" element or change its value to false like <Prefer32Bit>false</Prefer32Bit>     

Note: If the Prefer32-bit check box is selected, the application runs as a 32-bit application on both 32-bit and 64-bit versions of Windows. Otherwise, the application runs as a 32-bit application on 32-bit versions of Windows and as a 64-bit application on 64-bit versions of Windows.

Running as a 64-bit application doubles the pointer size, and it can cause compatibility problems with libraries that are exclusively 32-bit. It makes sense to run an application as 64-bit only if it runs significantly faster or needs more than 4 GB of memory


Installation of Bootstrapper Package may fail with the error: ‘Setup has detected that the file X has either changed since it was initially published or may be corrupt.’

$
0
0

Issue: Installation ofBootstrapper Package (setup package or ClickOnce package along with the pre-requisite(s)) created using the Visual 2010 or Visual Studio 2012 RTM may fail with the error:  ‘Setup has detected that the file X has either changed since it was initially published or may be corrupt.’.


clip_image002

Cause

In my case, the issue started appearing on a machine where .NET Framework 4.5 was installed and Setup project was created using Visual Studio 2010.
When you publish any prerequisite bootstrapper the first thing we try to use is the bootstrapper packages certificate. If the package is not signed then we fall back on a hash of the bootstrapper to verify the integrity of the file being downloaded (This is why there is no issue when the bootstrapper package is signed).
In VS 2012 RTM we switched the hash calculation mechanism to SHA256 as its a more secure standard. Unfortunately we only did this during the msbuild package generation step. At runtime when the bootstrapper package was downloaded it would still try to create a SHA1 hash of the package it downloaded and compare it to the SHA256 hash generated during build which would never work.

At runtime when the bootstrapper package was downloaded it will still try to create a SHA1 hash of the package and compare it to the SHA256 hash generated during build which gave the error message “Setup has detected that the publisher of file cannot be verified”.

Resolution

As described earlier, it wasn’t an issue with the VS 2010. In fact it is with .NET Framework 4.5/ Visual Studio 2012. This issue has been fixed with VS 2012 Update 2, where the runtime component (setup.bin) is updated to correctly calculate SHA1/SHA256 hashes of the file being downloaded for comparison to the hash generated during build. So if you are using the Visual Studio 2012 RTM then please upgrade it to latest update.  

So why do we get the error with Visual Studio 2010?

Setup project created using the visual studio 2010 on a machine that have .NET Framework 4.5 uses MSBuild task from .NET Framework 4.5 , which in turn creates SHA256 hash for the bootstrapper package.
The runtime bootstrapper component in VS 2010 isn’t able to calculate this SHA256 hash correctly on the downloaded bootstrapper package.

The workaround to fix this issue is to replace the VS2010 Bootstrapper runtime component with the one from VS2012 Update 2 which is capable of handling the SHA256 hash -

To get the VS 2012 Update 2 bootstrapper engine copy the file from the location -

"%ProgramFiles(x86)%"Microsoft SDKs\Windows\v8.1A\Bootstrapper\Engine\setup.bin

(v8.1A - VS2012) and replace the VS 2010 bootstrapper engine at -

"%ProgramFiles(x86)%"\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Engine\setup.bin

(v7.0A - VS2010. You may want to keep a backup copy of this file just in case).

Also ref http://connect.microsoft.com/VisualStudio/feedback/details/758814

Content by: Keshav Deo Jain

Opening a CSS file in Visual Studio 2010 may throw error ‘The operation could not be completed. Unspecified error.’

$
0
0

ISSUE DESCRIPTION:

Trying to open a CSS file in Visual Studio 2010 shows error ‘The operation could not be completed. Unspecified error.’

WHAT IS CSS?

A cascading style sheet (CSS) contains style rules that are applied to elements in a Web page. CSS styles define how elements are displayed and where they are positioned on the page. Instead of assigning attributes to each element on your page individually, you can create a general rule that applies attributes whenever a Web browser encounters an instance of an element or an element that is assigned to a certain style class.

ENVIRONMENT:

All OS versions supporting VS2010

SYMPTOM AND INFERENCE:

Trying to open a CSS file from an existing project may can throw up the below error.

clip_image001

What might add to the confusion is that the same instance of Visual Studio 2010 may be able to open certain CSS files, and show the above error for others!

The underlying cause is that while you may have installed the service pack, and installed all the required updates, Visual Studio still does not support CSS above version 2.1. This is evident from the below dropdown-

clip_image002

RESOLUTION:

The resolution is to add the supportability for CSS version 3 as below-

1. Launch Visual Studio 2010

2. Click on ‘Tools’

3. Click on ‘Extension Manager…

4. Under ‘Online Gallery’ search for

"Web Standards Update for Microsoft Visual Studio 2010 sp1"

clip_image004

5. Download the update

6. Exit from Visual Studio 2010

7. Re-launch Visual Studio 2010

Further once this is done you can also notice the addition of the next version in the dropdown as illustrated below-

image

MORE ON CSS3!

Content By: Ritwik Sinha

Unrecognized configuration section appSettings

$
0
0

Problem description: A 64bit managed .Net service crashes with an exception "Configuration system failed to initialize" on a Win7 X64 OS.

I launched the App.exe in the debugger(http://msdn.microsoft.com/en-us/windows/hardware/gg463009) and took a crash dump http://support.microsoft.com/kb/286350 You may also run the following command: cscript adplus.vbs -crash –sc "<Path>App.exe"

After analyzing the crash dump, I found the below information:

0:000> |
.  0 id: 1f920 examine name: C:\Program Files\xxxxxxx\App.exe

0:000> kL100
Child-SP          RetAddr           Call Site
00000000`001aab20 000007fe`e6c3001f KERNELBASE!RaiseException+0x39
00000000`001aabf0 000007fe`e70d8ef5 mscorwks!RaiseTheExceptionInternalOnly+0x2ff
00000000`001aace0 000007fe`da68dedc mscorwks!JIT_Rethrow+0xe5
00000000`001aae80 000007fe`e6b75a21 System_Configuration_ni!System.Configuration.ClientConfigurationSystem.EnsureInit(System.String)+0x33c
00000000`001aaee0 000007fe`e6b5ba9a mscorwks!ExceptionTracker::CallHandler+0x145
00000000`001aafe0 000007fe`e6bef7db mscorwks!ExceptionTracker::CallCatchHandler+0x9e
00000000`001ab070 00000000`77109dad mscorwks!ProcessCLRException+0x2ab
00000000`001ab110 00000000`770f8a4c ntdll!zzz_AsmCodeRange_End
00000000`001ab140 000007fe`e6c6d246 ntdll!RtlUnwindEx+0x539
00000000`001ab7e0 000007fe`e6bef787 mscorwks!ClrUnwindEx+0x36
00000000`001abcf0 00000000`77109d2d mscorwks!ProcessCLRException+0x257
00000000`001abd90 00000000`770f91cf ntdll!RtlpExecuteHandlerForException+0xd
00000000`001abdc0 00000000`77131248 ntdll!RtlDispatchException+0x45a
00000000`001ac4a0 000007fe`fd39940d ntdll!KiUserExceptionDispatch+0x2e
00000000`001aca60 000007fe`e6c3001f KERNELBASE!RaiseException+0x39
00000000`001acb30 000007fe`e7162380 mscorwks!RaiseTheExceptionInternalOnly+0x2ff
00000000`001acc20 000007fe`da68dded mscorwks!JIT_Throw+0x130
00000000`001acdd0 000007fe`e6b75a21 System_Configuration_ni!System.Configuration.ClientConfigurationSystem.EnsureInit(System.String)+0x24d
00000000`001ace30 000007fe`e6b5ba9a mscorwks!ExceptionTracker::CallHandler+0x145
00000000`001acf30 000007fe`e6bef7db mscorwks!ExceptionTracker::CallCatchHandler+0x9e
00000000`001acfc0 00000000`77109dad mscorwks!ProcessCLRException+0x2ab
00000000`001ad060 00000000`770f8a4c ntdll!zzz_AsmCodeRange_End
00000000`001ad090 000007fe`e6c6d246 ntdll!RtlUnwindEx+0x539
00000000`001ad730 000007fe`e6bef787 mscorwks!ClrUnwindEx+0x36
00000000`001adc40 00000000`77109d2d mscorwks!ProcessCLRException+0x257
00000000`001adce0 00000000`770f91cf ntdll!RtlpExecuteHandlerForException+0xd
00000000`001add10 00000000`77131248 ntdll!RtlDispatchException+0x45a
00000000`001ae3f0 000007fe`fd39940d ntdll!KiUserExceptionDispatch+0x2e
00000000`001ae9b0 000007fe`e6c3001f KERNELBASE!RaiseException+0x39
00000000`001aea80 000007fe`e7162380 mscorwks!RaiseTheExceptionInternalOnly+0x2ff
00000000`001aeb70 000007fe`da76eb46 mscorwks!JIT_Throw+0x130
00000000`001aed20 000007fe`da690ae9 System_Configuration_ni!System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean)+0xce8e6
00000000`001aed60 000007fe`da68dd2c System_Configuration_ni!System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors()+0x39
00000000`001aeda0 000007fe`da690698 System_Configuration_ni!System.Configuration.ClientConfigurationSystem.EnsureInit(System.String)+0x18c
00000000`001aee20 000007fe`da6905f7 System_Configuration_ni!System.Configuration.ClientConfigurationSystem.PrepareClientConfigSystem(System.String)+0x28
00000000`001aee50 000007fe`da6a3ba4 System_Configuration_ni!System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(System.String)+0x17
00000000`001aee90 000007fe`da697ee6 System_Configuration_ni!System.Configuration.ConfigurationManager.GetSection(System.String)+0x94
00000000`001aeed0 000007fe`dfdd4222 System_Configuration_ni!System.Configuration.ConfigurationManager.get_AppSettings()+0x26
00000000`001aef10 000007fe`d16772fc CoreManagementService_ni!DoubleTake.Internal.Service.ManagementService.ReadApplicationSettings()+0x22
00000000`001aef60 000007fe`dfdd5e72 DoubleTake_Common_ni!DoubleTake.Common.Service.ServiceBase.Start(System.String[])+0x1c
00000000`001aefa0 000007fe`e6d1d432 CoreManagementService_ni!DoubleTake.Internal.Service.Program.Main(System.String[])+0x32
00000000`001aefe0 000007fe`e6c0b7a3 mscorwks!CallDescrWorker+0x82
00000000`001af030 000007fe`e70fa981 mscorwks!CallDescrWorkerWithHandler+0xd3
00000000`001af0d0 000007fe`e6c686db mscorwks!MethodDesc::CallDescr+0x2b1
00000000`001af310 000007fe`e6c8bd54 mscorwks!ClassLoader::RunMain+0x22b
00000000`001af570 000007fe`e71e6c9d mscorwks!Assembly::ExecuteMainMethod+0xbc
00000000`001af860 000007fe`e6c9929f mscorwks!SystemDomain::ExecuteMainMethod+0x47d
00000000`001afe30 000007fe`e6c7bfdc mscorwks!ExecuteEXE+0x47
00000000`001afe80 000007fe`f91974e5 mscorwks!_CorExeMain+0xac
00000000`001afee0 000007fe`f9235b21 mscoreei!_CorExeMain+0xe0
00000000`001aff30 00000000`76ed652d mscoree!_CorExeMain_Exported+0x57
00000000`001aff60 00000000`7710c541 kernel32!BaseThreadInitThunk+0xd
00000000`001aff90 00000000`00000000 ntdll!RtlUserThreadStart+0x1d

0:000> !pe
Exception object: 000000000245e1d8
Exception type: System.Configuration.ConfigurationErrorsException
Message: Configuration system failed to initialize
InnerException: System.Configuration.ConfigurationErrorsException
StackTrace (generated):
    SP               IP               Function
    00000000001ACDD0 000007FEDA68DEDD System.Configuration.ClientConfigurationSystem.EnsureInit(System.String)
    00000000001AEE20 000007FEDA690699 System.Configuration.ClientConfigurationSystem.PrepareClientConfigSystem(System.String)
    00000000001AEE50 000007FEDA6905F8 System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(System.String)
    00000000001AEE90 000007FEDA6A3BA5 System.Configuration.ConfigurationManager.GetSection(System.String)
    00000000001AEED0 000007FEDA697EE7 System.Configuration.ConfigurationManager.get_AppSettings()
    00000000001AEF10 000007FEDFDD4223 DoubleTake.Internal.Service.ManagementService.ReadApplicationSettings()
    00000000001AEF60 000007FED16772FD DoubleTake.Common.Service.ServiceBase.Start(System.String[])
    00000000001AEFA0 000007FEDFDD5E73 DoubleTake.Internal.Service.Program.Main(System.String[])

StackTraceString: <none>
HResult: 80131902
There are nested exceptions on this thread. Run with -nested for details

0:000> !do 000000000245e1d8
Name: System.Configuration.ConfigurationErrorsException
MethodTable: 000007feda6b3388
EEClass: 000007feda653e00
Size: 168(0xa8) bytes
GC Generation: 0
(C:\Windows\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll)
Fields:
              MT            Field           Offset                 Type VT             Attr            Value Name
000007fee5fb7d90  40000b5        8        System.String  0 instance                0 _className
000007fee5fb6138  40000b6       10 ...ection.MethodBase  0 instance                0 _exceptionMethod
000007fee5fb7d90  40000b7       18        System.String  0 instance                0 _exceptionMethodString
000007fee5fb7d90  40000b8       20        System.String  0 instance          245e168 _message
000007fee5faf3b0  40000b9       28 ...tions.IDictionary  0 instance                0 _data
000007fee5fb8058  40000ba       30     System.Exception  0 instance          245db98 _innerException
000007fee5fb7d90  40000bb       38        System.String  0 instance                0 _helpURL
000007fee5fb7680  40000bc       40        System.Object  0 instance          245e418 _stackTrace
000007fee5fb7d90  40000bd       48        System.String  0 instance                0 _stackTraceString
000007fee5fb7d90  40000be       50        System.String  0 instance                0 _remoteStackTraceString
000007fee5fbf000  40000bf       70         System.Int32  1 instance                0 _remoteStackIndex
000007fee5fb7680  40000c0       58        System.Object  0 instance                0 _dynamicMethods
000007fee5fbf000  40000c1       74         System.Int32  1 instance      -2146232062 _HResult
000007fee5fb7d90  40000c2       60        System.String  0 instance                0 _source
000007fee5fba798  40000c3       68        System.IntPtr  1 instance                0 _xptrs
000007fee5fbf000  40000c4       78         System.Int32  1 instance       -532459699 _xcode
000007fee5fb7d90  400315d       80        System.String  0 instance                0 _filename
000007fee5fbf000  400315e       7c         System.Int32  1 instance                0 _line
000007fee5fb7d90  4000254       88        System.String  0 instance                0 _firstFilename
000007fee5fbf000  4000255       98         System.Int32  1 instance                0 _firstLine
000007fee5fa5b80  4000256       90      System.Object[]  0 instance                0 _errors

0:000> !do 245db98
Name: System.Configuration.ConfigurationErrorsException
MethodTable: 000007feda6b3388
EEClass: 000007feda653e00
Size: 168(0xa8) bytes
GC Generation: 0
(C:\Windows\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll)
Fields:
              MT            Field           Offset                 Type VT             Attr            Value Name
000007fee5fb7d90  40000b5        8        System.String  0 instance                0 _className
000007fee5fb6138  40000b6       10 ...ection.MethodBase  0 instance                0 _exceptionMethod
000007fee5fb7d90  40000b7       18        System.String  0 instance                0 _exceptionMethodString
000007fee5fb7d90  40000b8       20        System.String  0 instance          245ab90 _message
000007fee5faf3b0  40000b9       28 ...tions.IDictionary  0 instance                0 _data
000007fee5fb8058  40000ba       30     System.Exception  0 instance                0 _innerException
000007fee5fb7d90  40000bb       38        System.String  0 instance                0 _helpURL
000007fee5fb7680  40000bc       40        System.Object  0 instance          245e038 _stackTrace
000007fee5fb7d90  40000bd       48        System.String  0 instance                0 _stackTraceString
000007fee5fb7d90  40000be       50        System.String  0 instance                0 _remoteStackTraceString
000007fee5fbf000  40000bf       70         System.Int32  1 instance                0 _remoteStackIndex
000007fee5fb7680  40000c0       58        System.Object  0 instance                0 _dynamicMethods
000007fee5fbf000  40000c1       74         System.Int32  1 instance      -2146232062 _HResult
000007fee5fb7d90  40000c2       60        System.String  0 instance                0 _source
000007fee5fba798  40000c3       68        System.IntPtr  1 instance                0 _xptrs
000007fee5fbf000  40000c4       78         System.Int32  1 instance       -532459699 _xcode
000007fee5fb7d90  400315d       80        System.String  0 instance                0 _filename
000007fee5fbf000  400315e       7c         System.Int32  1 instance                0 _line
000007fee5fb7d90  4000254       88        System.String  0 instance          244aa40 _firstFilename
000007fee5fbf000  4000255       98         System.Int32  1 instance                3 _firstLine
000007fee5fa5b80  4000256       90      System.Object[]  0 instance          245df38 _errors

0:000> !do 245ab90
Name: System.String
MethodTable: 000007fee5fb7d90
EEClass: 000007fee5bbe560
Size: 120(0x78) bytes
GC Generation: 0
(C:\Windows\assembly\GAC_64\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll)
String: Unrecognized configuration section appSettings.
Fields:
              MT            Field           Offset                 Type VT             Attr            Value Name
000007fee5fbf000  4000096        8         System.Int32  1 instance               48 m_arrayLength
000007fee5fbf000  4000097        c         System.Int32  1 instance               47 m_stringLength
000007fee5fb97d8  4000098       10          System.Char  1 instance               55 m_firstChar
000007fee5fb7d90  4000099       20        System.String  0   shared           static Empty
                                 >> Domain:Value  00000000003f2d10:00000000023a1308 <<
000007fee5fb9688  400009a       28        System.Char[]  0   shared           static WhitespaceChars
                                 >> Domain:Value  00000000003f2d10:00000000023a1b10 <<

It indicates that appSettings section in C:\Windows\Microsoft.NET\Framework64\v2.0.50727\CONFIG\machine.config file has an invalid entry. Hence, the solution would be to compare the appSettings section in machine.config file on a working  system. It should be like this:

--><configuration>
<configSections>
  <section name="appSettings" type="System.Configuration.AppSettingsSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" restartOnExternalChanges="false" requirePermission="false"/>

Sometime, you may also find that machine.config itself is missing on the system. In that scenario, copy the machine.config file from a working system(similar configuration) as the .NET Framework 2.0 is included as an OS component (Windows Vista, Windows Server 2008, Windows 7 and above OSs).

delegating uninstallation of assembly file : *** to Fusion

$
0
0

Summary: I created a MSI package which has Merge Module - Microsoft_VC90_DebugCRT_x86.msm. I was able to install the MSI package successfully on my WIN 7 OS. Then I uninstalled the same MSI successfully but the file msvcr90d.dll was NOT removed from the directory: C:\windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_2a4f639a55563668\

But if I keep the system idle for few minutes, the file gets removed automatically. I took a procmon trace after the MSI uninstall and found that the file msvcr90d.dll was deleted by C:\windows\servicing\TrustedInstaller.exe

As per the MSI uninstall log:
MSI (s) (E4:50) [12:27:46:952]: Executing op: ActionStart(Name=RemoveFiles,Description=Removing files,Template=File: [1], Directory: [9])
MSI (s) (E4:50) [12:27:46:955]: Executing op: ProgressTotal(Total=22,Type=1,ByteEquivalent=175000)
MSI (s) (E4:50) [12:27:46:956]: Executing op: SetTargetFolder(Folder=C:\windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_2a4f639a55563668\)
MSI (s) (E4:50) [12:27:46:957]: Executing op: FileRemove(,FileName=msvcr90d.dll,,ComponentId={F5DEC4D5-A8A3-3883-B311-C6227A0D21AD})
MSI (s) (E4:50) [12:27:46:967]: delegating uninstallation of assembly file : msvcr90d.dll to Fusion

As per the procmon trace:
TrustedInstaller.exe         3336       QueryDirectory                         C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_2a4f639a55563668                    SUCCESS              0: msvcr90d.dll
TrustedInstaller.exe      3336       SetDispositionInformationFile   C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_2a4f639a55563668                    SUCCESS              Delete: =True

As far as Windows Installer is concerned it did the right thing. MSI doesn’t remove the file itself. Instead it calls into the fusion asking it to uninstall the assembly. The above lines mean that we have marked the assembly as removable from MSI's viewpoint and asked fusion to remove the file when the transaction is completed and changes committed to the machine. It means that the fusion didn’t delete the file when requested as the component store performs lazy cleanup to speed up uninstall.  This is by design and the concept is called “scavenging”.  The key point is that even the binary file (msvcr90d.dll) is still present after uninstall, it isn’t available for binding by other applications. So there wouldn’t be any impact due to this behavior. For more information on Scavenging, please go through this blog post .  [the directory may hold on to recently-installed or soon-to-be-installed files until they are installed or scavenged in bulk. Scavenging happens periodically, but it cannot be controlled or induced. It is important to note then, that uninstalling a Side-by-Side assembly may not immediately remove the associated files from the WinSxS directory. This is expected, and not a violation of Windows Logo requirements for clean uninstall.]

You can observe that the binaries are indeed uninstalled, even before they are scavenged, by checking for install state with the tool checkruntimes.exe: http://blogs.msdn.com/b/talagrand/archive/2010/03/02/9973115.aspx

Once the MSI is uninstalled successfully, we found that the file msvcr90d.dll was not removed physically from C:\windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_2a4f639a55563668\  but you can run the below command to know the actual install state of the binary:

After the MSI package is installed

C:\Users\Administrator>C:\checkruntimes\checkruntimes.exe -x86 -crt -9
DebugCRT    x86   v9.0.30729.6161 is installed

     CRT    x86   v9.0.30729.4940 is installed

After the MSI package is uninstalled

C:\Users\Administrator>C:\checkruntimes\checkruntimes.exe -x86 -crt -9
     CRT   
x86   v9.0.30729.4940 is installed

The binary msvcr90d.dll is not listed above.

#When called with no arguments, it lists runtimes it can find – calling checkruntimes.exe with no arguments is equivalent to calling:  checkruntimes.exe -8 -9 -10 -debug -retail -x86 -x64 -ia64 -crt -atl -openmp -mfc

Installation of a ClickOnce application failing with an error pointing to a wrong deployment URL.

$
0
0

ISSUE DESCRIPTION AND SYMPTOM:

Installation of a ClickOnce application could fail with the error message referencing a URL different from the one from the one with which the installation was executed.

Here is the error message that you could see-
An error occurred trying to download 'http://<Server>/WindowsFormsApplication2.application'.

clip_image001

The setup log gets created at a location similar to the following- 'C:\Users\<username>\AppData\Local\Temp\VSDF22.tmp\install.log'

We checked the logs for more information: Here’s a line from the log showing the failure-
URLDownloadToCacheFile failed with HRESULT '-2146697208'
Error: An error occurred trying to download 'http://server/WindowsFormsApplication2.application'.

INFERENCE AND RESOLUTION:

In this scenario, we were publishing the application to an IIS web site hosted on a test server, and then the ClickOnce manifest was copied over to a production IIS server from test server. The manifests were copied under the IIS virtual directory without any modification.
For instance, while publishing the application on test server, we specified the site URL as http://test:80/publish. Later, the files are copied to a production machine and the site URL is: http://prod:80/publish.
Now when the user tries to install the ClickOnce application using the production URL, the SETUP.EXE tries to download manifests from http://test:80/publish, instead of going to http://prod:80/publish.
Actually while publishing the ClickOnce manifest, the path which is specified under the ‘Publishing folder location’ in Visual Studio, gets embedded to SETUP.EXE; so when SETUP.EXE gets executed it will try to download ClickOnce manifests from the location which is embedded in it.

There is a very simple way that is provided to change the old URL to a new one.
To change the default URL in SETUP.EXE, the following command needs to be run:

setup.exe /URL=http://< Production  URL>/
Once this was modified the application was installed successfully from the production server and it worked correctly.

Content by: Keshav Deo Jain

New User Logon Failing with error “User profile cannot be loaded” After Installing Visual Studio 2013

$
0
0

ISSUE DESCRIPTION and SYMPTOM:

New user logon may fail on a machine where Visual Studio 2013 has been installed in system context.

When such a user tries to log on to this machine for the first time, his logon could fail with this error message-

clip_image001

Once you log onto the machine (You might want to do this with one of the user accounts that you have been using i.e. for one of the accounts which already has a profile on the machine, or let the system provide you with a temporary one), you will also notice these event viewer errors-

clip_image003

clip_image004

clip_image006

The third Event viewer screen might look unrelated , but in fact this tells you about the underlying cause for this unexpected behavior.

If you actually go to this location and check for the permissions, you can expect to see-

clip_image008

CAUSE AND RESOLUTION:

When VS 2013 setup is run it calls devenv.exe (with /setup switch). Due to that the no-opt session SQM file is written which is new in VS2013. But the file is ACL'd to the running user. So when installation is done under SYSTEM account (which is sometimes the case when customers use Microsoft SCCM to install VS) it creates problems for standard Windows user logon because during installation the SQM file is created in 'Default' user and on user logon Windows fails to copy it from Default to the profile dir of logging in user due to ACLs.

SQM is Software Quality Metrics. When you choose to participate in the Customer Experience Improvement Program (CEIP), your computer or device automatically sends information to Microsoft about how you use certain products. Information from your computer or device is combined with other CEIP data to help Microsoft solve problems and to improve the products and features customers use most often. CEIP data is stored in files that have a .sqm file name extension.

The fix prescribed is to not write any (global or multi-session) SQM file when devenv.exe is running with /setup switch. We wrote a new method to inspect the command line for /setup switch and we used that to skip the call to SqmEndSession API. (Tested by patching the DLL, running devenv.exe under /setup switch and stepping through code. Observed that the SqmEndSession call is skipped and SQM file is not written.)

This has now been fixed in the new release of ‘Visual Studio 2013 with Update 2’, and it is recommended to use this package.

Here are the download links to these slipstreamed packages-

· Visual Studio Premium 2013

· Visual Studio Professional 2013

· Visual Studio Ultimate 2013

· Visual Studio Express 2013

More details at Description of Visual Studio 2013 Update 2

Content By: Ritwik Sinha

Installation failing with “A newer version of Microsoft Visual C++ 2010 Redistributable has been detected on this machine”

$
0
0

ISSUE DESCRIPTION:

Installation of Visual C++ 2010 or software that installs a version of VC++ 2010 runtime might fail saying that a newer version is already installed. Or it might be the installation of a different software that has this runtime added as a prerequisite. It is common for applications developed with the corresponding VC++ version to require VC++ redistributable. These packages include C Runtime (CRT), Standard C++, ATL, MFC, OpenMP and MSDIA libraries.

SYMPTOM AND INFERENCE:

The installation might show an error similar to-

"A newer version of Microsoft Visual C++ 2010 Redistributable has been detected on this machine"

While the more common and indeed logical underlying cause would be the actual presence of a higher version of the runtime on the machine in installed state, the issue might occur even if VC++ is currently not installed on the machine (but had been installed at some point of time in the past).  Essentially there currently exist some remains of the installation of Visual C++ in terms of registry references that is causing this unexpected behavior.

RESOLUTION:

The first thing you want to do is to go to ‘Programs and Features’ and look for the presence of a runtime of later version, and uninstall it, if found. Do note that different VC++ runtimes do not interfere with each other:  for instance, the presence of VC++ 2010 will not hinder the installation of VC++ 2008. Once this has been looked into and the installation is still failing, you need to examine the logs.

To get more details on this failure, you can enable verbose logging on the machine as per http://support.microsoft.com/kb/223300 and rerun the setup of the product showing the installation.

To save time and avoid ambiguity you might want to directly download and run installation of the particular runtime that is failing. 

The verbose log will be formed at-

‘%LOCALAPPDATA%\temp’

named similar to

‘Microsoft Visual C++ 2010 x86 Redistributable Setup_20140710_094400154.html’

clip_image001Sample Log Excerpt

BlockIf: A newer version of Microsoft Visual C++ 2010 Redistributable has been detected on the machine....
[7/10/2014, 9:44:0]A newer version of Microsoft Visual C++ 2010 Redistributable has been detected on the machine.
[7/10/2014, 9:44:0]evaluating BlockIf:

[7/10/2014, 9:44:0] And: evaluating...
[7/10/2014, 9:44:0] Equals: evaluating...
[7/10/2014, 9:44:0]Current Operation value is Installing

[7/10/2014, 9:44:0] Equals evaluated to true

[7/10/2014, 9:44:0] LessThan: evaluating...
[7/10/2014, 9:44:0]RegKeyValue: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x86\Bld contains '40219'
[7/10/2014, 9:44:0]all numeric characters - canonicalizing

[7/10/2014, 9:44:0] LessThan evaluated to true

[7/10/2014, 9:44:0] And evaluated to true

[7/10/2014, 9:44:0] BlockIf evaluated to true

Note the highlighted line above (and in the snapshot below) indicating the registry that is responsible for a newer version (40219) getting detected. You need to go to the registry editor and rename or delete this registry key (x86).

clip_image002

The installation should now go through.

Caution: Incorrectly editing the Registry can cause serious problems that may require you to reinstall your operating system. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs.

 

Content by: Ritwik Sinha


Error 997. Overlapped I/O operation is in progress: KB2918614 breaks Windows Installer Service

$
0
0

Certain MSI packages may fail with an error "Error 997. Overlapped I/O operation is in progress"

As per the MSI log:

MSI (s) (44:48) [15:07:21:799]: Determining source type
MSI (s) (44:48) [15:07:21:799]: Source type from package 'My_Package.msi': 2
MSI (s) (44:48) [15:07:21:799]: SECREPAIR: Hash Database:
C:\Windows\Installer\SourceHash{AC1B6088-A6FC-9CDA-ABF2-60530F5DA203}
MSI (s) (44:48) [15:07:21:799]: Note: 1: 2262 2: SourceHash 3: -2147287038
MSI (s) (44:48) [15:07:21:815]: SECREPAIR: New Hash Database creation complete.
MSI (s) (44:48) [15:07:21:815]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (44:48) [15:07:21:815]: SECREPAIR: Crypt Provider not initialized. Error:997
MSI (s) (44:48) [15:07:21:815]: SECUREREPAIR: Failed to CreateContentHash of the file:
My_Package.msi: for computing its hash. Error: 997 MSI (s) (44:48)
[15:07:21:815]: SECREPAIR: Failed to create hash for the install source files
MSI (s) (44:48) [15:07:21:815]: Note: 1: 2262 2: SourceHash 3: -2147287038
MSI (s) (44:48) [15:07:21:815]: SECUREREPAIR: SecureRepair Failed. Error code: 3e5E99334B8
MSI (c) (A0:8C) [15:07:21:877]: Font created.  Charset: Req=0, Ret=0, Font: Req=MS Shell Dlg, Ret=MS Shell Dlg
Error 997. Overlapped I/O operation is in progress.
MSI (s) (44:48) [15:07:30:769]: Note: 1: 2205 2:  3: Error
MSI (s) (44:48) [15:07:30:769]: Note: 1: 2228 2:  3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 1709

As per the application Event log:

Log Name:   Application
Source:        MsiInstaller
Date:            2014-09-05 15:07:30
Event ID:      10997
Task Category: None
Level:             Error
Keywords:      Classic
User:              S-1-5-21-1655003508-46252071-1983596133-179088
Computer:      My_Machine

Description:
The description for Event ID 10997 from source MsiInstaller cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer. 

If the event originated on another computer, the display information had to be saved with the event. The following information was included with the event:
Product: My_Package 1.0.0.1 -- Error 997. Overlapped I/O operation is in progress.

This is a known issue with the security patchKB2918614released on 12th August. This issue occurs because update 2918614 uses cryptographic keys and certificates for hashing the installation files together with the logged-in user profile. However, cryptographic keys and certificates cannot be used by mandatory or temporary user profiles. Therefore, when a user uses a mandatory or temporary user profile to install any MSI package, the MSI package installation fails and the error message returns.

Resolution: Please apply this hotfix

P.S. An official fix is in testing and being tracked for release in November patch Tuesday(14-11). There could be some changes due to unexpected events.

Error 26403.Failed to add user to group

$
0
0

Visual Studio 2013 unattended installation fails on Win8.1/8.0 OSs when deployed via SCCM 2012. As per the MSI log (dd_vs_professional_XXXXX_XX_vs_professionalcore.log):

MSI (s) (00:80) [17:04:35:024]: Executing op: ActionStart(Name=CreateUser,,)
MSI (s) (00:80) [17:04:35:024]: Executing op: CustomActionSchedule(Action=CreateUser,ActionType=11265,Source=BinaryData,Target=**********,CustomActionData=**********)
MSI (s) (00:14) [17:04:35:071]: Invoking remote custom action. DLL: C:\Windows\Installer\MSID2F7.tmp, Entrypoint: CreateUser
CreateUser:  Entering CreateUser in C:\Windows\Installer\MSID2F7.tmp, version 3.7.1701.0
CreateUser:  Failed to add user: SYSTEM, domain Test to group: Performance Log Users, domain:  with error 0x8007056b.  Attempting to use Active Directory
CreateUser:  Error 0x80005000: Failed to add user Test/SYSTEM to group 'WinNT://Localhost/Performance Log Users'.
CreateUser:  Error 0x80005000: failed to add user: SYSTEM to group Performance Log Users

Error 26403.Failed to add user to group.  (-2147463168   SYSTEM   Performance Log Users   )
MSI (s) (00!28) [17:04:35:430]: Product: Microsoft Visual Studio Professional 2013 -- Error 26403.Failed to add user to group.  (-2147463168   SYSTEM  
Performance Log Users   )

CustomAction CreateUser returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)

Here, the CustomAction "CreateUser" fails while trying to add the SYSTEM user in the DOMAIN context to the Performance Log Users group. This is a known issue and this is fixed in Visual Studio Update 2. With VS 2013 Update 2 we introduced Slipstream which is Visual Studio and the Updates 1 + 2 into the same installation. Full VS 2013 Update packages Slipstreamed and non-Slipstreamed (Pro/Prem/Ult) are not released to Volume Licensing Service.

In order to resolve this issue,  download Trial version of Microsoft Visual Studio Ultimate 2013 with Update 3  and install it using the command:  “vs_<VERSION>.exe /q /norestart /ProductKey <25CHARKEY>”

Since the downloads of Slipstream on Download Center and MSDN are trial versions only and will require a product key after 30 days, the customer can use the VL product key provided to them in the “Download” section of Visual Studio 2013 in Volume Licensing Service (called “Setup Key”) with the Slipstream product they are nstalling. The command “vs_<VERSION>.exe /q /norestart /ProductKey <VOLUMELICENSE_25CHARKEY>” allows them to do an unattended install and insert their product key upon install to avoid having to enter it after the trial period expires. More information on using command-line parameters on install can be found here.

The setup cannot run in compatibility mode

$
0
0

The Microsoft .Net Framework 4.5.2 Setup may fail with the below error message:

Capture

As per the install log:

Installation Blockers:

1.The setup cannot run in compatibility mode.
2.The .NET Framework 4.5.2 is not supported on this operating system.


I ran the process monitor tool and captured a trace for the Setup. As per the trace, I found that an OS app compat shim has been applied on the system.

=============================================================================================================

11:18:13.3061686 PM NDP452-KB2901907-x86-x64-AllOS-ENU.exe 5296 RegOpenKey HKLM\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Custom\Setup.exe SUCCESS Desired Access:
11:18:13.3062049 PM NDP452-KB2901907-x86-x64-AllOS-ENU.exe 5296 RegSetInfoKey HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Custom\setup.exe SUCCESS KeySetInformationClass: KeySetHandleTagsInformation, Length: 0

11:18:13.3062807 PM NDP452-KB2901907-x86-x64-AllOS-ENU.exe 5296 RegEnumValue HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Custom\setup.exe SUCCESS Index: 0, Name: {a266674f-8a16-4a84-97c9-088a46e530d7}.sdb, Type: REG_QWORD, Length: 8 

11:18:13.3063232 PM NDP452-KB2901907-x86-x64-AllOS-ENU.exe 5296 RegCloseKey HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Custom\setup.exe SUCCESS =============================================================================================================

A shim is a small library which transparently intercepts an API, changes the parameters passed, handles the operation itself, or redirects the operation elsewhere. Shims can also be used for running programs on different software platforms than they were developed for.  For more details: https://technet.microsoft.com/en-us/library/dd837644(v=ws.10).aspx 

I renamed registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Custom\setup.exeand started the NetFx 4.5.2 Setup package. It was successful and the issue was resolved. 

 

P.S. Creating an Application Compatibility Shim: http://blogs.technet.com/b/askperf/archive/2011/06/17/demystifying-shims-or-using-the-app-compat-toolkit-to-make-your-old-stuff-work-with-your-new-stuff.aspx 
ACT is the Application Compatibility Toolkit http://www.microsoft.com/downloads/details.aspx?familyid=24da89e9-b581-47b0-b45e-492dd6da2971&displaylang=en

Installation of Visual C++ Redistributable 2005(X64) may fail with error code 2381

$
0
0

 

ISSUE DESCRIPTION AND SYMPTOM:

Installation ofVC Redistributable 2005(X64), a prerequisite for a third party backup software in our case, failed with an explicit error message-

“The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2381. The arguments are: H:\, ,

We could additionally see a similar error being logged under the event viewer(start >> run >> eventvwr) as follows:

Product: Microsoft Visual C++ 2005 Redistributable (x64) -- The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2381. The arguments are: H:\, ,

INFERENCE AND RESOLUTION:

As has been documented under http://msdn.microsoft.com/en-us/library/aa372835(v=vs.85).aspx, error code 2381 is mapped as the following-

2381

Directory does not exist: [2].

We could see from the error that it’s pointing to H:\. While it was possible to manually open the referenced location (H:\), checking its security tab out of curiosity showed that it was almost empty. We added permissions (in accordance with the standards followed for similar drives) We were however specific about the System account permissions, (as system account context will be used during install) Retried the Visual C++ 2005 Redistributable (x64) installer – it now succeeded. Once this was done, it was also possible to install the third party backup software for which this redistributable was a prerequisite

The above steps were part of a specific solution that applied to a particular machine; the recommended steps to resolve a similar issue (with wider applicability) are given below-

1. Open a CMD window (start  >> run >> CMD)

2. Extract the Visual C++ 2005 redistributable package manually onto an accessible local drive, using the /C and the /T switches

    Sample command-

    C:\temp\vcredist_x64.exe /C /T:“C:\temp\ext”

3. Run the .msi file (located under the extracted contents) to install the package

-Content by Vimal Thiagaraj

The imported project "C:\Program Files(x86)\MsBuild\Microsoft\WindowsXaml\v14.0\8.1\Microsoft.Windows.UI.Xaml.CSharp.targets" was not found

$
0
0

While trying to create any C# shared or Windows Phone projects using the Visual Studio 2015 IDE, you may receive an error message as highlighted below:

1

2

This is a known issue and it would be fixed in a future update. In order to resolve the issue, please follow the below two workaround:

Workaround 1: 

Please modify the CodeSharing targets. To do so, download the attached target file and replace the file "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\CodeSharing\Microsoft.CodeSharing.CSharp.targets" with it.

Alternatively, you can repair the target file manually: Open the file C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\CodeSharing\Microsoft.CodeSharing.CSharp.targets(or, for Visual Basic, Microsoft.CodeSharing.VisualBasic.targets)

Around line 8, you should see two entries:
<Import
Project="$(MSBuildExtensionsPath32)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets')"/>

<Import
Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" Condition="!Exists('$(MSBuildExtensionsPath32)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets')"
/> 
 
Replace these entries with the following:

<Import
Project="$(MSBuildExtensionsPath32)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets"
Condition="false"/>

<Import
Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" Condition="true"
/>

Workaround 2:

1. Open the VS 2015 IDE
2. Click on File->New->Project
3. Choose the only Project template under Windows 8 (below screenshot)
This will launch Visual Studio setup where you can install the templates that are missing.

3

4

5

Alternatively, you can install the below feature by changing the installed Visual Studio 2015 from the “Control Panel\Programs\Programs and Features”:

6

P.S.  For Windows 7 OS, the workaround 1 will be applicable only. It can also occur with Visual Basic shared projects.  Obviously the file to modify would be the VB one (Microsoft.CodeSharing.VisualBasic.targets)

Viewing all 75 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>