Visual Studio Newbie Questions

Hello. I’m thinking some of us could do with a newbie guide to Visual Studio. I have some questions so far:

What is the difference between building /deploying solution and your project? Are they separate or is the Solution including the project?

Running the Store Test Kit: Im having errors with validation of screenshots. Are we forced to use Portrait screenshots or is it linked to the app orientation. IE my app is portrait but screenshots are landscape so is that why there is an error? Usually all other stores allow portrait or landscape.

I have built to device using release but still get overlayed text/debug info - how come? is it just overlayed by Visual Studio

The Project Store menus are all greyed out but Im logged in - how come?

A lamens guide to including c# files - do we simply stick one in the project, include it ? IE in future will need to support Admob etc so is this possible now? Can I access native audio/video features this way?

Rob,

I highly suggest that you read up on WP8 development on Microsoft’s MSDN website.  It’s a great resource and will teach you how to use Visual Studio and provides plenty of app examples.  I also recommend that you play with Microsoft’s sample projects and built-in project templates first to get familiar with the development environment.  In my opinion, Visual Studio is much simpler to use compared to Xcode and the Android SDK, so, you should be able to get to speed fairly quickly.

>> What is the difference between building /deploying solution and your project? Are they separate or is the Solution including the project?

Doing a “Build” compiles your code into libraries/DLLs and bundles your binaries and assets into a WP8 *.xap file.  “Deploying” means installing and running your compiled app onto the WP8 device or emulator.  When you click the “>” toolbar button in Visual Studio, it does a build, deploy, and starts running/debugging your app all in one shot.  The “>” toolbar button is also a dropdown box which allows you to choose which physical device or device emulator to deploy to.

>> Running the Store Test Kit: Im having errors with validation of screenshots.

Microsoft expects you to take a screenshot via the WP8 emulator as shown here…

   http://msdn.microsoft.com/en-us/library/windows/apps/gg442300(v=vs.105).aspx

Microsoft documents the WP8 store screenshot requirements here…

   http://msdn.microsoft.com/en-us/library/windows/apps/hh846296.aspx

>> I have built to device using release but still get overlayed text/debug info - how come?

That is framerate information that only shows up when you are running your app via Visual Studio’s .NET “Managed” debugger.  When you stop the debugger in Visual Studio and then run the app on your device manually (tap on it yourself), notice that debugging information no longer shows up onscreen.  This is Microsoft’s default debugging behavior and it’ll do the same with all other Microsoft WP8 project templates.  It’s nothing to worry about.

>> A lamens guide to including c# files - do we simply stick one in the project, include it ? IE in future will need to support Admob etc so is this possible now? Can I access native audio/video features this way?

I recommend that you learn how to do this via Microsoft’s built sample projects and templates.  That’s the best way to learn C# and how to integrate 3rd party XAML controls such as ads.  For example, start with learning how to add Microsoft’s ad library/control to your page, which comes with Visual Studio.  This will help you learn how to work with Microsoft’s XAML UI framework as well as how to add a “Reference” to another library.

   http://msdn.microsoft.com/en-us/library/advertising-mobile-windows-phone-8-adcontrol-visual-designer(v=msads.20).aspx

Thank you for taking the time to reply, I will take a crash course next week. I did mean what the difference between building for solution and project is if you go in the menu there are two sections to build. I’m guessing I will find this all out when I look at that last link. Plus why I can’t see the project/store menu items . Cheers Rob

>> I did mean what the difference between building for solution and project is if you go in the menu there are two sections to build.

If you look at the “Solution Explorer” panel in Visual Studio, notice that it shows a tree of all of your project and its files.  The root node is the “Solution” node which references your *.sln file.  A “solution” references a collection of “projects” under it.  A “project” in Visual Studio is something that represents a library or application that you want to build.  In your case, you should only have 1 project which builds a WP8 application (ie: the *.xap file).

Now, if you intend to create multiple WP8 applications, but want to share the same C# code you’ve written amongst all of them, then a what you can do is create your own C# library project that you can share between those different applications.  You would do that by creating a “Class Library (Windows Phone Silverlight)” C# project which you would to your “solution”.  Your WP8 application project would then “Reference” that class library project, which allows that project to use the classes in your other library and it tells the build system to include that library with your application.

That said, I don’t expect you to do the above with your first WP8 application.  I recommend to keep it simple and only use 1 project, because you have plenty of other stuff to learn as you go, but hopefully that’s a good explanation of how Visual Studio’s Solution/Project system works.

But back to building a solution or project… when you build a “Project”, then you’re building just 1 project under your solution (and its other project dependencies if it has any).  If you build the “Solution”, then you’re building *all* of the projects under the solution.  In your case, since you only have 1 project under your solution, both options will build the same project.  So, it doesn’t matter for you.  This only matters if you have a lot of project under your solution (like mine) and if the whole thing takes a lot of time to compile, then it would be more productive to only compile the project that you’re currently working on.

I hope this helps!

That does. Thanks Joshua!

Rob,

I highly suggest that you read up on WP8 development on Microsoft’s MSDN website.  It’s a great resource and will teach you how to use Visual Studio and provides plenty of app examples.  I also recommend that you play with Microsoft’s sample projects and built-in project templates first to get familiar with the development environment.  In my opinion, Visual Studio is much simpler to use compared to Xcode and the Android SDK, so, you should be able to get to speed fairly quickly.

>> What is the difference between building /deploying solution and your project? Are they separate or is the Solution including the project?

Doing a “Build” compiles your code into libraries/DLLs and bundles your binaries and assets into a WP8 *.xap file.  “Deploying” means installing and running your compiled app onto the WP8 device or emulator.  When you click the “>” toolbar button in Visual Studio, it does a build, deploy, and starts running/debugging your app all in one shot.  The “>” toolbar button is also a dropdown box which allows you to choose which physical device or device emulator to deploy to.

>> Running the Store Test Kit: Im having errors with validation of screenshots.

Microsoft expects you to take a screenshot via the WP8 emulator as shown here…

   http://msdn.microsoft.com/en-us/library/windows/apps/gg442300(v=vs.105).aspx

Microsoft documents the WP8 store screenshot requirements here…

   http://msdn.microsoft.com/en-us/library/windows/apps/hh846296.aspx

>> I have built to device using release but still get overlayed text/debug info - how come?

That is framerate information that only shows up when you are running your app via Visual Studio’s .NET “Managed” debugger.  When you stop the debugger in Visual Studio and then run the app on your device manually (tap on it yourself), notice that debugging information no longer shows up onscreen.  This is Microsoft’s default debugging behavior and it’ll do the same with all other Microsoft WP8 project templates.  It’s nothing to worry about.

>> A lamens guide to including c# files - do we simply stick one in the project, include it ? IE in future will need to support Admob etc so is this possible now? Can I access native audio/video features this way?

I recommend that you learn how to do this via Microsoft’s built sample projects and templates.  That’s the best way to learn C# and how to integrate 3rd party XAML controls such as ads.  For example, start with learning how to add Microsoft’s ad library/control to your page, which comes with Visual Studio.  This will help you learn how to work with Microsoft’s XAML UI framework as well as how to add a “Reference” to another library.

   http://msdn.microsoft.com/en-us/library/advertising-mobile-windows-phone-8-adcontrol-visual-designer(v=msads.20).aspx

Thank you for taking the time to reply, I will take a crash course next week. I did mean what the difference between building for solution and project is if you go in the menu there are two sections to build. I’m guessing I will find this all out when I look at that last link. Plus why I can’t see the project/store menu items . Cheers Rob

>> I did mean what the difference between building for solution and project is if you go in the menu there are two sections to build.

If you look at the “Solution Explorer” panel in Visual Studio, notice that it shows a tree of all of your project and its files.  The root node is the “Solution” node which references your *.sln file.  A “solution” references a collection of “projects” under it.  A “project” in Visual Studio is something that represents a library or application that you want to build.  In your case, you should only have 1 project which builds a WP8 application (ie: the *.xap file).

Now, if you intend to create multiple WP8 applications, but want to share the same C# code you’ve written amongst all of them, then a what you can do is create your own C# library project that you can share between those different applications.  You would do that by creating a “Class Library (Windows Phone Silverlight)” C# project which you would to your “solution”.  Your WP8 application project would then “Reference” that class library project, which allows that project to use the classes in your other library and it tells the build system to include that library with your application.

That said, I don’t expect you to do the above with your first WP8 application.  I recommend to keep it simple and only use 1 project, because you have plenty of other stuff to learn as you go, but hopefully that’s a good explanation of how Visual Studio’s Solution/Project system works.

But back to building a solution or project… when you build a “Project”, then you’re building just 1 project under your solution (and its other project dependencies if it has any).  If you build the “Solution”, then you’re building *all* of the projects under the solution.  In your case, since you only have 1 project under your solution, both options will build the same project.  So, it doesn’t matter for you.  This only matters if you have a lot of project under your solution (like mine) and if the whole thing takes a lot of time to compile, then it would be more productive to only compile the project that you’re currently working on.

I hope this helps!

That does. Thanks Joshua!