Skip to main content

Microsoft Silverlight

Answered Question Change Language of page.xaml and app.xaml in SL-Project in Visual Studio - SolvedRSS Feed

(0)

Blacky
Blacky

Member

Member

0 points

14 Posts

Change Language of page.xaml and app.xaml in SL-Project in Visual Studio - Solved

Hello,

I'm new to Silverlight, started on a project and have a problem where I have currently no idea where to look.

If I create a basic SL-Project with the Visual Studio Wizard, then load and open it, there is always the default setting for Visual Basic as language, and I would like to use C# ( I don't like VB and luckily the requirement is C# ;-) ) .

How can I change this setting ?

I am running VS 2008 with all the neccessary updates on XP pro 32 in a virtual environment ( VMWare ) , and in paralell I have the same configuration with Vista 64 Business , also in virtual.

On the Vistasystem, I get C# as Language of page.xaml ( It gives me there a page.xaml.cs ) .

The only difference between those two systems was during the first startup of visual studio ( the "layout"-question, for what kind of development VS is going to be used ) , on the XP I have chosen "General development", on Vista " C# Development" .

I have tried and changed the setting on the XP-System to C#-Development, but it did not solve the problem.

 

Any idea before I revert the XP to the initial state ?

Thanks alot for your help !

roland

 

post scriptum : helped myself by removing the blindfold from my eyes, I have completly overseen, that the default selection in the new project wizard was on "other languages - VB" and there on Silverlight.

The C# Selection fields where "hidden" and scrolled away in the list of possibilities.

bartczernicki
bartczer...

Contributor

Contributor

4172 points

730 Posts

Answered Question

Re: Change Language of page.xaml and app.xaml in SL-Project in Visual Studio - Solved

It sounds like VB.NET is your default language.  Try doing this.  Open VS 2008.  File -> New Project.  In the dialog select "Other languages"..select C# and then pick Silverlight.  It should create a template for you for Silvrerlight in C#.  If you do not see C# in the "other languages", you might not have C# installed in VS 2008.  In that case you can pop the DVD/CD in and add C# to the languages in your installation.

WadeFlextronics
WadeFlex...

Member

Member

377 points

82 Posts

Re: Change Language of page.xaml and app.xaml in SL-Project in Visual Studio - Solved

The way to fix this for all new projects is to go to the Visual Studio Command Prompt window and type:     devenv /setup

This will redo the intial configuration for Visual Studio and prompt you for the type of development environment settings you want.  When it does choose C# Developer setting.

This should solve the problem.

(Please mark as Answered if this helps!) Cool

Thanks,
Wade

MRutkowski
MRutkowski

Member

Member

14 points

10 Posts

Re: Change Language of page.xaml and app.xaml in SL-Project in Visual Studio - Solved

 

I tried the "devenv /setup" command; however, this resulted in a minute or so of disk churning after which no setup panel appeared nor did VS 2008 start (which is at SP1 level).

The post in this thread flagged as answer (see bartczernicki post) is what I now use; it is a longer path than I prefer (there should be a way so that I can simply create a new Silverlight Project with C# auto-default) , but it is the only reliable solution from numerous I have tried.

Regards,
Matt Rutkowski

TerraIncognita
TerraInc...

Member

Member

4 points

5 Posts

Re: Re: Change Language of page.xaml and app.xaml in SL-Project in Visual Studio - Solved

 This answer is close to what resolved my own problem, but the instructions you give are confusing.  When I open a New Project, I have to expand the selections for VC# on the left, and from there choose Silverlight... there is no option for "Other Languages" on that screen for me.

Liversage
Liversage

Member

Member

2 points

1 Posts

Re: Change Language of page.xaml and app.xaml in SL-Project in Visual Studio - Solved

In Visual Studio 2008 you can change the "default" language for all new projects by using Import and Export Settings in the Tools menu to import environment settings for either Visual Basic, Visual C# or Visual C++. The selected language will appear first in the New Project dialog box and the remaining two languages will appear in the Other Languages category. Running devenv /setup will not do the trick.

 

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities