Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / IDE / January 2006

Tip: Looking for answers? Try searching our database.

Problem adding existing files to Web Project

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dave Newman - 14 Jun 2005 03:52 GMT
I know this question has been asked before but I can't find any decent
answers.

I can't use Visual Studio 2003 to add existing files to my web project.
Currently i receive the following error:

Unable to get file 'http://localhost/project/file.vb' from the web
server. Server error: 'project/file.vb' does not refer to a page or
folder in this web. It may be a page or folder in a subweb, or it could
be a badly formed URL.

I know this has something to do with Frontpage server extensions, but
I'm not sure how to configure that so these files are recognised.  My
current bad workaround is to edit the web.vbproj file and put the
filenames in there.  Unfortunately even then, not all files I add are
loaded into the project.

This is quite annoying as I have a few ruby scripts generating code for
me, so they have to be externally created.

Has anyone been able to solve this problem?

Thanks,
Dave Newman
Dave Newman - 14 Jun 2005 06:50 GMT
My slightly better workaround:  I use ruby to add generated files into
the web.vbproj

In case anyone is interested:

def AddFileToProject(filename, projectXML)
 print "Adding #{filename}"
 if projectXML.elements["//File[@RelPath='#{REL_PATH}#{filename}']"]
   print " already exists\n"
   return
 end

 print "\n"
 newFile =
projectXML.elements["VisualStudioProject/VisualBasic/Files/Include"].add_element
"File"

 newFile.attributes["RelPath"]     = REL_PATH + filename
 newFile.attributes["SubType"]     = "Code"
 newFile.attributes["BuildAction"] = "Compile"
end
adis - 31 Jan 2006 23:01 GMT
I beleve this thread is not live anymore. But a solution should've been posted anyhow.
A viable solution to adding an existing item to a VS.NET project is to have this item imported from outside the web server. Do not use a webfolder on localhost. Do not add this item first to the web server. Visual Studio Development Environment will do this for you

From http://developmentnow.com/g/55_2005_6_0_0_541544/Problem-adding-existing-files-t
o-Web-Project.ht


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.