How I change Project Solution Name in windows application? - c#

I made a project in Name "Project1". Now I want to changed full project named "Project2".
All code working fine. But when I create SetUp then file name Shows "Project1". How I renamed this?

right click the project
go to properties
go to application tab
change the assembly name
You can also change the assembly information using the button on the same page if you would like everything to tie up

Try right-clicking the project and select Rename from the context menu.

Related

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

Open a xaml page from one project in another project in the same solution

I do appreciate any help with this. I have a C# solution called Public Library with different projects in it. One project is called Books.View that I'm working on where this is the main page that loads upon startup and the user does data entry and other tasks from those pages and the other project is called Menu. The Menu project contains application settings that the admin will be able to make changes. I have added a Settings button to the MainWindow.xaml page which is located in my Books.View project and I would like for it to open the MainSettings.xaml located in the Menu project.
I have searched on here the different questions regarding similar questions such as:
How to navigate to another project inside same solution
Redirect to another page in different project of same solution
It mentioned adding a reference, so I added a reference to Books.View project to the Menu project.
I tried the following code in my settings button in the main project Books.View:
NavigationService.Navigate(new Uri("/Menu;/MainSettings.xaml", UriKind.Relative));
Then I receive an error stating that an object reference is required for the non-static field, method or property ‘System.Windows.Navigation.NavigationService.Navigate(System.Uri)’.
Any assistance with this would be appreciated.
Thank you
Review the URI scheme references for XAML in MSDN.
As you are referencing XAML from a separate project, you will have to use fully qualified URI. Assuming your other project Assembly name is Menu, it should be something like:
NavigationService.Navigate(new Uri("pack://application:,,,/Menu;component/MainSettings.xaml", UriKind.Absolute));
Above is based on the reference for XAML URI in separate assembly (which is documented in the msdn link):
pack://application:,,,/ReferencedAssembly;component/Subfolder/ResourceFile.xaml

Merging Two Projects and accessing files from each other in Visual Studio

I have merged another project in my existing project by right-clicking on the project name and selecting Add->Existing project option. Now i wan't to access the files from my newly added project from the existing one in Visual Studio (Its a C# project) , how can i do this?
If I'm following your question, you had a solution with a project A. You then added an existing project B.
You now want to access a file from A in B. If that's the case, right click on the B -> References and add a reference to project A. Now you can use the files from that project.
Edit: From your comment, I'm not sure if you want to have a separate project / file. If you want them to be only 1, you shouldn't really add a new project, you should add to your project A the files you need from project B. If you want to keep it as a different module that is included, then the above holds, but you need to realize that usually you have one solution, with many projects inside of it.
I struggle with this until I found this the link is below:
If you want all windows application to run as one program rather then calling multiple .exe. Then change 'Out Put Type' of each project to 'Class Library'.
Step 1:
You can do that by right-clicking on each Project in solution -> Go to Properties -> Application -> Out Put Type... set it to Class Library
Once you have done that output of these will be generated as .DLL.
Step2:
Add a new Window Form application project, add reference of exiting projects in it so that they can be executed from here.. you can do that by.. right click on main project-> Add Reference->Projects select all existing projects from here.
Now on the main application, you can create 3 buttons to launch each project...
[Inventory]
[Accounts]
[Payroll]
Now in each button code will be something like that...
Inventory_click()
{
Inventory.MainForm frm=new Inventory.MainForm();
frm.show();
}
Credit goes to forum post

A project with an Output Type of Class Library cannot be started directly

Please can someone could explain why I get this error and what to do to fix it (or what I'm doing wrong!). The steps I have taken are
Download Source code from http://www.codeproject.com/Articles/16859/AForge-NET-open-source-framework
Opening in VS2010 shows the references cannot be found
Re-Add all 3 references from PlayingCardRecognition\bin\Release so no further warnings
When I try and build or Run I get the following message
To fix this issue, do these steps:
Right click the Project name in Solution Explorer of Visual Studio
Select Set as StartUp Project from the menu
Re-run your project
It should work!
If it did not work, be sure that you have set your start page. If your project is C# Windows Application or C# Console Application, try this:
Right click the Project name in Solution Explorer of Visual Studio
Select Properties
Select the Application tab
In the Output Type drop box
Select the correct application type of your project
Re-run your project and let me know if it won’t work.
The project type set as the Start-up project in that solution is of type ClassLibrary. DUe to that, the output is a dll not an executable and so, you cannot start it.
If this is an error then you can do this:
A quick and dirty fix for this, if that is the only csproj in the solution is to open the .csproj file in a text editor and change the value of the node <ProjectGuid> to the Guid corresponding to a WinForms C# project. (That you may obtain from a google search or by creating a new project and opening the .csproj file generated by Visual Studio to find out what the GUID for that type is). (Enjoy - not many people know about this sneaky trick)
BUT: the project might be a class library rightfully and then you should reference it in another project and use it that way.
.Exe's and .dll's are both assemblies. The key difference is that executeables define an entry point Main which can be invoked by the runtime. The error
"Class library cannot be started directly"
is due to the fact that said .dll's do not have a Main. To fix this issue, change the project type to a Windows application/Console application and define an entry point. Or, add a new project that is of type Windows application/Console application and reference said .dll.
The project is a class library. It cannot be run or debugged without an executable project (F5 doesn't work!!!). You can only build the project (Ctrl+Shift+B).
If you want to debug the code add a console application project (set it as the start up project) to the solution and add the reference to the library.
The project you downloaded is a class library. Which can't be started.
Add a new project which can be started (console app, win forms, what ever you want) and add a reference to the class library project to be able to "play with it".
And set this new project as "Startup project"
The project you've downloaded is a class library, not an executable assembly. This means you need to import that library into your own project instead of trying to run it directly.
Your project type is a class library one would suspect, add a ConsoleApplication or WindowsApplication and use that as your startup object. Reference this project and then access the code.
If you convert the WPF application to Class library for get the projects .dll file.After that convert the same project to the WPF application you get the following error.
Error:".exe does not contain a static main method suitable for an entry point".
Steps to troubleshoot:
1.Include the App.xaml file in the respective project.
2.Right Click on App.xaml file change the build action to Application Definition
3.Now Build your project
Goto the Solution properties -> on Build right side you see the startup project type. here you need to select the console appication/windows appication.
If you got this issue (got it in Visual Studio 2017 RC), and you don't get any of the things listed by Mak post from step 3 onward "4 In the Output Type drop box....", it is because you made a Class Library app when you want to create a cross platform app, so here is the solution :
1 Start a new project
2 select Visual C# and cross-platform app.
3 select cross-platform app (Xamarin and native app)
4 select blank form.
From then , right click, select as startup project and build as mentioned by Mak, and it should work.
If you can afford to start from scratch, it could do the trick as it did for me.
This could do the trick for the main issue as well, but must be adapted to your current version of Visual Studio ("Xamarin.forms portable" for visual studio 2015 for example).
Bye!
VS -> Debug -> Attach unity debugger -> double click project
Set your api project to a startup project:
Right click the api Project than choose Set as startup Project.
Just right click on the Project Solution A window pops up. Expand the common Properties. Select Start Up Project
In there on right hand side Select radio button with Single Startup Project Select your Project in there and apply.
That's it. Now save and build your project. Run the project to see the output.
_Sarath#F1
To fix this issue, do these steps:
Right click the Project name in Solution Explorer of Visual Studio
Select Set as StartUp Project from the menu
Re-run your project It should work!

Using .dll file in asp.net application

I'm working on asp.net (web application). I have to use time picker control in my page. Hence i downloaded 'time picker.dll' file from some website. I need to integrate this 'dll' file into my project. can anyone pls guide me in the same?
You would add it as a reference in the project. Right click on VS and add reference and browse to it.
In your file include a using statement for the namespace of the DLL and then you should be able to instantiate a new object.
Copy the "time picker.dll" into the Bin folder of your web-app and add <%#Register %> directive into your web-page to use that control.
Assuming dll package the typical ASP.NET server control, you have to add reference to the dll (VS Studio Project -> References -> Right-Click & Add Reference, Browse the dll file).
Next thing to do is to add the control on tool box by right clicking on the toolbox and selecting the control. Now you can drag the control on the ASP.NET Design surface. Alternatively, you can use the object browser to check the control name and use the register directive.

Categories

Resources