how to convert .sou file to .sln - asp.net

I downloded asp.net file but it shows in .sou extension it is not opend in my vs2008 how can i convert .sou file to .sln

The .sou file isn't the equivalent of a .sln file. They do different things.
In your Visual Studio go to File -> Open Website and navigate to your folder instead.

You can't. .sln files store completely different data than .suo files.
From MSDN:
.sln: Organizes projects, project items and solution items into the solution by providing the environment with references to their locations on disk.
.suo: Records all of the options that you might associate with your solution so that each time you open it, it includes customizations that you have made.

Looks like the .sou file and .sln files ccontain different info. See descriptions here
http://msdn.microsoft.com/en-us/library/xhkhh4zs.aspx It won't contain information that can converted.
The best way is to create a blank solution file and add the existing projects to it one by one.

Related

Choose ASP.NET .sln (one time) save directory

When creating a new asp.net web site, Visual Studio automatically saves the .sln file and .vs directory in C:\Users\Me\Documents\Visual Studio 2015\Projects\Site_Name after I've specified, say, c:\Users\Me\My_Websites\This_Website\ as the directory for the website.
How do I either get the solution to work with the website after copy/pasting the .sln and /.vb into the same directory as the website, specify the save path of the solution so that it's in the same directory, or get the solution and the website into the same directory somehow?
I don't want it set a new default directory, because I'm a student, and have a lot of projects on the go at a time, and I have to zip them up hand them over for marking or to a group member in a project, and also it seems to make sense to have them together.
You could:
Start with a Blank Solution
First create a blank Solution, which you can save anywhere you want in the file system.
File > New Project > Other Project Types > Visual Studio Solutions > Blank Solution
Then just add new Projects to the Solution in the same Solution folder (in reality doesn't have to be, but that's not what you want, and it if at some point, you'll go with some source control, keeping things organized this way will save time/work/headaches)
If you have existing projects you can copy the entire existing folder structure of the project (including the all important .csproj or .vbproj file, into the newly created Blank Solution folder, and instead of Adding a new project, Add and existing project and select the .csor.vb proj files.
If you're just experimenting, I'd advise you to just Copy first (instead of Move) so you can always go back to a "working" state.
Note: you don't actually have to copy the existing .sln file for these existing projects. It won't really harm anything, but it will save confusion once you view the folder structure in Explorer/Finder (so you don't have a bunch of .sln files).
You can try experimenting and examine how VS creates the folder structures (Projects under Solutions), and if you're comfortable, you can
Edit the .sln file
You can edit the .sln file itself in any text editor - you'll see the projects referenced according to its relative location to the .sln file.
Do this with VS closed (or at least no solution opened)...
e.g.
These show 2 projects in the Solution
Microsoft Visual Studio Solution File, Format Version xxx
....(skipping for brevity)...
Project("{A GUID}") = "The Project Name", "SomeFolder\MyProject.csproj", "{A GUID}"
EndProject
Project("{Another GUID}") = "Another Project Name", "SomeFolder2\AnotherMyProject.csproj", "{Another GUID}"
EndProject
Hth.

Directory not published

I have a little problem and I don't find any solutions.
In my asp.net web application, I have a directory in the solution with some xls files.
When I make a publication, I hoped that the directory is in the source files rendered. But the directory isn't there and I have to copy/paste it manually.
The problem is that I forget to do it regularly. Can I tell to visual studio to add this directory to the sources?
Thanks for help.
Right click on the files in Solution Explorer and select Properties. Then in the Properties grid, set the build action to Content. This will copy the files to the build output.

recover project in visual studio 2010

i have 4 project in my solution, framework , domain objects,business objects and website ...
but this morning website project couldnt be loaded... when i tried firsttime to open solution... "The solution file has been modified outside the enviroment" message seemed and press reload then error is project file is corrupted... how can it happen... how can i fix this...
thx..
One way... if its from some source control , get the latest and leave the changed part by you.
If you dont have any source control then you can have the two options
- Create a new solution and add all your projects to it and rebuild it. Check for the errors.
- If your code is completely corrupted and files are unreadable, that is unrecoverable,
then you must have to follow this
copy the projects dlls out of bin
dir,
use red gate reflector and extract
all the class file in new project
file.
Now for aspx.cs you can create a new
project add all aspx file in that new project and also the
new cs files generated by the reflector addin. Do it for all pages. When done , right click on Project of web app(if its), then choose convert to web application. Also check the Page header of each page that they are using the same class files.
I know this is little bit tough , but will work....to recover almost that much code, when your app was last compiled.
Note : Also you will have to maintain the hierarchy of the project as the reflector add in (FileGenerator on Codeplex) might miss the actual project hierarchy.
You can open your solution file (.sln) in notepad and check for the consistency of the document.
The sln file will be in a hierarchical structure (like we have an xml).
You can also open csproj files of different projects that you have in the solution check the xml of the csproj.

Question On Temporary ASP.NET Files

Have a question on "Temporary ASP.NET Files" folder; I have bit knowledge on what this folder is for as outlined by another thread in this forum
What is the "Temporary ASP.NET Files" folder for?
But recently, I am getting a warning while trying to build my new project as below
'c:\WINNT\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\some folder\filename.cs' conflicts with the imported type ... using the one ...
Looks like that, two copy (shadow copy) of the same class (.cs file) file exist in two different version of temp folder and hence it's confusing as to use which one.
My Question is: Shall I go ahead and delete all contents from "Temporary ASP.NET Files" folder? Is there any side affect if I do so? Please let me know.
Thanks,
Rahul
If you close all of your instances of VS 2005, you can delete all of the files/folders within this folder. This folder is exactly as it's named -- Temporary. It loads all of the instances of your compiled files as they enter memory when they're loaded for a website. When you perform a "clean" on your solution it is supposed to empty the files in the folder relating to your open solution.
If you empty out your files and you continue to have this problem, then the problem will be related to how you have referenced projects and third party libraries within your solution.
If you take now your project, put it in a zip and send it to a friend, than he doesnt have the temporary folder for that project, and can build it too... So your main stuff should be in the project directory itself. Have you everything saved properly? Than close your Vs and clean the mess. (99% sure)
Have you tried to Clean your solution/project and recompile? That would only remove the compiled/temporary files associated with that project.

"Add as Link" for JavaScript files returning 404 in debug

Using a Visual Studio 2010 ASP.net web application, I have several projects that share some JavaScript/css files. The most logical way for them to share these files is to place the files in a single folder and each project has them included with the "Add as Link" option. However, if I add the files this way when I'm debugging using either the Visual Studio Development server or debugging using a local IIS web server all requests for these files return 404 Not Found errors. If I publish the site then the files are copied but that obviously doesn't help with debugging.
Is there something I'm missing or is this a failing on VS's part?
To overcome this problem some time ago I created a 'MSBuild.WebApplication.CopyContentLinkedFiles' nuget package. This package adds MsBuild target which copies all content files added as link to project folder during build.
Note: if you use source control then it is better to add copied files (from Web Application folder) to ignore list.
I wouldn't really call that a failing, since you asked for that behavior in the first place: linked items in Visual Studio projects are actual links to external files. Those files can reside anywhere on the disk and are not copied into the project folder.
You might want to copy those files locally yourself during a pre-build event. That way, the files will remain synchronized and you won't duplicate them until your first compile.
The problem seems to be that the website runs right from your source folders, rather than from the bin folder. This means that the file will be missing, whether or not it is copied to the output folder.
It's probable that running from a local or remote web server would not have this problem, though I didn't get that working, and I'd rather not add IIS to my local machine if I don't have to.
Adding a pre-build copy command did work. Note that the current directory will be the bin folder. (You can use cd to echo the current directory to the build window if you want to see it):
If the file is in another solution, your command will look something like (three ..s: one to get out of each of bin, project, and solution folders):
copy ..\..\..\OtherSolution\OtherProject\Scripts\MyJSFile.js ..\Scripts\
If it's in the same solution, but a different project:
copy ..\..\OtherProject\Scripts\MyJSFile.js ..\Scripts
One minor issue is that the link to the file will collide with the new copy of the file, even if you don't add it to your project. As long as you make the link first, it seems to work. If you copied the file first, you'll have to manually delete the copy, and then refresh the solution explorer before before being able to add the link.
Select the link in Solution Explorer and then look at properties window and set Copy To Output Directory to Copy Always. Linked items are set to Do Not Copy by default.
BTW, you can copy many files as links very easily directly from Solution Explorer when using VSCommands 2010 extension.
See this blog post about a simple addition to your project file.
http://mattperdeck.com/post/Copying-linked-content-files-at-each-build-using-MSBuild.aspx

Resources