in my wpf project I added splash.png image to Resources and when the application run, works perfectly...
My question is: it's possible use the splash.png only in Release and not in Debug?
thanks in advance
You could try to manually edit the MSBuild script file as suggested here:
Debug-only classes and resources in visual studio - is it possible?
Right-click on the project in the Solution Explorer in Visual Studio and choose "Open Folder in File Explorer" and then open up and edit the .csproj file in a text editor such as Notepad. I am afraid Visual Studio provides no GUI that lets you do this though.
Related
When creating a new project I can select a new Windows Forms Project. It will open me a new project with a new windows form. When right clicking my opened project and going for add => Windows Form it will only open the "new element" mask, where Windows Forms, WPF and other templates are missing.
I already tried Visual Studio C# Can't make new windows form project devenv /installvstemplates, but it didn't work out telling me the templates were missing.
The following files were passed with the commandline:
\installvtemplates
These files were not found and could not be load.
What do I have to do, to get my WinForm templates back and where can I configure those? I can not just reinstall Visual Studio 2013 Ultimate, because I do not have an installation medium nor they key (Like nobody in my company can tell where to find it).
In the screenshot below you can see the mask, where I used to have a lot more templates. In this case we only have Inherited Forms and Inherited User Control as avaliable templates.
This is what I get when I go for new project, Windows Forms is avaliable here.
( Win Forms Objects not avaliable )
The template files are avaliable at C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ItemTemplates\VisualBasic so I am pretty sure it has to be an option somewhere in the settings. Any ideas?
After a few hours of trying I found a solution myself. It might not be the official way, but it seems to be working. I did the following steps:
Go to C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ItemTemplates\VisualBasic and check if the templates are avaliable
If they are avaliable copy the directory Windows Forms
Paste the copied directory to C:\Users\%USERNAME%\Documents\Visual Studio 2013\Templates\ItemTemplates\Visual Basic
Start Visual Studio
Go into a project and try to add a new element. This step will take a while loading. I think visual studio now detects the new templates in your documents folder and refreshes all templates.
When it has finished loading you will see almost all templates twice. That's good news!
Close Visual Studio and delete the directory in C:\Users\%USERNAME%\Documents\Visual Studio 2013\Templates\ItemTemplates\Visual Basic\ we just pasted.
Restart Visual Studio
Profit
Tested on Windows 10 / Visual Studio 2013 Ultimate
When I tried to create a class file in Windows Form in my Visual Studio it's creating .vb file and not .cs one. Not only in Windows Form but also in my MVC projects. Why it's creating .vb file? How do I change that .vb to .cs in all my projects. Did I select a wrong category while installing visual studio? If this question is not suitable to Stackoverflow.com can any one please migrate this question to appropriate Stack Exchange site.
Screenshot:
Because you started Visual Basic project.
In order to get files with .cs extension you have to create C# project solution.
You don't have to uninstall Visual Studio since it comes with "pre-installed" languages like VB.net, C#.net etc...
I created a project/solution in VS 2012. I open the same solution in Blend but it doesn't allow me to edit it in the designer - I only can edit the XAML directly.
I'm lost. What's going on?
EDIT: I read somewhere that Blend requires "Any CPU" - I verified that this is set.
EDIT2: It works with .NET4.0. Does this mean that .NET4.5 is not supported?
Yes. It needs the blend for vs2012 preview in order to edit it, however .xaml and .xaml.cs files don't really have any difference between .net4 and .net45, so there isn't anything to stop you creating a solution in vs2010 and including the same files, so that you can use blend to edit it.
My VS2010 install has WPF Browser application project template, and WPF User Control lib template, but no WPF Application template. Any suggestions would be appreciated.
For me I was missing ProjectTypeGuids in the .csproj file (a new project worked for me so just compared the project files), so if you add this to the .csproj file under PropertyGroup I then had all the WPF types available for adding:
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
This is kind of an old question, but I just hit the same issue and found the answer after the above didn't help, so....the solution for me was that I had to select a higher framework version (4.0) before the WPF Application template I was looking for became visible. If you find that you don't have the WPF or other project templates you expect available, you may want to check that you've selected the approriate framework version from the drop-down list immediately to the right of the "Recent Templates" label in the Add New Project dialog (it's near the top-left of the dialog in question).
This issue is a lot older than Visual Studio 2010. It goes back to 2005 at least. Lucky you, I was missing the New Class template once.
According to a bunch of sources, this trick works:
If you are missing a template that comes with your installation, run devenv.exe with the /installvstemplates switch.
You'll need to exit out of all Visual Studio instances for this to work.
The trick is mentioned in the MSDN documentation:
http://msdn.microsoft.com/en-us/library/0fyc0azh.aspx
Thread on the issue in a previous version of Visual Studio: http://social.msdn.microsoft.com/forums/en-US/vssetup/thread/8a5ae9e3-be7b-493d-831c-1e49e8103f26/
I wound up uninstalling and reinstalling my Visual Studio entirely but this trick probably would have fixed my problem.
Just had this in VS2017 Community Edition. This discreet message to add missing templates helped me:
In VS 2017
Make sure that you have .Net Desktop Tools checked in you VS
https://developercommunity.visualstudio.com/content/problem/44429/missing-wpf.html
For .NET 5 (or newer) is needed to have in .csproj in xml path Project/PropertyGroup:
<UseWPF>true</UseWPF>
I would like to know if there is a way to simply turn of the WPF design surface in Visual Studio 2008. I would like to have the xaml editor, but not the design surface as it slows down the IDE, when I try to open a XAML file. For my workflow having only the source files for xaml would be a better fit as I am doing all visuals in Blend.
Tools->Text Editor->XAML->Miscellaneous uncheck Always open documents in full XAML view
alt text http://www.dolittle.com/blogs/einar/WindowsLiveWriter/DisableXAMLdesignerinVisualStudio2008_118F4/image_2.png
The comment below informs of a catch when using this checkbox, that is it only affects files that have not been opened before. A solution from the link to the Microsoft Connect issue in the comment states that
If you really wish to reset the
open/close behavior for all XAML files
in your project, you can achieve this
by closing Visual Studio, then
locating the SUO file adjacent to your
SLN file and deleting or renaming it,
then re-opening Visual Studio. When
you re-open your solution an new SUO
will be created and all files will be
treated as "new". Please note this
will also remove any other
solution-specific IDE behavior for
your solution.
You should be able to right-click the .xaml file and select "Open With..." then select "Source Code (Text) Editor" (optionally clicking "Set as Default" to make it the default). This will open the file in the plain XML editor (you still get syntax highlighting and IntelliSense, too).