none
Creating project with existing web failing

    Question

  • I have lots of asp.net c# web applications that I have always built a certain way as web sites, but we have merged organisation and started using VSTS and want to have a standard development process (I also have an issue with the solution file being copied when I branch which I think is a result of having web site rather than projects).

    So, what I am doing is creating a new project and then copying all the files across and using the 'include in project' link to bring them into the project.  The trouble is that when I try to build it fails to find my namespace that contains all my classes so I get the 'missing a reference error'!  I have the using statement as before and I don't see why its not picking it up!  Any ideas - I am using VS201532bit UD2 but I had the same issue on VS2013.

    cheers

    Tuesday, August 09, 2016 9:44 AM

Answers

  • Needed to convert to an WAP from WSP - this renames the app_code folder and various other things :)
    • Marked as answer by MonkeyManvin Friday, December 09, 2016 1:06 PM
    Friday, December 09, 2016 1:06 PM

All replies

  • Hi MonkeyManvin,

    >>The trouble is that when I try to build it fails to find my namespace that contains all my classes so I get the 'missing a reference error'! 

    Please double check whether the corresponding assembly was added into your new project.

    Since the source files were copied to your new project. I suppose the assembly reference was not added into your new project.

    So even you have already the using statement. It still will give the error when build the project.

    Best Regards,

    Lake Xiao 

    Wednesday, August 10, 2016 5:48 AM
    Moderator
  • They aren't assemblies, they are all classes in the App_Code folder with a namespace:

    namespace MyNameSpace
    {
     MyClasses
    }

    With:

    using MyNameSpace()

    on every .aspx.cs page

    This works fine if I rebuild as a website but not as a project

    Wednesday, August 10, 2016 10:17 AM
  • Hi MonkeyManvin,

    If you want to using the namespace from other classes. You need to add these classes into the project Reference:

    After that, you could using the namespace.

    Best Regards,

    Lake Xiao

    Friday, August 12, 2016 7:10 AM
    Moderator
  • Needed to convert to an WAP from WSP - this renames the app_code folder and various other things :)
    • Marked as answer by MonkeyManvin Friday, December 09, 2016 1:06 PM
    Friday, December 09, 2016 1:06 PM