Using Codeplex templates in WPF - c#

I had created a basic application using Visual studio 2010. To modify the existing look and for improving GUI, I tried browsing for templates and found Codeplex. And then downloaded an exe & installed it.
No clue regarding what should be done after that! checked out the visual studio project settings. Nothing regarding templates.
I am new to WPF. Any ideas how to proceed ? There are many articles around stating that the themes can be found in codeplex but none about how 2 use it.

Do you mean the WPF Themes?
Please check the link
http://wpf.codeplex.com/wikipage?title=WPF%20Themes

OK Guys, Lets take this one step at a time. After crunching hours, I did apply the Codeplex template to my project.
(This may sound simple for others.(anyways for the sake of beginners like me!)
First,
1) Right click the references tab (found under the solution explorer of your project).
2) Click "Add Reference" and navigate to the 'Browse' tab and choose WPFToolkit.dll
3) This is the trickiest part. For this, download the WPFToolKit.msi from codeplex 1 Link.
4) You will need .net 3.5 sp1 framework for this.Refer to my answer at 1 Warning here
5) After successful installation, you will be shown nothing except the installation status.
6) So now, for the WPFTookKit.dll browse your program files. For me, it was found in "C:\Program Files\WPF Toolkit\v3.5.50211.1"
7) After this has been done, follow the next step of adding the xaml file to your project.
8) As Oleg said, right-click on the project in the Solution Explorer, choose Add --> Existing File and select the appropriate .xaml file (In my case I used a expression dark template from here )
9)Now double click the App.XAML file and under add the following entry [] without '[' and ']'.
10) Refresh MAINWINDOW.XAML and by this time, your theme should have been applied.

Related

Why cant I find my .csproj file

VS 2013. Following on from my previous Q of not being able to edit a file without causing a crash Edit a cs file and the project wont build seems to be a csproj issue.
I have followed the instructions I found:
To edit a .csproj (or any other project file) directly from Visual Studio, do the following:
Right click the project in Solution Explorer
Select "Unload project"
Project is now unloaded
Right click the project again and select "Edit blah.csproj"
Make your changes and save them
Right click the project and select "Reload project" to apply the changes
However unload project is not available (please see image)
why is this?
I Have done a complete search of the folder and .csproj does not exist? How is this possible
Potential answer, at least for VS2022
Here's the Solution Explorer view of my current project (super-retro RogueLike console game in C#)
If I click on the top level of the solution explorer ("Solution 'RogueLike Tutorial' (1 of 1 project)"), I get the menu like you showed, with no Unload Project option:
But if I go one item lower in the menu, to "RogueLikeTutorial" (with the C# badge), I get the following menu, which is the one you were looking for:
No idea if that was the case almost 5 years ago in VS 2013, but finding your question and the comments helped me when I just ran into this issue in VS 2022. I hope this helps any future time travelers!

How To Fix Icon For InstallShield

I used to be able to create a setup project in Visual Studio, but now Microsoft has "improved" it and I'm wasting hours trying to get a simple project to someone else in my company. They need to upgrade their version of .NET or I wouldn't even use a setup. So after going through the pain of downloading their "improved" InstallShield and going through the pain of watching a video and setting all the parameters I tried to build the Setup project and it says the icon isn't valid. "Screw the icon. Let me deploy my project." The actual error message is "Cannot extract icon with index 0 from file ..." It doesn't matter to me if this uses a standard icon or no icon, I just want the user to be able to test this project.
So, what is the easiest way to get this setup project in the hands of my user?
I solved this problem by adding a new icon to the project and re-compiling. You can do this by right-clicking on the project and selecting Add -> New Item -> Icon File. Then assign that icon file under the Project -> Properties menu item.
Simple Solution:
At the time of Installation Wizard, while missing the reselection of
the Image / Icon for shortcut after we have browsed the resource path.
Missing this causes this index error (please refer screenshot). after
re-selection rebuild is required this solves problem.
Simple way to fix this error :
Right click on your project- go to properties-application tab-in application tab set icon to your project in Icon & Manifest option

Cannot get Reharper 9.1 Move to Resource refactoring to work

I get this error message when I try to apply the Move to Reource refactoring to a string in a razor file:
"This project does not contain an available resource file"
I have tried added ressource files by adding new item, and also by adding in the project settings dialog. and building etc. All to no help. What is the problem?
I am using JetBrains ReSharper Ultimate 2015.1.1 Build 102.0.20150521.123255
ReSharper 9.1.20150521.134223
in Visual Studio 2015 rc in an ASp.NET MVC 5 project.
Any suggestions how to make this refactoring to work?
Open the .resx file with your "Managed Resource Editor" (the default), look at the top of the screen. There's a dropdown called "Access Modifier". Set it to public. Done.
Bart Van Meerbeeck's answer didn't work for me for the identical issue, though it definitely is the best answer. In MY case, however, the problem was me.
I was working in a large solution, and the file, in which I was attempting to do this refactoring, was located within a completely different project than where my Solution Explorer was scrolled to at the time. Upon realizing this, I created the resources file in the respective project, and all was well.
So, to others who may run into this, simply click your "Sync with Active Document" button in Solution Explorer, to jump to the project for which file you're editing, and you won't feel dumb like I do. :)

C# Debug - cannot start debugging because the debug target is missing

I am fairly new to C#..
I am using Visual Studio 12, the source I am using was last edited in VS 12.. But my problem is that it's throwing me this error:
First of all, my computer username isn't Martin, it is Administratoring - The creator of this project is Martin.. So that's where I guess it's coming from, but I don't know how to fix this.
I have tried editing in Project > Properties > Build > Output Path - And it still doesn't work. I am not too familiar with C#, and I've spent some time searching up for a solution but can't find it anywhere.. Probably because I don't know what I should be searching up (I've tried searching keywords and quotes from the error, but still nothing)
Try these:
Make sure that output path of project is correct (Project > Properties > Build > Output path)
Go in menu to Build > Configuration Manager, and check if your main/entry project has checked Build. If not, check it.
For those with this kind of problem - another solution:
Pay attention also to Warnings when you build solution. For example, I had referenced a dll built with higher version of .NET (4.5.2) than my main project (4.5)
After I referenced a dll built with 4.0 build process was successful.
Please try with the steps below:
Right click on the Visual Studio Project - Properties - Debug - (Start Action section) - select "Start project" radio button.
Right click on the Visual Studio Project - Properties - Debug - (Enable Debuggers section) - mark "Enable the Visual Studio hosting process"
Save changes Ctrl + Shift + S) and run the project again.
P.S. I experienced the same problem when I was playing with the options to redirect the console input / output to text file and have selected the option Properties - Debug - (Start Action section) - Start external program. When I moved the Solution to another location on my computer the problem occurred because it was searching for an absolute path to the executable file. Restoring the Visual Studio Project default settings (see above) fixed the problem. For your reference I am using Visual Studio 2013 Professional.
I had the same problem and unfortunately non of above answers worked for me . the solution that worked for me is :
right click on your startup project and select Properties - Debug and change "start external program: " to the correct path
Done!
Switch Target framework to 4.5.2 or something higher and bring it back to your original version (example: 4.5) then when you build, it will work.
You are not set the startup project so only this error occur. Mostly this problem occur when your working with more project in the single solution.
First right click on your project and "Set as Start Up Project" and/or right click on the start up file inside the selected project and click "Set StartUp File".
I also get this error quite often.
I solve this by modifying the code (doing a very small change), saving it, then building the solution again.
In my case I had added a project to a solution manually, where that project was targeting a higher .NET version than the rest of the projects that were referencing it. Strange... there would normally be a somewhat more verbose, literal and descriptive error in such cases.
There wasn't a real error but there was a warning that said as much.
Go to Project > properties > Debug Tab and set the Launch to "Project"
I had the same problems. I had to change file rights. Unmark "read only" in their properties.
So... it’s mid 2021 and I’m using visual Studio 2019 (version 16.10.2) which is the current version available, on a windows 10 pc.
I had to start a new project and following this steps solved the issue;
When at the menu that says “Create new project”
After you’ve selected your project template it takes you to another menu that says “Configure your new project”
On this menu there’s an option that says “Place solution and project in the same directory”.
By default this option was not checked, so I checked it and it solved the issue.
I had the same problem with visual studio 2015 , and I found that there is reference is marked so I just deleted it , maybe you can delete this reference or reinstall it again
What solved it for me was deleting the line
<ImplicitUsings>enable</ImplicitUsings>
from the project property file. It caused Visual Studio to generate a (useless) file with multiple global using directive.
I faced the same problem , but in my solution i had many projects so in the solution configuration the start up project was by mistake a class library i changed the startup project and then i worked like a charm
right click on the sln => common proprties => choose right startup project .

Unable to access 'Build Action' property for .cs files

i got a problem with my site with my app_code files and a lot of question ive read people say you need to change the proprties of the .cs files to Build Action.
by right clicking the .cs files and press proprties.
but...
when i right clicking the files i cant see any option called proprties so i press F4 and it open a proprties window and i just click on the .cs file and still cant see any option i can change somthing to Build Action.
any idea why i cant see this options?
EDIT:
my problem is that when i get in the file proprties i have only 2 options...
thay are called:
1.Full Name
2.Full Path
EDIT2:
here what i see in visual studio 2010 when i try access the protrtie menu/window
http://img338.imageshack.us/img338/2359/blac.png
As Microsoft points out in the article "Web Application Projects versus Web Site Projects":
Web application projects use Visual Studio project files (.csproj or
.vbproj) to keep track of information about the project. Among other
tasks, this makes it possible to specify which files are included in
or excluded from the project, and therefore which files are compiled
during a build.
An answer to a similiar question at CodeProject's forums reveals a hint. Abstract:
[...] Looks like you are working on a web application that is actually a
Website as per Visual Studio. You would need to create a new Web Application
and probably copy over the source files there. [...]
http://www.codeproject.com/Questions/173637/Setting-Build-Action-for-Files-in-App_Data
Have you tried this:
You say you haven't got the option being suggested by other posters.
If this is the case, than it is quite possible that your Visual Studio settings are corrupt; this can give rise to all sorts of odd behaviour.
I would suggest you reset your settings, but please be aware you will lose any custom IDE settings that you've previously applied.
Try this:
In Visual Studio, go to Tools->Import and Export Settings
Choose "Reset All Settings" and click Next
Choose to save your current settings if you wish, or select "no" and then click next.
Choose the collection of settings( he IDE preset) you want, probably "Visual C# Development Settings"
Visual Studio will now revert all settings. Hopefully this will make the Build Action reappear.
[EDIT]
It might be worth trying safe mode too.
To do this, start up a "Visual Studio Command Prompt" from your start menu/programs list in Windows, and start Visual Studio with
devenv.exe /SafeMode
Does this make the options appear?
You can copy the file from Windows Explorer and paste it in the Solution Explorer. It will replace (or do nothing but incorporating it in the proj file) the file and recognize it as C#.
Normally you should see a Property named "Build Action" in the first line of the Property Window. This property should be set to "Compile".
Please select file and right click on it so that you will get following screen
Than click on the Properties you will get following screen
You can find build option in as a first option.

Categories

Resources