Newbie quesiton about copying a solution

M

mahalie

I have been reading about how to copy a solution to another directory
on the list - I am a total newbie to .NET and need to try to update a
web app that was developed by the former web developer - so I don't
want to touch/break his original code!

Basically, I want to copy this:
http://server/webprojects/ProjectSearch/

and move it here:
http://server/webprojects/ProjectSearchUpdate/


I tried changing paths in .sln file - I can open the project and build
it but there's a server error message when I try to view an .aspx page
in it.

Server Error in '/' Application.
--------------------------------------------------------------------------------
Runtime Error
Description: An application error occurred on the server. The current
custom error settings for this application prevent the details of the
application error from being viewed remotely (for security reasons). It
could, however, be viewed by browsers running on the local server
machine.

The thing is, the web.config already has <customErrors mode="Off"/> in
system.web in the ProjectSearchUpdate directory.

Since that didn't work, I tried changing the GUID in the project file
using the tool in Visual Studio to generate one, and updated the same
number in the .sln file. No change (same error message as above).

Any clues? I've read a lot of solution/project copying woes on this
list but it's not working so far. I require very step-by-step sort of
explanations as, although I've hacked and coded for quite some time,
the .NET and VisualStudio way is really messing with my mind.

Thanks in advance!
 
M

mahalie

Since there has been a lot of activity on the list but no responses to
my query, I'm guessing that I either didn't provide enough info or this
is too basic a question to be bothered with.

If there wasn't enough info, it might be good to know that:

I'm currently using VisualStudio .NET 2003 and the web server in
question is a test server running MS Windows 2000 (IIS 5) and IIS and
..NET 1.1 framework.

In the case my question is too basic or bothersome, please consider
pointing me in a direction that will explain what I need to know. I've
done several product tours, intro's to .NET and VisualStudio and took a
week long course that covered, quickly, on all major aspects of
developing web apps on .NET. None of these resources have provided an
answer to successfully copying solutions so that all the original files
can remain untouched, all beginnig materials I've seen just start with
"create new solution/project" and continue from there.

I really appreciate any input on this matter.
 
B

bthomas71chevy

If I understand correctly, you just want to keep your copy and have
another copy.
I think the simples way is maintain 2 solutions.

Create a new Folder as you did, plop all your code in there, create a
blank Web solution and reference it to that new folder.

I think you were just trying to modify the solution file (ie. ".sln")
to make it point to the correct Project File (ie. ".vbproj") and leave
the GUID alone and that shouild work too, but then you don't have
access to your other Project.

HTH
Brent Thomas
Ohio
 
M

mahalie

What about 'Copy Project'? (Project, Copy Project).

Doesn't this create a non-linked copy of the entire project?
 
M

mahalie

I finally found an article that tries to explain what to do to copy a
project so you have a working copy that doesn't mess with the original,
here it is:
http://www.informit.com/articles/article.asp?p=28502&seqNum=5&rl=1

After proceeding with the instruction under 'Moving a Visual Studio
ASP.NET Web Application Project' my application still had errors. In
the end, it was a permissions problem because impersonation was set to
true and the account it was impersonating did not have permissions to
the .NET Temp files. I've included a detailed account of my process
and results for future newbies as I had a hard time finding an
explanation that I could understand.

Steps taken:

1. Opened solution of project I want to copy

(\\myservername\c$\Inetpub\wwwroot\webprojects\ProjectSearch\ProjectSearch.sln)

2. Highlighted ProjectSearch (the project) in Solution Explorer and
then selected Project >

Copy Project from the menu. The dialogue box shows
http://myservername/webprojects/ProjectSearch

as the source project folder and I entered
http://myservername/webprojects/ProjectSearchUpdate

as the destination project folder, using the File share web access
method and the path

\\myservername\wwwroot$\webprojects\ProjectSearchUpdate and selected
copy 'All project files'.

3. I closed the solution.

4. Using windows expolorer I opened ProjectSearch.vbproj.webinfo and
the URL path seems to

be correct:
<VisualStudioUNCWeb>
<Web URLPath =
"http://myservername/webprojects/ProjectSearchUpdate/ProjectSearch.vbproj"
/>
</VisualStudioUNCWeb>

5. From windows explorer I double-clicked the ProjectSearch.vbproj
file, which brought up

Visual Studio.

6. I with ProjectSerach now showing in Solution Explorer I selected
Build solution, which

prompted me with a 'Save As' dialogue box for the solution with a
suggested name

ProjectSearch.sln (in the same file as the ProjectSearch.vbproj). I
accepted this. And the

Build output was 'Build: 1 succeeded, 0 failed, 0 skipped'

7. I selected menu command Debug > Run and was warned to specify a
Start Page. I built the

project again, and recived an error message (full error message below
as error message 1):

Server Error in '/webprojects/ProjectSearchUpdate' Application.Access
to the path

"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET

Files\webprojects_projectsearchupdate\3890ab9b\9b033cb4" is denied.

8. I checked IIS to make sure virtual directory is configured as an
application. (It was)

9. I opened the web.config file and noted the following:
<authentication mode="Windows" />
<identity impersonate="true" userName="Corpdomain\ProjectSearchUser"
password="secretpassword"/>
I checked security on the directory both for the project and in the
temp files as indicated in the error message. The directory idicated
("C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET

Files\webprojects_projectsearchupdate\3890ab9b\9b033cb4") didn't
exists, yet the ASP.NET machine account had priveledges. I looked back
at the impersonate line in web.config and realized I needed to add the
ProjectSearchUser account to the Temporary ASP.NET Files top level so
it could create the folders and files needed for the project copy.

10. Built again. Lo and behold. IT WORKED!!! WOOT!

Error Message 1
===============

Server Error in '/webprojects/ProjectSearchUpdate' Application.
--------------------------------------------------------------------------------

Access to the path
"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET

Files\webprojects_projectsearchupdate\3890ab9b\9b033cb4" is denied.
Description: An unhandled exception occurred during the execution of
the current web
request. Please review the stack trace for more information about the
error and where it
originated in the code.

Exception Details: System.UnauthorizedAccessException: Access to the
path
"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET
Files\webprojects_projectsearchupdate\3890ab9b\9b033cb4" is denied.

ASP.NET is not authorized to access the requested resource. Consider
granting access rights
to the resource to the ASP.NET request identity. ASP.NET has a base
process identity
(typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that
is used if the
application is not impersonating. If the application is impersonating
via <identity
impersonate="true"/>, the identity will be the anonymous user
(typically IUSR_MACHINENAME)
or the authenticated request user.

To grant ASP.NET write access to a file, right-click the file in
Explorer, choose
"Properties" and select the Security tab. Click "Add" to add the
appropriate user or group.
Highlight the ASP.NET account, and check the boxes for the desired
access.

Source Error:
An unhandled exception was generated during the execution of the
current web request.
Information regarding the origin and location of the exception can be
identified using the
exception stack trace below.

Stack Trace:
[UnauthorizedAccessException: Access to the path
"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET
Files\webprojects_projectsearchupdate\3890ab9b\9b033cb4" is denied.]
System.IO.__Error.WinIOError(Int32 errorCode, String str) +393
System.IO.Directory.InternalCreateDirectory(String fullPath, String
path) +632
System.IO.Directory.CreateDirectory(String path) +195

System.Web.Compilation.PreservedAssemblyEntry.DoFirstTimeInit(HttpContext
context) +85

System.Web.Compilation.PreservedAssemblyEntry.EnsureFirstTimeInit(HttpContext
context)

+98

System.Web.Compilation.PreservedAssemblyEntry.GetPreservedAssemblyEntry(HttpContext


context, String virtualPath, Boolean fApplicationFile) +28

System.Web.UI.TemplateParser.GetParserCacheItemFromPreservedCompilation()
+91
System.Web.UI.TemplateParser.GetParserCacheItemInternal(Boolean
fCreateIfNotFound) +148
System.Web.UI.TemplateParser.GetParserCacheItemWithNewConfigPath()
+125
System.Web.UI.TemplateParser.GetParserCacheItem() +87

System.Web.UI.ApplicationFileParser.GetCompiledApplicationType(String
inputFile,

HttpContext context, ApplicationFileParser& parser) +171
System.Web.HttpApplicationFactory.CompileApplication(HttpContext
context) +43
System.Web.HttpApplicationFactory.Init(HttpContext context) +485
System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext
context) +170
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
+414
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top