I've put the XNA programming aside for now, moving on from samples and examples to trying to get an honest-to-goodness app finished and running. To do this, I'm leveraging libraries written by others, something that I find hard to do because I rather enjoy the process of implementing the same code myself.
But, time is of the essence, since I don't have many hours a week that's mine for WP7 projects, and thus it makes sense to not re-invent an internet-available wheel. Of course, I'm completely new to Silverlight, having at most run downloaded WP7 samples and read a few book excerpts. This means I really have no idea how to use other Silverlight controls in my own or how to include other C# projects in a Silverlight project.
I thought the first was easy enough to figure out -- even though I'm pretty new to Visual Studio (again), I know how to include references to other projects, and Silverlight does it the same way. But no, not really. And including an existing C# library in Silverlight doesn't work the same way. Only certain project types are able to be included in this way, and this one library isn't one. So as not to waste time (YET AGAIN) fighting with tools instead of developing, I've just copied the code from these downloaded libraries and controls into my own project, and am now fighting with dependencies that are expected from "full" environments but aren't available in the Windows Phone restricted set of APIs.
At this rate, I might end up coding these libraries myself, after all.
Showing posts with label visual studio. Show all posts
Showing posts with label visual studio. Show all posts
Sunday, August 8, 2010
Friday, April 30, 2010
Visual Studio 2010 RTM + Windows Phone 7 CTP April Refresh
Success!
A week after complaining about the fight with VS2010 and WP7CTP, they released an April refresh of the Windows Phone 7 Development Kit CTP that works with the full release of Visual Studio 2010.
I started on my home machine, where I had only ever installed the WP7 CTP with its Visual Studio 2010 Express version. That install had always worked. After an uninstall of that, including the leftover packages listed in the Programs and Features list, I was able to install the following, in this order (I can't say how much the order matters, but this worked for me):
Visual Studio 2010 Professional
Microsoft Windows Phone Developer Tools CTP - ENU
Microsoft Expression Blend Add-in Preview 2 for Windows Phone
Microsoft Expression Blend SDK Preview 2 for Windows Phone
Microsoft Silverlight 4 Tools RC2 for Visual Studio 2010
Microsoft Expression Blend 4 RC
WCF RIA Services Toolkit April 2010
Of course, you might not need all of this -- I'm aiming for a complete development environment -- but all of the above does seem to work together fine.
There are a few issues mentioned in the release notes, one of which doesn't affect me but might affect others: any assemblies signed with Authenticode will fail to load (a workaround is available until a next release of the CTP can be made); and the fact that existing projects, made with the previous release of CTP, will not work correctly because of a new section required in the manifest file. While the release notes spell this out, and Visual Studio will pop up a dialog to this effect, it's not a cut-and-pastable block of text, so I'll provide one here:
<Capabilities>
<Capability Name="ID_CAP_NETWORKING" />
<Capability Name="ID_CAP_LOCATION" />
<Capability Name="ID_CAP_SENSORS" />
<Capability Name="ID_CAP_MICROPHONE" />
<Capability Name="ID_CAP_MEDIALIB" />
<Capability Name="ID_CAP_GAMERSERVICES" />
<Capability Name="ID_CAP_PHONEDIALER" />
<Capability Name="ID_CAP_PUSH_NOTIFICATION" />
<Capability Name="ID_CAP_WEBBROWSERCOMPONENT" />
</Capabilities>
This should replace the empty <Capabilities> section in the WMAppManifest.xml file of older WP7 projects.
Since this worked so well yesterday, it was on to my work machine this morning. This was the machine that had all of the uninstalls and reinstalls from last week, but had finally gotten up-and-running with WP7 -- just in time for yesterday's announcement. So... I uninstall WP7, clean out every little package as I've done time and time again on that machine, and on the home machine. Install VS2010 and ... failed. Hrm. Reboot, uninstall the few pieces that got put in, reboot, install again... failed. The problem I was seeing is mentioned here and in other places; the one suggestion of turning off the virus scanner didn't apply (don't run one), and neither did the bad-ISO-image one (I had just used the same image two days prior). But, just in case, I went to arrange for another download, and lo! Found out that I have access to VS2010 Ultimate! Yay MSDNAA! After painstakingly waiting for the download and uninstalling the detritus from the last failed attempt at VS2010 Professional, I start the VS2010 Ultimate install, and ... success!
I have no idea whether a re-download of Professional would have solved the problem, or if the Ultimate installer had some smarter checks when installing itself. I don't care, because I'm that much closer! Unfortunately, the install finished at the end of the day, so the install of the abovementioned list of packages will have to wait until Monday.
If anyone out there has any problems with the WP7 setup using the packages as of the time of this writing, please drop me a comment -- especially if you also found a workaround!
A week after complaining about the fight with VS2010 and WP7CTP, they released an April refresh of the Windows Phone 7 Development Kit CTP that works with the full release of Visual Studio 2010.
I started on my home machine, where I had only ever installed the WP7 CTP with its Visual Studio 2010 Express version. That install had always worked. After an uninstall of that, including the leftover packages listed in the Programs and Features list, I was able to install the following, in this order (I can't say how much the order matters, but this worked for me):
Visual Studio 2010 Professional
Microsoft Windows Phone Developer Tools CTP - ENU
Microsoft Expression Blend Add-in Preview 2 for Windows Phone
Microsoft Expression Blend SDK Preview 2 for Windows Phone
Microsoft Silverlight 4 Tools RC2 for Visual Studio 2010
Microsoft Expression Blend 4 RC
WCF RIA Services Toolkit April 2010
Of course, you might not need all of this -- I'm aiming for a complete development environment -- but all of the above does seem to work together fine.
There are a few issues mentioned in the release notes, one of which doesn't affect me but might affect others: any assemblies signed with Authenticode will fail to load (a workaround is available until a next release of the CTP can be made); and the fact that existing projects, made with the previous release of CTP, will not work correctly because of a new section required in the manifest file. While the release notes spell this out, and Visual Studio will pop up a dialog to this effect, it's not a cut-and-pastable block of text, so I'll provide one here:
<Capabilities>
<Capability Name="ID_CAP_NETWORKING" />
<Capability Name="ID_CAP_LOCATION" />
<Capability Name="ID_CAP_SENSORS" />
<Capability Name="ID_CAP_MICROPHONE" />
<Capability Name="ID_CAP_MEDIALIB" />
<Capability Name="ID_CAP_GAMERSERVICES" />
<Capability Name="ID_CAP_PHONEDIALER" />
<Capability Name="ID_CAP_PUSH_NOTIFICATION" />
<Capability Name="ID_CAP_WEBBROWSERCOMPONENT" />
</Capabilities>
This should replace the empty <Capabilities> section in the WMAppManifest.xml file of older WP7 projects.
Since this worked so well yesterday, it was on to my work machine this morning. This was the machine that had all of the uninstalls and reinstalls from last week, but had finally gotten up-and-running with WP7 -- just in time for yesterday's announcement. So... I uninstall WP7, clean out every little package as I've done time and time again on that machine, and on the home machine. Install VS2010 and ... failed. Hrm. Reboot, uninstall the few pieces that got put in, reboot, install again... failed. The problem I was seeing is mentioned here and in other places; the one suggestion of turning off the virus scanner didn't apply (don't run one), and neither did the bad-ISO-image one (I had just used the same image two days prior). But, just in case, I went to arrange for another download, and lo! Found out that I have access to VS2010 Ultimate! Yay MSDNAA! After painstakingly waiting for the download and uninstalling the detritus from the last failed attempt at VS2010 Professional, I start the VS2010 Ultimate install, and ... success!
I have no idea whether a re-download of Professional would have solved the problem, or if the Ultimate installer had some smarter checks when installing itself. I don't care, because I'm that much closer! Unfortunately, the install finished at the end of the day, so the install of the abovementioned list of packages will have to wait until Monday.
If anyone out there has any problems with the WP7 setup using the packages as of the time of this writing, please drop me a comment -- especially if you also found a workaround!
Thursday, April 22, 2010
VS2010 + Windows Phone 7 Redux
Err...yeah. That didn't go well at all. After multiple attempts, numerous installs and painstaking uninstalls, no love was found trying to get the Windows Phone 7 CTP to work with Visual Studio 2010 (not the RC, but the release). Granted, I've never seen anything specifically say that the CTP should work with a post-RC version, only RC, so perhaps it's my fault for high expectations. As it is, I'll wait until the Phone devkit is beyond CTP and released for proper inclusion into a full VS2010 -- and then try all over again.
Luckily, I've got an XP virtual machine in which I can run VS2010, for doing non-Phone development. It's just unfortunate that I can't combine all of my development work into a single environment.
On a related note, I finally got to play around with the Visual Studio 2010 Express that comes with the CTP -- I haven't touched Visual Studio for almost ten years, since I was employed as a developer, and even then I resisted embracing the environment (having come from many years of Emacs under *nix development). My C# programming of late has all been under Linux, using Emacs and Mono, but I'm forcing myself to use the correct environment for Phone development, and ... wow.
I *really* used to despise the Intellisense in Visual Studio, finding it an interfering and distracting nuisance -- it was the first thing I'd change in a new VS install, even before adding my emacs key bindings. But now ... yeah, wow. Because of the "live" nature of the environment, VS can deduce types of variables and provide completion in code that has never been compiled or run, and the method to accept provided completions is definitely more intuitive than it used to be.
This is also my first time doing anything with Silverlight, and thus my first experience using XAML. I'm quite impressed with how useable and interactive the XAML editor is and the immediate view of changes made - it sure beats hitting "compile" every minute to see how things are looking after each change.
I'm sure Visual Studio veterans are laughing at my wide-eyed experiences, but we can't all have experience with everything out there, can we? Well, I'm trying.
Luckily, I've got an XP virtual machine in which I can run VS2010, for doing non-Phone development. It's just unfortunate that I can't combine all of my development work into a single environment.
On a related note, I finally got to play around with the Visual Studio 2010 Express that comes with the CTP -- I haven't touched Visual Studio for almost ten years, since I was employed as a developer, and even then I resisted embracing the environment (having come from many years of Emacs under *nix development). My C# programming of late has all been under Linux, using Emacs and Mono, but I'm forcing myself to use the correct environment for Phone development, and ... wow.
I *really* used to despise the Intellisense in Visual Studio, finding it an interfering and distracting nuisance -- it was the first thing I'd change in a new VS install, even before adding my emacs key bindings. But now ... yeah, wow. Because of the "live" nature of the environment, VS can deduce types of variables and provide completion in code that has never been compiled or run, and the method to accept provided completions is definitely more intuitive than it used to be.
This is also my first time doing anything with Silverlight, and thus my first experience using XAML. I'm quite impressed with how useable and interactive the XAML editor is and the immediate view of changes made - it sure beats hitting "compile" every minute to see how things are looking after each change.
I'm sure Visual Studio veterans are laughing at my wide-eyed experiences, but we can't all have experience with everything out there, can we? Well, I'm trying.
Subscribe to:
Posts (Atom)