MissingManifestResourceException solution

Every time I edited a C# file in my solution, I had an error called “Could not find any resources appropriate for the specified culture or the neutral culture.  Make sure "UI.Web.Mvc.Properties.Resources.resources" was correctly embedded or linked into assembly "UI.Web.Mvc" at compile time, or that all the satellite assemblies required are loadable and fully signed.. The error said that the Resource file wasn’t setup correctly. The strange thing about it that my colleagues didn’t got the error and when I cleaned up the web application mvc project and builded the project again, the site worked correctly. Cleaning and building after each edit is a huge consuming of you time so I needed a fix for this. 

After searching for some time I found the difference between my laptop and the laptops of my colleagues. They had the Dutch version of Windows 7 Enterprise and I had the English version. The project is by default Dutch and we are still developing so in the solution we only had the Dutch version of the resource file. When I ran my project, the culture is set to the host and after that, it looks to the culture of the browser. My host is English so I couldn’t find any English resource. Why It worked correctly after a clean, I don’t know. Can you tell me?

I fixed the error by adding the English version of the resource file. Just copied the Dutch version and added “en” to the name. Simple fix, big irritations and a hope useless time… It’s now time to hurry up and finish the baby :-)

Share WHAT you want to share and with WHO you want to share in Facebook

IMG_16639mkSome weeks ago, Google launched his new social media network called Google+. It’s not the first social media network Google launched before but I think that this time the network will be a success.

The key behind the success is the way they combined the applications Twitter and Facebook into one application.

Google Circles

You can share with everyone or with the people you like. To share the information only with the people you want to share, you will have to place those people in Circles. After that you share your information with those Circles.

Does Facebook has Circles?

I should say: YES! They have! They have it a lot longer than Google+ is around.
In Facebook you have the same thing but not everybody knows how it works. That’s why I will give you some steps to follow so you can also share the information you upload to the people that you want to share. It’s a little bit hard to find so +1 for Google that they have managed to create it that visual. Hopefully that Facebook will change the visual aspect as well.

Create a friend list

  1. Hit friends on the left image
  2. Manage your friend list
    image
  3. Choose “All friends” or any view you would like
    image
  4. Create a list in the upper right corner (see previous print screen)
  5. Give a name for the list and select the people you want in the list
    image
  6. Hit “Create List” in the bottom right corner of the popup.
    Now you have a new list with some “friends” in it to share information with it.

Share information with a friend list

  1. image
  2. Click the lock next to the share button and hit “Customize”
    image
  3. Share the information with the friends or friend lists that you want and hit “Save Setting”
    image
    You can even make this the default setting for the next time.
  4. Click on share.

That’s it! Only the first time is a heavy job because you have to make all the friend lists. But when your finished, you can share the information with the people you want to share. You can do the same with your photo albums or movies etcetera.

Enable Code Analysis for all projects in the solution

Ralph Jansen BlogI needed a trick to enable code analysis for all my projects. I know you can set the rules in the “Analyze/Configure Code Analysis for Solution” window but didn’t find a way to enable or disable the CA for all the projects in one action. So I created a macro to do this. The macro could also change your target framework if you like. That is nice when you upgrading your project from framework 3.5 to 4.

 

 

Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90
Imports System.Diagnostics

Public Module ProjectUtilities

    Private Class ProjectGuids
        Public Const vsWindowsCSharp As String = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
        Public Const vsWindowsVBNET As String = "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}"
        Public Const vsWindowsVisualCPP As String = "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}"
        Public Const vsWebApplication As String = "{349C5851-65DF-11DA-9384-00065B846F21}"
        Public Const vsWebSite As String = "{E24C65DC-7377-472B-9ABA-BC803B73C61A}"
        Public Const vsDistributedSystem As String = "{F135691A-BF7E-435D-8960-F99683D2D49C}"
        Public Const vsWCF As String = "{3D9AD99F-2412-4246-B90B-4EAA41C64699}"
        Public Const vsWPF As String = "{60DC8134-EBA5-43B8-BCC9-BB4BC16C2548}"
        Public Const vsVisualDatabaseTools As String = "{C252FEB5-A946-4202-B1D4-9916A0590387}"
        Public Const vsDatabase As String = "{A9ACE9BB-CECE-4E62-9AA4-C7E7C5BD2124}"
        Public Const vsDatabaseOther As String = "{4F174C21-8C12-11D0-8340-0000F80270F8}"
        Public Const vsTest As String = "{3AC096D0-A1C2-E12C-1390-A8335801FDAB}"
        Public Const vsLegacy2003SmartDeviceCSharp As String = "{20D4826A-C6FA-45DB-90F4-C717570B9F32}"
        Public Const vsLegacy2003SmartDeviceVBNET As String = "{CB4CE8C6-1BDB-4DC7-A4D3-65A1999772F8}"
        Public Const vsSmartDeviceCSharp As String = "{4D628B5B-2FBC-4AA6-8C16-197242AEB884}"
        Public Const vsSmartDeviceVBNET As String = "{68B1623D-7FB9-47D8-8664-7ECEA3297D4F}"
        Public Const vsWorkflowCSharp As String = "{14822709-B5A1-4724-98CA-57A101D1B079}"
        Public Const vsWorkflowVBNET As String = "{D59BE175-2ED0-4C54-BE3D-CDAA9F3214C8}"
        Public Const vsDeploymentMergeModule As String = "{06A35CCD-C46D-44D5-987B-CF40FF872267}"
        Public Const vsDeploymentCab As String = "{3EA9E505-35AC-4774-B492-AD1749C4943A}"
        Public Const vsDeploymentSetup As String = "{978C614F-708E-4E1A-B201-565925725DBA}"
        Public Const vsDeploymentSmartDeviceCab As String = "{AB322303-2255-48EF-A496-5904EB18DA55}"
        Public Const vsVSTA As String = "{A860303F-1F3F-4691-B57E-529FC101A107}"
        Public Const vsVSTO As String = "{BAA0C2D2-18E2-41B9-852F-F413020CAA33}"
        Public Const vsSharePointWorkflow As String = "{F8810EC1-6754-47FC-A15F-DFABD2E3FA90}"
    End Class

    ” Defines the valid target framework values.
    Enum TargetFramework
        Fx40 = 262144
        Fx35 = 196613
        Fx30 = 196608
        Fx20 = 131072
    End Enum

    ” Change the target framework for all projects in the current solution.
    Sub ChangeTargetFrameworkForAllProjects()
        Dim project As EnvDTE.Project
        Dim clientProfile As Boolean = False

        Write("——— CHANGING TARGET .NET FRAMEWORK VERSION ————-")
        Try
            If Not DTE.Solution.IsOpen Then
                Write("There is no solution open.")
            Else
                Dim targetFrameworkInput As String = InputBox("Enter the target framework version (Fx40, Fx35, Fx30, Fx20):", "Target Framework", "Fx40")
                Dim targetFramework As TargetFramework = [Enum].Parse(GetType(TargetFramework), targetFrameworkInput)

                If targetFramework = ProjectUtilities.TargetFramework.Fx35 Or targetFramework = ProjectUtilities.TargetFramework.Fx40 Then
                    Dim result As MsgBoxResult = MsgBox("The .NET Framework version chosen supports a Client Profile. Would you like to use that profile?", MsgBoxStyle.Question Or MsgBoxStyle.YesNo, "Target Framework Profile")
                    If result = MsgBoxResult.Yes Then
                        clientProfile = True
                    End If
                End If

                For Each project In DTE.Solution.Projects
                    If project.Kind <> Constants.vsProjectKindSolutionItems And project.Kind <> Constants.vsProjectKindMisc Then
                        ChangeTargetFramework(project, targetFramework, clientProfile)
                    Else
                        For Each projectItem In project.ProjectItems
                            If Not (projectItem.SubProject Is Nothing) Then
                                ChangeTargetFramework(projectItem.SubProject, targetFramework, clientProfile)
                            End If
                        Next

                    End If
                Next
            End If
        Catch ex As System.Exception
            Write(ex.Message)
        End Try
    End Sub

    ” Change the target framework for a project.
    Function ChangeTargetFramework(ByVal project As EnvDTE.Project, ByVal targetFramework As TargetFramework, ByVal clientProfile As Boolean) As Boolean
        Dim changed As Boolean = True

        If project.Kind = Constants.vsProjectKindSolutionItems Or project.Kind = Constants.vsProjectKindMisc Then
            For Each projectItem In project.ProjectItems
                If Not (projectItem.SubProject Is Nothing) Then
                    ChangeTargetFramework(projectItem.SubProject, targetFramework, clientProfile)
                End If
            Next
        Else
            Try
                If IsLegalProjectType(project) Then
                    SetTargetFramework(project, targetFramework, clientProfile)
                Else
                    Write("Skipping project: " + project.Name + " (" + project.Kind + ")")
                End If
            Catch ex As Exception
                Write(ex.Message)
                changed = False
            End Try
        End If

        Return changed
    End Function

    ” Determines if the project is a project that actually supports changing the target framework.
    Function IsLegalProjectType(ByVal proejct As EnvDTE.Project) As Boolean
        Dim legalProjectType As Boolean = True

        Select Case proejct.Kind
            Case ProjectGuids.vsDatabase
                legalProjectType = False
            Case ProjectGuids.vsDatabaseOther
                legalProjectType = False
            Case ProjectGuids.vsDeploymentCab
                legalProjectType = False
            Case ProjectGuids.vsDeploymentMergeModule
                legalProjectType = False
            Case ProjectGuids.vsDeploymentSetup
                legalProjectType = False
            Case ProjectGuids.vsDeploymentSmartDeviceCab
                legalProjectType = False
            Case ProjectGuids.vsDistributedSystem
                legalProjectType = False
            Case ProjectGuids.vsLegacy2003SmartDeviceCSharp
                legalProjectType = False
            Case ProjectGuids.vsLegacy2003SmartDeviceVBNET
                legalProjectType = False
            Case ProjectGuids.vsSharePointWorkflow
                legalProjectType = False
            Case ProjectGuids.vsSmartDeviceCSharp
                legalProjectType = True
            Case ProjectGuids.vsSmartDeviceVBNET
                legalProjectType = True
            Case ProjectGuids.vsTest
                legalProjectType = False
            Case ProjectGuids.vsVisualDatabaseTools
                legalProjectType = False
            Case ProjectGuids.vsVSTA
                legalProjectType = True
            Case ProjectGuids.vsVSTO
                legalProjectType = True
            Case ProjectGuids.vsWCF
                legalProjectType = True
            Case ProjectGuids.vsWebApplication
                legalProjectType = True
            Case ProjectGuids.vsWebSite
                legalProjectType = True
            Case ProjectGuids.vsWindowsCSharp
                legalProjectType = True
            Case ProjectGuids.vsWindowsVBNET
                legalProjectType = True
            Case ProjectGuids.vsWindowsVisualCPP
                legalProjectType = True
            Case ProjectGuids.vsWorkflowCSharp
                legalProjectType = False
            Case ProjectGuids.vsWorkflowVBNET
                legalProjectType = False
            Case ProjectGuids.vsWPF
                legalProjectType = True
            Case Else
                legalProjectType = False
        End Select
        Return legalProjectType
    End Function

    ” Sets the target framework for the project to the specified framework.
    Sub SetTargetFramework(ByVal project As EnvDTE.Project, ByVal targetFramework As TargetFramework, ByVal clientProfile As Boolean)
        Dim currentTargetFramework As TargetFramework = CType(project.Properties.Item("TargetFramework").Value, TargetFramework)
        Dim targetMoniker As String = GetTargetFrameworkMoniker(targetFramework, clientProfile)
        Dim currentMoniker As String = project.Properties.Item("TargetFrameworkMoniker").Value

        If currentMoniker <> targetMoniker Then
            Write("Changing project: " + project.Name + " from " + currentMoniker + " to " + targetMoniker + ".")
            project.Properties.Item("TargetFrameworkMoniker").Value = targetMoniker
            project.Properties.Item("TargetFramework").Value = targetFramework
        Else
            Write("Skipping project: " + project.Name + ", already at the correct target framework.")
        End If
    End Sub

    Function GetTargetFrameworkMoniker(ByVal targetFramework As TargetFramework, ByVal clientProfile As Boolean) As String
        Dim moniker As String = ".NETFramework,Version=v"
        Select Case targetFramework
            Case ProjectUtilities.TargetFramework.Fx20
                moniker += "2.0"

            Case ProjectUtilities.TargetFramework.Fx30
                moniker += "3.0"

            Case ProjectUtilities.TargetFramework.Fx35
                moniker += "3.5"

            Case ProjectUtilities.TargetFramework.Fx40
                moniker += "4.0"

        End Select

        If clientProfile Then
            moniker += ",Profile=Client"
        End If

        Return moniker
    End Function

    ” Writes a message to the output window
    Sub Write(ByVal s As String)
        Dim out As OutputWindowPane = GetOutputWindowPane("Change Target Framework", True)
        out.OutputString(s)
        out.OutputString(vbCrLf)
    End Sub

    ” Gets an instance of the output window
    Function GetOutputWindowPane(ByVal Name As String, Optional ByVal show As Boolean = True) As OutputWindowPane
        Dim win As Window = DTE.Windows.Item(EnvDTE.Constants.vsWindowKindOutput)
        If show Then win.Visible = True
        Dim ow As OutputWindow = win.Object
        Dim owpane As OutputWindowPane
        Try
            owpane = ow.OutputWindowPanes.Item(Name)
        Catch e As System.Exception
            owpane = ow.OutputWindowPanes.Add(Name)
        End Try
        owpane.Activate()
        Return owpane
    End Function

    ” Change the code analysis value for a project.
    Function ChangeCodeAnalysis(ByVal project As EnvDTE.Project, ByVal isCodeAnalysisEnabled As Boolean) As Boolean
        Dim changed As Boolean = True

        If project.Kind = Constants.vsProjectKindSolutionItems Or project.Kind = Constants.vsProjectKindMisc Then
            For Each projectItem In project.ProjectItems
                If Not (projectItem.SubProject Is Nothing) Then
                    ChangeCodeAnalysis(projectItem.SubProject, isCodeAnalysisEnabled)
                End If
            Next
        Else
            Try
                If IsLegalProjectType(project) Then
                    SetCodeAnalysis(project, isCodeAnalysisEnabled)
                Else
                    Write("Skipping project: " + project.Name + " (" + project.Kind + ")")
                End If
            Catch ex As Exception
                Write(ex.Message)
                changed = False
            End Try
        End If

        Return changed
    End Function

    ” Sets the code analysis for the project to the specified value.
    Sub SetCodeAnalysis(ByVal project As EnvDTE.Project, ByVal isCodeAnalysisEnabled As Boolean)
        Dim currentCAValue As String = project.ConfigurationManager.ActiveConfiguration.Properties.Item("RunCodeAnalysis").Value

        Dim targetCAValue As String
        If isCodeAnalysisEnabled Then
            targetCAValue = "True"
        Else
            targetCAValue = "False"
        End If

        If currentCAValue <> targetCAValue Then
            Write("Changing project: " + project.Name + " from " + currentCAValue + " to " + targetCAValue + ".")
            project.ConfigurationManager.ActiveConfiguration.Properties.Item("RunCodeAnalysis").Value = isCodeAnalysisEnabled
        Else
            Write("Skipping project: " + project.Name + ", already at the correct Code Analysis value.")
        End If
    End Sub

    Sub EnableOrDisableCodeAnalysisOnAllProjects()
        Dim project As EnvDTE.Project
        Dim clientProfile As Boolean = False

        Write("——— Enable or Disable Code Analysis on all projects ————-")
        Try
            If Not DTE.Solution.IsOpen Then
                Write("There is no solution open.")
            Else
                Dim codeAnalysisInput As String = InputBox("Enter 0 for disabling or 1 for enabling code analysis:", "Enabled", "0")

                Dim isCodeAnalysisEnabled As Boolean
                If codeAnalysisInput = 0 Then
                    isCodeAnalysisEnabled = False
                ElseIf codeAnalysisInput = 1 Then
                    isCodeAnalysisEnabled = True
                Else
                    Throw New InvalidOperationException("Wrong input. Only 0 or 1 is allowed")
                End If

                For Each project In DTE.Solution.Projects
                    If project.Kind <> Constants.vsProjectKindSolutionItems And project.Kind <> Constants.vsProjectKindMisc Then
                        ChangeCodeAnalysis(project, isCodeAnalysisEnabled)
                    Else
                        For Each projectItem In project.ProjectItems
                            If Not (projectItem.SubProject Is Nothing) Then
                                ChangeCodeAnalysis(projectItem.SubProject, isCodeAnalysisEnabled)
                            End If
                        Next

                    End If
                Next
            End If
        Catch ex As System.Exception
            Write(ex.Message)
        End Try
    End Sub
End Module

HTML klaar voor het grote werk?

Als ik kijk naar de volwassenheid van het huidige web is HTML zelf nog niet helemaal klaar voor het grote werk. Als ik kijk naar HTML 5 in combinatie met frameworks als JQuery, Modernizr etc. zeg ik dat het de goede kant op gaat. De laatste versies van alle browsers werken goed maar er zijn nog steeds een hoop verschillen in functionaliteit die worden ondersteund. Microsoft zegt dat IE9 helemaal het einde is maar ze weten dat ze snel achter zullen lopen. Microsoft zegt zelf dat er geen release cyclus van +/- 6 weken komt voor IE maar ondertussen is de eerste versie van IE10 al in zicht. Ze zullen wel moeten want de concurrenten gaan veel sneller. Ik denk dat we op een gegeven moment ook alleen maar horen over IE en niet meer IE x. Weet iemand uit zijn hoofd wat de laatste versie van Chrome ondertussen is? Pssst antwoord is 11 sinds deze week.

Alle features van HTML 5 zijn nog lang niet bekend. Dit kan nog wel een tijd gaan duren. Tot die tijd zullen we moeten checken op features door middel van frameworks. Als ik verder kijk dan alleen de computer zal HTML bij mij toch echt de voorkeur krijgen. De tablet oorlog is volgens de analisten pas dit jaar van start gegaan. Het aantal tablets bij de consumenten en bedrijven (ik hoor het steeds meer om me heen bij bedrijven) groeit met een rap tempo. Het aanhouden van een standaard is dan wel zo makkelijk.

Ontwikkelmethodieken als MVC stellen je in staat logica en presentatie makkelijker te scheiden. Het compatible maken/ondersteunen van je applicatie voor verschillende platformen is dus ook een stuk eenvoudiger. Je bereikt hierdoor een groter publiek en zal dus meer omzet genereren. De techniek staat niet stil waardoor we onze strategieën zelf moeten beslissen maar wat je wel ziet is dat de doelgroep of manier van werken langzaam wijzigt. De IPad 2 is uit en meteen heel het internet staat vol met tweede hands IPad 1 omdat die oud is. Er is veel meer vraag naar nieuwe techniek en alle informatie dient voor alle gadgets en platformen aanwezig te zijn. Mensen verwachten tegenwoordig dat dit ook zo wordt gemaakt.

De smartphoneverkoop neemt in een jaar tijd met 83% toe. Het aantal verschillende telefoons op de markt met verschillende specificaties neemt ook rap toe. Het gebruiken van standaarden begint nu dus echt belangrijk te worden. Grote organisaties als Microsoft, Google en Apple omarmen dit ook. Het is niet voor niets dat grote organisaties steeds meer open source projecten financieel ondersteunt zodat hier de community weer gebruik van kan maken. Soms worden projecten door dit wel is stop gezet. Denk maar aan de AJAX techniek van Microsoft. Microsoft ontwikkelt zelf nu voor JQeury. Heel het templating in JQuery komt namelijk van Microsoft.

.NET Framework 4.0 on Windows Server 2003 with IIS 6

Ralph Jansen BlogToday I was converting a website to the new .NET Framework 4.0 version. This was an existing website and was already running on a Windows Server 2003 with IIS 6.0 system. After I upgraded the files of the website, changed the config file to the right settings and changed the .NET Framework version on the ASP .NET tab in the properties window of the website to version 4 instead of 2, I was getting a “Page could not be found” error. After restarting the server, registering the .NET Framework again to IIS, I still had the same error on my screen.

When I searched the internet for a solution, I found the blog of Johan Driessen. One blog post explained the error that I was getting with the right solution. Just check if your ASPNET_ISAPI is set to the right .NET Framework (version 4). If not, enable it with the provided command. The only difference on the command in his blog and the one that I used is that I used Framework64 and not Framework.

Change Target Framework version for all the projects in the solution

Ralph Jansen BlogToday I migrated an old project from Visual Studio 2008 to Visual Studio 2010 and with that, I changed the Framework to version 4.0. This is currently the newest .NET Framework. The solution contains a lot of different projects so the challenge was to convert all the target frameworks to the 4.0 version.

 

There are a couple ways to this:

  1. Change every project by hand. (Open the properties of every project and select the target framework that you want);
  2. Edit the project files by hand in notepad;
  3. Use the macro of Scott Dorman.

The macro of Scott can be found here. Just place the macro on the right place on your pc and execute it. After you executed the macro a popup is shown with the question to which target framework you want to migrate. Choose your framework and press OK.

That’s it!!! Safes a lot of time!!

Update:
You can execute a Macro in the Tools->Macros->Macros Explorer window.

clip_image002_thumb

DevExpress Roadmap 2011

Ralph Jansen BlogThe roadmap for DevExpress 2011 is launched. In the roadmap you see that Silverlight will get much more attention. WinForms is and old technology that they probably will let go in future releases. Many users write in the comments that they want to see more attention to WinForms then Silverlight because Silverlight is not “Business Ready”. I think that DevExpress has some more inside news in the Roadmap of Microsoft. I also think that Microsoft wont work on new features for WinForms anymore.

Silverlight is the future and I think that Silverlight will get more attention by Microsoft then WPF (Windows Presentation Foundation) in the future. New news about WPF is not really coming out that often and will not get that much attention as the new features in Silverlight. Silverlight 5 is coming out at the end of 2011. If you think about it, that is a very long time for a release in Silverlight versions. Silverlight 1, 2, 3 and 4 where coming out after about 9 months after each other. Silverlight 4 was released in April of 2010 so the end of 2011 is a lot longer then 9 months! My philosophy is that Microsoft will create Silverlight 5 for Desktop and Windows Phone 7 in one time. They already said that Phone 7 will get a big release at the end of the year and that the new Internet Explorer 9 will be coming this year to Phone 7 including a new version of Silverlight.

So, not so crazy that a company as DevExpress will put that much effort in creating controls for Silverlight and not for WinForms!

If you want to see the roadmap of 2011 for the DevExpress controls, you can find it here.

silverlight

Default browser VS2010 Add-in

Ralph JansenLast weekend I was working on a MVC 2 application. When I started the application my default browser (Google Chrome) came up. I actually wanted to change my browser for this application to Internet Explorer because the connectivity between IE and Visual Studio 2010 is much better than with Chrome.

The problem is that you can’t choose for the option “Browse With” in a MVC Application. This is because the controller is deciding which view should start. To fix this problem, I found an add-in for VS2010 that you can switch your default browser on the fly from your toolbar. In that way, you can switch easier between your installed browsers. See the screenshot below. image

You can download the add-in by following the link below.
http://visualstudiogallery.msdn.microsoft.com/en-us/bb424812-f742-41ef-974a-cdac607df921

 

Update:
If you get a popup on the startup of your Visual Studio Instance with the text: “The bits have expired, please download an updated version from http://www.wovs.com”, you have to download the new version. To do this, follow the steps on this website: http://blog.wovs.com/2010/10/how-to-update-currently-expired.html
Search in the online extension manager for “Default browser switcher”.