My boss asked me to make changes to a web application which resides in svn. Not much is known about the development of this application as it was done years back.
I did check out the folder and noticed the is a bin folder as well as App_Code with all the associated .aspx and .aspx.cs files as well. What is missing though is the .csproj file.
How do I create one so that I may open it in visual studio and make changes and rebuild accordingly?
Related
I have to fix a legacy web service project created in C# and asp.net. It is not possible to open the project in visual studio as source safe errors and other missing libraries cause too many compile errors. I am not that familiar with web applications in .NET.
Is it possible to update a single aspx.cs file in the website directory which has a connection string hard coded that needs to be updated. If so, how is this eventually compiled and updated in IIS?
After you've deployed to IIS, you cannot update the .cs file in ASP.net application as they are already compiled into .dll files in the bin folder. The files you can update are with extensions like .aspx .ascx and .config etc. You should modify the .cs file, compile and publish the dll into the bin folder.
I have a click once deployment project that has been working fine for a long time now. I added some new dll's to a project that is referenced by it. The dll's can't be referenced in references, so I added them as files to the project.
Build Action is Content, copy to output directory is copy always.
when I build the application, the dll's appear in the bin\debug directory. The program uses them just fine too on my computer. When I deploy the application, the dll's don't make it to the other computer.
Under Publish in application properties I went to application files. the dll's I need are not listed there to be included in the deployment.
I would love some help, I feel like I'm missing something really simple.
I have a feeling if I put the dll's in the main project, it would work. I don't really want to do this, I would like to keep them all located in the project they are actually used in.
When I deploy the application, the dll's don't make it to the other computer.
...
Under Publish in application properties I went to application files. the dll's I need are not listed there to be included in the deployment.
You need to set them to download with the application. Click the DLL in the project properties, then press F4. Set the Build Action to Content, and the Copy to Output Directory to something like 'Copy if newer'
For information - it is likely if you download the DLLs for referencing by a built exe (for example) you may need to configure a manifest file for the executable as well to get it to pick up the DLLS correctly
I am working on an ASP.NET project which is published to a configured IIS in the same machine.
I have made changes in one of the forms and than published it.
But while the changes on the web from file (.aspx) are being updated - other changes which reside in the code behind file (.aspx.cs) are not being updated.
My aim is to search addresses from a database and to display markers on google map.
Everything is working fine from my VS-IDE execution but after publishing it to the local IIS:
The front end is working fine while the back-end (the related .aspx.cs) does not work.
I tried those steps to remedy the situation:
I have deleted app directory from windows/frameworks/4.0/temp files.
I have even made new profile in publish wizard and published the project from a new folder.
I have deleted pool from IIS and made new one and mapped it to new ddl files folder.
I have also gone to project /properties/publish web/items to deploy and set to all files in the project.
But none of that solved the problem........
I am using
VS 2012
SQL Server 2012
EF 4.5
Do a clean and rebuild, then publish. Sometimes, sometimes, a change to a dll won't be detected and so won't be recompiled.
Try to delete everything in the bin directory wherever you're publishing the site, then try to publish again. Sometimes VS doesn't like to overwrite the dlls when publishing.
This is very late but search brought me here. The solution that worked for me was, in Visual Studio:
In solution explorer, right click on your project -> select "Build Dependencies", remove any incorrect dependencies.
In solution explorer, go to Project -> References, remove any unnecessary references.
Make sure your project is selected in solution explorer, on PROJECT top menu, select "Convert to Web Application." Ok.
Clean and Rebuild your project.
Publish. It helps to set your File Publish option in Publish Profile to "Delete All Existing Files Prior to Publish"
The code behind files do not get uploaded, because they don't need to get uploaded. Only config and markup files. All the project code is contained in your project's DLL file in the BIN folder.
Hope this helps somebody out there.
I was just handed a C# web service project and first time doing C# and ASP.NET. The web service and .cs, asmx, and asmx.cs files are located in wwwroot dir of the IIS server. I am writing a PHP SOAP client that calls those asmx files via SOAP. I would like to change some of the hard coded settings in those asmx.cs and .cs files. I have tried the aspnet_compiler and Visual Studio would not load the project. Is there any way to update the code/logic in those files without Visual Studio or recompiling. This project was compiled before. When using VS 2010 - it tries to open the project, converts it and nothing happens. If I have to us VS - any clues why it is not loading those files? It opens them if I open the .cs files individually but then I can't rebuild the project.
Any help/hints would be appreciated.
Thanks
It seems that your project file (.csproj) is interrupted. Refer to other correct project file and fix it manually.
ASP.NET website will auto compile cs and run when asmx first requested. Compiled code is put at bin folder, while cs code is put at app_code folder. Make sure asmx code behide puts to cs file in app_code.
Sorry but it turned out be a Windows profile issue. VS could not load those project files due to my profile being full. Hope it helps someone else in the future :)
Got a Visual studio 10 solution for ASP.NET web site, and VS seems to compile *.aspx.cs files that are in the web site folder, that used to be part of the solution but were excluded (I no longer see these files in the solution explorer). Is it expected? If not, how could I fix it? Rebuilding solution does not help.
Also, is it expected that I cannot find the binaries for *.aspx.cs files?
If your website is a Web site project as opposed to a Web application project (see Web Application Projects versus Web Site Projects in Visual Studio) then IIS will perform the compilation at runtime for you instead of Visual Studio - in this case the .csproj file is not used to determine what is and isn't compiled.
There is no project file (.csproj or .vbproj). All the files in a folder structure are automatically included in the site.
I'm not sure where the compiled binaries go, but I believe that it is a temporary folder somewhere, so you shouldn't necessarily expect to see those binaries in the web site folder structure.
If you want explicit control over what is compiled and when it is compiled then you may be better off converting your project to a web application project.
Short answer: No. It only compiles whatever is is included in the .csproj marked as 'compile' (in the file properties window).
Try to refresh the project, open the .csproj as a file text and check if those files are referenced there.
Lastly, it might be a dependent project that references those files.
If you can't find the solution, paste the exact error given by VS
For clarification, solutions files (.sln) contains project files (.csproj); .csproj files are the ones that contain references to the files to build.