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