Hide or rename a NuGet package - c#

Is there anyway I can hide package name or rename it or put it another custom created package and call it.
I'm making a little application but I don't want the Package names to be show as their DLL files matching the name of package are also build with the solution in visual studio.
Is that possible? I'm new to C# , under php I could change the class name and file name as well and call it in another file but I don't know if its possible in C#

you can right-click the project in Visual Studio solution explorer. then change the assembly name. It will generate the DLL with the custom name.

Related

Where does WiX cache path names?

Following on from my issues with a simple Visual Studio Installer Package, I'm making the switch to WiX. The learning curve is annoying, because once I've set this up I'm going to forget how it works before I need to do it again next project. But anyway, here we go.
My environment is Visual Studio 2019 and Azure DevOps (the full TFVC). The projects involved are class libraries and a WPF application all written in C#. I also have the WiXWax extension thingy to give me a GUI for adding projects and dependencies quickly.
When I created my WiX project I stupidly included a typo in the name of the project and consequently in the underlying folders. When I noticed this I decided to fix it;
Unload the projects
Using the source control explorer, rename the folder
Using notepad, open the sln file and correcting the path to the project, and the project name
Using notepad, open the project file and correct its references to the path and project name
Rename the project files
As you can see I have changed every reference to the the incorrect spelling.
Unfortunately, Visual Studio won't load the project. I get an error telling me this:
C:(correctly spelled path that matches the file system and file names).wixproj
: error : The project file
'C:(path with a typo in it)(correctly spelled project name).wixproj'
has been moved, renamed or is not on your computer.
Now the message is partly correct, because the file it says has been moved or renamed has in fact been renamed. If I click on the error it opens the wixproj file (it's just an xml of course). This file doesn't have a self referenced location though, the only things that's close is the include to the projects which haven't changed and are correct (..<correct detals>.csproj)
I have opened every xml file including the solution files and wix project files and none of them contain the typo (Ctrl+F, case insensitive, not whole word - no results).
I have tried "Removing" the WiX project from the solution and re-adding it, but I get the same error and it doesn't add it to the solution file.
What is remembering the old path name, and how can I make it forget it?
edit: I've also tried Ctrl+Shift+F per Klaus' suggestion and it finds no references.

Renaming C# project to map to correct configuration

I have a created a C# console application that does something. Lets say its name is SampleTest. I use a config file named App.config in it. When I build this project, it creates files like SampleTest.exe, SampleTest.exe.config, etc. This is all fine.
My friend wants to execute this executable. So rather than sending SampleTest.exe and SampleTest.exe.config, I renamed the two files to DocumentManager.exe and DocumentManager.exe.config and gave it to him.
We noticed that this way, the DocumentManager.exe is not able to use the DocumentManager.exe.config file.
Please let us know what do I need to do in Visual Studio to this SampleTest project for it to generate DocumentManager.exe and DocumentManager.exe.config?
I tried renaming the SampleTest project to DocumentManager and building it but it still generates SampleTest.exe
Renaming the Assembly
Renaming the project on it's own is likely not going to be enough for what you are trying to accomplish. You'll need to ensure that you update the name of your assembly and namespace as well, which can be done through Properties > Application > Assembly name :
Changing the assembly name will change the names of your executable and .config files generated when building the project. It's probably worth changing your default namespace as well, just to keep things consistent.
You have to rename assembly. To fix this please do the following:
Navigate to project folder and find SampleTest.csproj file.
Open that file in some text editor like Notepad++. Find elements:
<RootNamespace>SampleTest</RootNamespace>
<AssemblyName>SampleTest</AssemblyName>
Rename their values into:
<RootNamespace>DocumentManager</RootNamespace>
<AssemblyName>DocumentManager</AssemblyName>`.
4. Build your project and you will see new DocumentManager.exe.config and new DocumentManager.exe files.
Or you can change Namespace and AssemblyName trough UI by navigating to Properties > Application > Assembly Name.

What is the easiest way to make a backup in visual studio 2013?

I want to make a backup from the whole project. I also need to rename every backup. I'dont like the way to copy the project folder and rename the folder and the project file.
I've already tried to make it like that:
http://jasonfaulkner.com/VisualStudioExpressProjectBuildBackups.aspx
But it doesn't work, I am always getting the error "Invalid parameters"
Does anyone already tried this?
Thanks
The DPack extension for Visual Studio includes the Solution Backup tool that creates a zip archive of the solution and auto names it.
Manually edit .sln file
This method is entirely aimed at renaming the directory for the project, as viewed in Windows Explorer.
This method does not suffer from the problems in the Remove/add project file method below (references disappearing), but it can result in problems if your project is under source control (see notes below). This is why step 2 (backup) is so important.
1- Close Visual Studio.
2- Create a backup of your .sln file (you can always roll back).
3- Imagine you want to rename directory "Project1" to "Project2".
If not using source control, rename the folder from "Project1" to "Project2" using Windows Explorer.
4- If using source control, rename the folder from "Project1" to "Project2" using the functions supplied by source control. This preserves the history of the file. For example, with TortoiseSVN, right click on the file, select TortoiseSVN .. Rename.
5- In the .sln file, edit all instances of "Project1" to be "Project2", using a text editor like NotePad.
6- Restart Visual Studio, and everything will work as before, but with the project in a different directory.
Alse would recommend TFS, a powerfull tool to do what you pretend. You will be able even to recover previous versions of specific files,if you have any error and you have troubles find it you can see what changes you did since last "check in " etc. There are many options

Visual Studio 2013 C# configuration settings

I want to add include directories and libraries in my c# project like i can in my c++ project
C++ Project : There are options to include directories and linker dependencies.
C# Project
There does not appear to be an option in the project settings to add those settings. I added the path in reference path, but my debugger throws an error. Right now i've added all the dll in my project\bin\debug directory and its working, but i don't want to do it for all the projects. Where i can link these diretories ?
you can add reference of library files which you want to add into your project by right clicking the project under solution explorer and then "add reference" and then browse or select from the list of dlls..
You can't. You have to include references to code files and assemblies one by one.
The linker and compiler for .NET works different than you are used to with c++. That's why you can't just link an entire directory containing some code files / assemblies.
Add reference to your existing dll for every project which will be use it
http://msdn.microsoft.com/en-us/library/7314433t(v=vs.90).aspx
https://www.google.it/search?q=add+reference+c%23&es_sm=122&source=lnms&tbm=isch&sa=X&ei=P-2fU472Bcr00gX-tYAw&ved=0CAoQ_AUoAw&biw=1920&bih=955

Compiling a number of .cs files

I'm a little bit stuck. I've just checked out an open source project from google code for something and it's a nice little C# code base.
However there's no solution file or anything. I'm not really sure how to compile it from here on as I've always worked within a solution.
I can't seem to find a solution online and was just wondering if someone could tell me how to compile a number of .cs files together to run, or how to create a solution from them.
Create a new project. You will need to decide whether it should be a class library, console application, etc. depending on what the open source project is supposed to be.
Right-click on the project and select Add -> New Item.
From the file dialog, select all of the .cs files you wish to compile.
If the project is not a class library, then right-click on the project and select Properties. Go to the Application tab and specify which class contains the startup object.
Build the project and see if it works.
Contact the project maintainers and ask them to include a proper project file. Offer to send your .csproj file if it works.
It's also possible to compile manually on the command-line with the C# compiler, but this would be more difficult.
Create an empty solution and add those files to an empty project [Need to figure out project type though].
If you project have .csproj file then create empty solution and add this project to the solution using .csproj file.
If you have'nt .csproj file then you have to figure out the the type of the project and then add these file to the project to make the solution.

Categories

Resources