locked
VS2011 beta to VS2012, Could not find SDK "Microsoft.WinJS, Version=0.6" RRS feed

  • Question

  • Hi everybody ..

    I have a 'old' project who was create in Visual Studio 2011 beta .. and I try open it on visual studio 2012 , and I get this error message : "Could not find SDK "Microsoft.WinJS, Version=0.6""

    what I need to do to fix it ? =/

    Tuesday, June 26, 2012 12:25 PM

Answers

All replies

  • Your project is referencing old version of the Microsoft.WinJS libraries. For example, you probably have something like the following in "default.html":

    <!-- WinJS references -->
    <link href="//Microsoft.WinJS.1.0/css/ui-dark.css" rel="stylesheet" />
    <script src="//Microsoft.WinJS.1.0/js/base.js"></script>
    <script src="//Microsoft.WinJS.1.0/js/ui.js"></script>

    ... except your version numbers will say "0.6" instead of "1.0" -- I'd change all those references to point at the 1.0 version for starters. Let me know if that isn't enough.
    Tuesday, June 26, 2012 12:58 PM
  • hi ! this help , but now this other thing happened :

    thx for the help ! :D and sorry about the big image !

    Tuesday, June 26, 2012 1:34 PM
  • Looks like you encountered some kind of error (from the second line in your call stack that says Application_errorHandler). That being said, "some kind of error" isn't much to go on. When does this happen? Are you able to interact with the program at all? Are you able to determine anything about the error through debugging?
    Tuesday, June 26, 2012 1:45 PM
  • when I run my app, I call default.html:

    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8">
        <title>gridApp</title>
    
        <!-- WinJS references -->
        <link href="//Microsoft.WinJS.1.0.RC/css/ui-dark.css" rel="stylesheet">
        <script src="//Microsoft.WinJS.1.0.RC/js/base.js"></script>
        <script src="//Microsoft.WinJS.1.0.RC/js/ui.js"></script>
    
        <!-- gridApp references -->
        <link href="/css/default.css" rel="stylesheet">
        <script src="/js/data.js"></script>
        <script src="/js/navigator.js"></script>
        <script src="/js/default.js"></script>
    </head>
    <body>
        <p>texto</p>
        <div id="contenthost" data-win-control="gridApp.PageControlNavigator" data-win-options="{home: '/html/groupedItemsPage.html'}"></div>
        <!-- <div id="appbar" data-win-control="WinJS.UI.AppBar">
            <button data-win-control="WinJS.UI.AppBarCommand" data-win-options="{id:'cmd', label:'Command', icon:'placeholder'}"></button>
        </div> -->
    </body>
    </html>

    if I remove <div id="contenthost" ...> my app run fine :) 

    but if I put the <div> ..... :(

    this app that I'm trying to run, its a default grid project create on visual 2011 ..

    Tuesday, June 26, 2012 2:25 PM
  • Try removing the ".RC" in your script and link tags.


    Tuesday, June 26, 2012 2:27 PM
  • if I do this, this error show up: JavaScript runtime error: 'WinJS' is undefined ;-)

    can I send the project for you ? because I really don't know what to do ..

    all this things that I do it, worked fine in a Blank App , but not work in a Grid App ..

    I don't know . for me, the problems are here :

    default.html

    <div id="contenthost" data-win-control="Application.PageControlNavigator" data-win-options="{home: '/html/groupedItemsPage.html'}"></div>

    navigator.js

        WinJS.Namespace.define("Application", {
            PageControlNavigator: WinJS.Class.define(
                // Define the constructor function for the PageControlNavigator.
                function PageControlNavigator(element, options) {
                    this.element = element || document.createElement("div");
                    this.element.appendChild(this._createPageElement());
    
                    this.home = options.home;
                    this.lastViewstate = appView.value;
    
                    nav.onnavigated = this._navigated.bind(this);
                    window.onresize = this._resized.bind(this);
    
                    document.body.onkeyup = this._keyupHandler.bind(this);
                    document.body.onkeypress = this._keypressHandler.bind(this);
                    document.body.onmspointerup = this._mspointerupHandler.bind(this);
    
                    Application.navigator = this;
                }, {
                    /// <field domElement="true" />
                    element: null,
                    home: "",
                    lastViewstate: 0,
    
                    // This function creates a new container for each page.
                    _createPageElement: function () {
                        var element = document.createElement("div");
                        element.style.width = "100%";
                        element.style.height = "100%";
                        return element;
                    },
    
                    // This function responds to keypresses to only navigate when
                    // the backspace key is not used elsewhere.
                    _keypressHandler: function (args) {
                        if (args.key === "Backspace") {
                            nav.back();
                        }
                    },
    
                    // This function responds to keyup to enable keyboard navigation.
                    _keyupHandler: function (args) {
                        if ((args.key === "Left" && args.altKey) || (args.key === "BrowserBack")) {
                            nav.back();
                        } else if ((args.key === "Right" && args.altKey) || (args.key === "BrowserForward")) {
                            nav.forward();
                        }
                    },
    
                    _mspointerupHandler: function (args) {
                        if (args.button === 3) {
                            nav.back();
                        } else if (args.button === 4) {
                            nav.forward();
                        }
                    },
    
                    // This function responds to navigation by adding new pages
                    // to the DOM.
                    _navigated: function (args) {
                        var that = this;
                        var oldElement = that.pageElement;
                        var newElement = that._createPageElement();
                        var parentedComplete;
                        var parented = new WinJS.Promise(function (c) { parentedComplete = c; });
    
                        args.detail.setPromise(
                            WinJS.Promise.timeout().then(function () {
                                if (oldElement.winControl && oldElement.winControl.unload) {
                                    oldElement.winControl.unload();
                                }
                                return WinJS.UI.Pages.render(args.detail.location, newElement, args.detail.state, parented);
                            }).then(function parentElement(control) {
                                that.element.appendChild(newElement);
                                that.element.removeChild(oldElement);
                                oldElement.innerText = "";
                                that.navigated();
                                parentedComplete();
                            })
                        );
                    },
    
                    _resized: function (args) {
                        if (this.pageControl && this.pageControl.updateLayout) {
                            this.pageControl.updateLayout.call(this.pageControl, this.pageElement, appView.value, this.lastViewstate);
                        }
                        this.lastViewstate = appView.value;
                    },
    
                    // This function updates application controls once a navigation
                    // has completed.
                    navigated: function () {
                        // Do application specific on-navigated work here
                        var backButton = this.pageElement.querySelector("header[role=banner] .win-backbutton");
                        if (backButton) {
                            backButton.onclick = function () { nav.back(); };
    
                            if (nav.canGoBack) {
                                backButton.removeAttribute("disabled");
                            } else {
                                backButton.setAttribute("disabled", "disabled");
                            }
                        }
                    },
    
                    // This is the PageControlNavigator object.
                    pageControl: {
                        get: function () { return this.pageElement && this.pageElement.winControl; }
                    },
    
                    // This is the root element of the current page.
                    pageElement: {
                        get: function () { return this.element.firstElementChild; }
                    }
                }
            )
        });

    but I dont know ! :(

    thank you for all the help !

    • Edited by xazin Tuesday, June 26, 2012 3:02 PM
    Tuesday, June 26, 2012 2:31 PM
  • Try following the steps on this blog to change your SDK references: http://blogs.microsoft.co.il/blogs/shair/archive/2012/06/03/convert-vs-11-beta-metro-projects-to-vs-2012-rc.aspx

    You may also have to put the ".RC" back. :-)

    • Edited by Brian Hilstrom Tuesday, June 26, 2012 2:57 PM
    • Marked as answer by xazin Tuesday, June 26, 2012 4:46 PM
    Tuesday, June 26, 2012 2:57 PM
  • You probably solved it by now, but in case anyone else is running into that problem, here's the solution: http://social.msdn.microsoft.com/Forums/en-US/winappswithhtml5/thread/d02bf608-675d-4676-a4ec-3ccbc64671f1
    Wednesday, July 4, 2012 8:36 PM