C# MVC Solution? - c#

I have recently been tasked with updating a system done in C#. I am coming from a Kohana MVC web based development but have experience in C#.
Problem is: My solution is in some 'weird' namind convention. I would like to know what it could be and how to load the solution in VS 2010 Ultimate.
MySolution.BusinessLogic
MySolution.Common
MySolution.Contracts
MySolution.DataAccess
MySolution.DatabaseInstaller
MySolution.Entities
MySolution.Reporting
MySolution.UI
MySolution.UIControls
How does this work? Do I need to edit each folder separately or there is a way to load the whole solution in my developer IDE?

There should be a .sln solution file, probably in the project root folder. That is typically what you would open in Visual Studio. You can open individual project files (.csproj), but its much easier/better to work with a solution that contains all required projects.

Related

how to make a standalone exe file

I started learning c# a couple days ago and want to send my first program to my friend but as a standalone exe file that can be shared through google drive.
I've found several solutions but I coudln't understand any of them. Is there a simple solution to compile an exe file or a standalone app in visual studio 2019 that would just work when you open it
One annoying thing with .NET Core is that when you build it in Visual Studio it makes lots of separate files, which is annoying for portability.
A fix to this is to right-click on your project in Solution Explorer and click Publish. Select Folder Profile, give it a name and save it.
After that, you will need to edit the target runtime option, and set it to win-x86. After that, you should see a dropdown box at the bottom of the dialog, expand it and check 'Produce a single file'.
Then you can hit Publish and it should produce a single file.
NOTE: This does not work in .NET Framework, only .NET Core.
All you gotta do is simply build the project within Visual Studio, once that's done. Go to your projects folder and go into bin/Release (or Debug if you've selected debug build)/myprogram.exe. It should make a standalone .exe file!
Maybe this could also help you.
Official Documentation: Compiling Building in Visual Studio

Creating Sharepoint Web Part manifest file and dwp files

Could anyone please help me to understand the following for creating Sharepoint web part please?
Manifest.xml
a. What is the purpose of this file?
b. What happens if we specify the wrong *.wpd file as below?
<DwpFiles>
<DwpFile FileName="WebPart1.dwp"/>
c. How do I create file in Visual Studio as I can't see any template
*.wpd
What is the purpose of this file?
How does this loads the proper dll?
How do we create using Visual studio, any template exists?
If we have webpart project and it references to the dll on another project. Does another project's dll has to be signed?
What are the best mechanisms to deploy the Sharepoint Web Parts?
I use the WspBuilder Visual Studio templates. They are a little quirky but it makes creating the structure of SharePoint projects very simple.
It uses the convention of following the SharePoint folder layout for specifying file locations in the project. Take a look - it might help you get moving. Note there are two versions - one for Visual Studio 2008 and a beta for Visual Studio 2010.
To try to answer your specific questions:
If the file can't be found, no action is taken. It's an error but not one that will bring down SharePoint.
I thought WPD was the old package style. Maybe I'm wrong on this?
Should be same as WSP - a package containing files to be deployed.
Whatever DLL is contained in the package is deployed to the GAC if it's signed.
Take a look at previously mentioned WSP Builder project.
Anything that's loaded by SharePoint and leads to rendered content needs to be signed and possibly added to the SafeControls entry in the web.config (deploying WSPs created from WSPBuilder does this automatically)
"stsadm -o addsolution" then use Central Admin to deploy or continue with "stsadm -o deploysolution"

Visual Studio Multi-Project Solution Options

I have a VS2003 solution with 21 ASP.NET 1.1 projects in it. My goal is to eventually migrate them to 2.0 and then 4.0. There are mainly internal admin apps for different departments.
I want to create a multi-project solution now in VS2010 and migrate/re-code these one at a time in ASP.NET 4.0 Web Forms in VS2010. There will be some artifacts common to all projects such as CSS, scripts and images. Could the use of Resources help with the common files and would it be possible to have a single master page for all projects?
What are the best options for creating a multi-project solution here?
From what I understand, your goal is to share resources like CSS, JS files across projects. One way to do it would be to use linked files in Visual Studio. We do it extensively in one of our solutions where we share many class files and signing keys acorss projects. Linking files basically involves putting the files in one project in the solution and then linking to them from other projects of the solution.
You have to be a little careful though during deployment of projects containing linked files as linking the file does not physically copy the file to the destination project. So even if your project has a css folder, the linked file shown under that folder in VS is not physically there in the directory structure on the disk . If you link classes, the dll for the project that has the linked class file will include the linked class, but for resource files like css, JS and common masterpage, they will not be copied over when you deploy. You can leverage build scripts or some simple batch files to handle those issues. This should solve your problem.
Why not just convert them directly to .NET 4.0?
Beware when you move them to .NET 2.0 that the default project type in Visual Studio 2005 changed from the type of project you're used to in VS2003 to "web site" projects. But with Visual Studio 2010, you've got the same Web Application Project you're accustomed to, so why not just go there directly?
Also, be aware that VS2010 can target .NET 2.0 applications, so there's really no reason to stop there.

Can I work with Visual Studio Project and Solution files in a team using Subversion?

We're a team of students doing a software project. As some of us don't use Windows, but the product needs to run on Windows and .NET, we want to develop on MonoDevelop and Visual Studio which both use Visual Studio files; language of choice is C#.
My question is: Can we check in the solution and project files into our repository without the possibility of severe conflicting problems? Example: Two guys add a new file to the same project, save and commit their changes. Will the project file get a conflict?
SVN works great with Visual Studio and the related Project/Solutions files. The Project files are just XML and the Solution files are a structured text file. If changes are made to the same project/solution file from two different people the second person will get a conflict notice. Warning, it can be tricky to merge project and solution files. Sometimes it's easier to just toss the changes and add the files back manually then check in again.
You could try Agent SVN plugin. It integrates with VS 2005, VS 2008 and VS 2010 and it also has a import wizard feature that makes it easy to import the solution and all project files into the SVN repository.
I use this free Visual Studio plugin http://ankhsvn.open.collab.net/ for working with SVN repo ...
VisualSVN integrates well into VS.

Do I need the bin\debug\appName.vshost.exe and appName.vshost.manifest in my SVN code repository?

I am building an application which is based on a sample application,
written in C# on .NET 2, and is built on VS2008. This application is mostly a wrapper for a COM application.
However I compile it in .NET 3.5.
The sample application came with the following files in it's bin\debug:
appName.vshost.exe
appName.vshost.exe.manifest
I noticed that I can delete the files and VS re-builds vshost.exe, and the vshost.manifest file appears with modification date the same as the deleted file as if VS has copied in from somewhere.
My question is, should I put this files in my SVN code repository?
Those two files you list implement the Visual Studio "hosting process". It is a hosted version of the CLR, designed to improve the debugging experience. It takes care of some security issues, the most visible side-effect is that it redirects output written with Console.WriteLine() in a GUI app to the Output window.
These files are not part of your project and do not get deleted when you use Build + Clean. In fact, you cannot delete the .exe file, it is always running while you've got the project opened in Visual Studio. You can disable the hosting process feature with Project + Properties, Debug, scroll down, "Enable the Visual Studio Hosting process" tick. There's no compelling reason to do so.
There's no need to check these in, Visual Studio re-generates them when you check-in a project and load it in VS. In general, you never need to check anything in from the bin subdirectory, its content is always re-created by building your project.
Everything in the debug (or release) folder is generated. Everything that's generated shouldn't be checked in.
When in doubt, just make a fresh checkout to some other folder (or even machine), and try to build from that. If something is missing, this will find it.
I do not think you should. They are for VS use only.
Here are the files I ignore when creating C# projects. You really only want to store the source code in the repository and not the outputs. Similarly you probably do not want to store the user based information that goes along with VS solutions.
*.csproj.user
*.suo
bin (folder)
obj (folder)

Categories

Resources