Showing posts with label Visual Studio 2010. Show all posts
Showing posts with label Visual Studio 2010. Show all posts

Friday, October 03, 2014

VS 2010: The key file may be password protected error When Building

Symptom:

  1. You pulled a fresh project (i.e., the porject you never had on your machine) from a source control such as Git
  2. You build it on Visual Studi 2010 (or even may be later version) and you get the following type of error and cannot proceed.
  3. You know you have the .PFX file in your project.

Error 1 Cannot import the following key file: XYZZY42.pfx. The key file may be password protected. To correct this, try to import the certificate again or manually install the certificate to the Strong Name CSP with the following key container name: VS_KEY_07B0CF4FE777D718

Root Cuase:


It just simply cannot locate the cached password (I don't know where it stores it.)Fix

If you do know the password and the fix is easy. If you don't know it might as well create another new pfix file of your own.

Steps to Fix:


1. Go to the Property of the Project

2. On the left panel, click Signing

3. Under "Choose a strong name key file" pull it down and select Browse, and select the same key file as indicated. This will prompt you the password and you should be all set to go.



Wednesday, January 30, 2013

Visual Studio Debugger Slow To Start Up Due To Symbol Loads

Symptom:

Suddenly when you are debugging your application the application startup on your Visual Studio begins to crawl down to 20-30 seconds or even longer, as it starts loading symbols from all over the places for Microsoft's .NET Framework library and GACs etc.

Possible (But May Not Be Exact) Cause:

You or someone in the team have accidentally enabled Symbol loading from All Modules.

Try If Above Applies

Try this to see if it makes any difference.

On your Visual Studio, go to Debug and then Select Option and Settings...

On the left panel go down to where it says Symbols under the Debug section.

Select "Only Specified Modules" and you do not need to specify any modules at all if you are only interested in debugging modules that are in your own project.


Saturday, June 16, 2012

LinqDataSource Control "Exception has been thrown by the target of an invocation."

Symptom


  • You are running Visual Studio 2010 SP1
  • You have an ASP.NET web page
  • You have dragged the LinqDataSource onto the design surface
  • You try to Configure Data Source and get the following error message
 Exception has been thrown by the target of an invocation

Root Cause

  • Appears to be Related to .NET Framework 4.5 present (as a result of installing Visual Studio 2012).

Fixes That Would Not Work

I have tried the following and none worked. So you may not want to go down the same path.
  • Use devenv /Log to find out what's happening.: It will not log anything useful.
  • Start devenv in /Safemode.: No effect
  • Repair Visual Studio 2010
  • Uninstall Visual Studio 2010 (note if you do this you will have to apply SP1 which takes a long time)
  • Remove or Repair Sliverlight SDKs
  • Remove or Repair .NET Framework 4.5

Possible Fix If You Do Not Need VS 2012

The following steps fixed my situation. You do not need to uninstall SQL 2012 Express
  • Uninstall VS 2012
  • Uninstall .NET Framework 4.5
  • Uninstall .NET 4.0 Multi-Traget Pack
  • Using VS 2010 Installer, Perform the Repair of VS 2010

Workaround If You Need VS 2012

  • Try another machine or a VM you have not installed anything "2012" on it, you should be able to continue to work on LinqDataSource. Once the LinqDataSource is configured, check the code in and it should work on your "corrupted" environment, though you won't be able to change anything in the data source. You can still work with the Data Grid to which the data source is connected and do add/remove columns and such. You can manually edit the web page source code to change minor things like some query changes.
  • If you can safely move up to VS 2012, then the LinqDataSource will work perfectly fine there.







Saturday, June 09, 2012

VS 2010 Web Debug Fails To Start Due to "Invalid file name for file monitoring"

Symptom:

You try to launch your ASP.NET web application from Microsoft Visual Studio (2010) and you get the following error (you swear it was working an hour ago.) Note that the file name mentioned does not really matter. The symptom is that you cannot launch a web page in debug mode.

Invalid file name for file monitoring: 'C:\Blah\Whatever\App_LocalResources'. Common reasons for failure include:

Cause:

The root cause is completely understood, but it has something to do with catching all un-handled CLR exceptions in the debug menu.

My Fix (May Not Work With You):


  • Go to Debug->Exceptions and un-check all un-handled exception checking.
  • Try to launch the debug session again. This time, it worked for me.
  • Go to Debug menu and then clear all break-points. This time, I can re-enable un-handled CLI exceptions and back to be able to launch and debug the app.
  • If above does not work, clear the .NET temp files for the framework version you are using. For example,

    C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files




Saturday, July 10, 2010

Ignoring .MySCMServerInfo in Visual Studio Web Project

Problem:
  • You are using Microsoft Visual Studio 2005, 2008, or 2010 with Seapine SurroundSCM.
  • When you are working with Web project you see annoying .MySCMServerInfo file in each directory and furthermore, VisualStudio make you check them in when SurroundSCM does not want you to check them in. You don't get this issue when you are working on non-Web (e.g., "desktop" or class library) projects.
Solution:


Just in case the answer link is lost in the future, the idea is to add the Ignorable File Key (yes, Key with the name of the file(s) you want to ignore and not the Data) with file names you want to ignore from the source control. It works on Version 8.0 (VS 2005), Version 9.0 (VS 2008) and Version 10.0 (VS2010).

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\Packages\
{8FF02D1A-C177-4ac8-A62F-88FC6EA65F57}\IgnorableFiles\.MySCMServerInfo]

Monday, July 05, 2010

ASP.NET MVC2 New Project Fails To Build with 'The type or namespace name 'Controllers' does not exist in the namespace..."

Symptom:

You have just created a brand new MVC2 Web project and tried to compile and run without anything modified and you get the following error:

The type or namespace name 'Controllers' does not exist in the namespace

What Fixed For Me:

The Unit Test project does not have the reference to the Main project. Just go to the Reference folder of the Unit Test Project and make a reference to the Main project.