C# - How To Reference The Base Folder In Website Project
Jun 18, 2010
My urls when I run the asp.net website project (in vs.net 2008) looks like:
http://localhost:54269/www/Default.aspx
So referencing things like:
/sytle/css.css
Doesn't seem to work.
Why does my project have a '/www' folder? Did I set things up wrong?
View 1 Replies
Similar Messages:
Jul 21, 2010
Just to test, I created a blank website and a blank web site project.
When I added a referece to web site by doing right click and add reference it added the dll inside a BIN folder but on ther other hand when I did the same for a web site project it created a reference folder for me and then added the dll under the reference folder.
View 2 Replies
Feb 3, 2010
I am working on my test project for my web service, and my problem is that, my web service uses a folder (within the folder there are crystal reports template).
How can I copy it to test porject?
I've tried to copy the folder to various directories such as bin, bin/debug, obj, rootDir etc, but none of them works
View 2 Replies
May 13, 2010
I have several web sites, all of which use the same JavaScript library. How can I "reference" this library from each of my web sites? If I just import the library into my web site in Visual Studio, I get in trouble as soon as the library changes, because I then have to update it in all web sites manually. It would be much easier to place the library in an external folder and just reference it from my web sites. How can I do this with Visual Studio?
View 9 Replies
Mar 21, 2011
I have a c# website project in visual studio 2010, and all of my .aspx pages are currently being stored in a ~/Forms directory. The problem is that when I want to go to any web pages, they are all prefixed with "http://localhost:000/Forms/", when what I really want is "http://localhost:000/". So, "http://localhost:000/AboutUs.aspx" instead of "http://localhost:000/Forms/AboutUs.aspx". What is the preferred way to deal with a situation like this? I don't want to rig anything up.
View 1 Replies
Feb 28, 2011
I have a vs2008 Website project(it was converted from vs2005), when i right click the Website node in the solution and open the property page, i select the references link, then click add reference to Oracle.DataAccess.dll(11g, 64bits), Version=2.112.2.0 in the website BIN directory, it doesn't work, i don't see the Oracle.DataAccess.dll is added, Can you give me any advice why the website project can not add the Oracle.DataAccess.dll ? And I can add rOracle.DataAccess.dll to my other Web Application project, what difference between Website project and Web applicatoin project caused the issue? Since i can not add the Oracle.DataAccess.dll , when i compile, it gave the error:
Could not load file or assembly 'Oracle.DataAccess, Version=2.112.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. An attempt was made to load a program with an incorrect format.
View 4 Replies
Mar 30, 2011
I'm aware of the following two different types of web projects in Visual Studio 2008:Website projectWeb application projectA web application project can reference a signed assembly as long as the web application's assembly is also signed with the same key. However, this doesn't work with the website project because there is no place to sign an assembly. I think this is because the assembly is compiled dynamically on the server?
Anyway, is it possible to get the website project working with this signed assembly? Or will I have to convert this website project into a web application project?Edit:The following situation has required me to ask for clarification in this matter:I have a class library that is being referenced by several other projects in my solution in Visual Studio. One of the projects is a windows application that will be deployed to specific external users. In order to make sure that the application is using the correct assembly and to also prevent others from using the assembly (I am aware of the limitations with respect to its effectiveness), all assemblies have been signed and all the classes in the library are declared as Friend (internal).
The website project doesn't seem to have a way for me to sign its assembly and I get the following message when attempting to use anything from the library: "CLASS is not assessable in this context because it is 'Friend'", which is to be expected.The following attributes are inside the AssemblyInfo.vb file in my class library project:
<Assembly: InternalsVisibleTo("OtherProject1, PublicKey=AAA...")>
<Assembly: InternalsVisibleTo("OtherProject2, PublicKey=AAA...")>
...
My Conclusion:Looks like the cleanest way to do this would be to convert the website into a web application but this would require a bit of time to do since our site is pretty fleshed out already and as pointed out in other discussions, can be quite a pain to do. Going forward, I think creating a web application in the first place may have been a better idea and much more flexible for future development.
View 3 Replies
Oct 8, 2010
When I make an asp.net web application and add class libraries to the solution, the website project itself has a folder with the same name/contents as the class library.
Eg I make a web application called Test, add a project which is a class library, to the solution, called testAbc, and then there is a folder at the root of the website project called testAbc with the contents of the class lib.
View 4 Replies
Feb 14, 2010
When I make an asp.net web application and add class libraries to the solution, the website project itself has a folder with the same name/contents as the class library.
Eg I make a web application called Test, add a project which is a class library, to the solution, called testAbc, and then there is a folder at the root of the website project called testAbc with the contents of the class lib.
I read why this happens in a book a while ago but can't quite remember now.
View 1 Replies
Nov 22, 2015
[URL] ....
In above link you clearly describe (How to display directory folder structure).
The path only works when the folder insight the project.
When I put folder outside the project it didn't work. What type of changes I need to made to acces the folder outside the poject. & How can I show other details of files which are including in folders Like. Last Modified Created Date, Modified Date etc..
View 1 Replies
May 15, 2010
We store backup archives in subfolders of a folder on one of the server's external USB drive. I would like to have an ASP.NET app read the contents of this folder so the manager can view the backup files to confirm backups are working and optionally delete these backup files when an old drive is reconnected so it can be used for the next weeks backups.
This backup folder is oubviously outside the server's webroot. Is there some way I can grant authority so the ASP.Net app can access this folder for this purpose? I would be using VS Web Express, so can't create any signed packages and such.
View 3 Replies
Aug 8, 2010
I am attempting to access a textbox control on a master page from a code behind base class but having problems. I have 3 levels of master pages. m1.master is the master page for m2.master which is the master page for m3.master.m3.master has a textbox as shown below
<%Master
Language="C#"
MasterPageFile="~/m2.master"
AutoEventWireup="true"
CodeFile="M3.master.cs"
Inherits="M3"
%>
<asp:Content
ID="Content5"
ContentPlaceHolderID="M2"
Runat="Server">
<asp:TextBox
ID="text1"
runat="server"
></asp:TextBox>
<asp:ContentPlaceHolder
ID="M3"
runat="Server"></asp:ContentPlaceHolder>
</asp:Content>
I have a content page c1.aspx that uses m3.master as its master page as shown below:
@
Page
Title=""
Language="C#"
MasterPageFile="~/m3.master"
AutoEventWireup="true"
CodeFile="c1.aspx.cs"
Inherits="_c1".................
View 2 Replies
Jan 7, 2010
When you use ASP.NET web site (instead of web application model) and add reference to an assembly from local folder, Visual Studio, it seems, understands that this local assembly is also in GAC and so does NOT copy this assembly to bin folder (as it does with non-GAC assemblies), but simply adds new record in web.config file.
Why such a behaviour? Is it possible to force copy to bin folder (I need this since .dll is not on target environment)? I can add assembly to bin folder as file and it will work, but in this case bin folder contents will be in source control, which is not good.
View 3 Replies
Feb 9, 2010
Im trying out the Hudson Continuous Integration. After the build is executed i want to copy the content of the ReleaseBuild to another website on the server.This should be possible i guess but i cant seem figure it out.I know this can be done in nAnt and msbuild but i need to make Hudson do it, eg plugin or something.
View 1 Replies
Dec 16, 2010
I want to create a folder to store some web controls, so the site structure doesn't have a zillion files in the root.
Except that if I create an ordinary folder, that folder is also visible on the web site. MSDN said you cannot put it in App_Code, and it doesn't really make sense to put it in other special folder like App_Data or App_Theme.
View 3 Replies
Mar 11, 2010
I'm trying create unit testing for an existing website project (not web application project). I cannot access my under test classes unless I use accessor. However, if I use accessor, I have problem to initiate an object with passing arguments. I only want to create unit tetsing for App_Code. After searching web, and I found that I'd better to create a web application project using my current existing website project. From solution explorer, add new project ->using existing website. My questions is: what impact will have for my current website to create the new project? Should I just convert my current website to web application? If do that, will it cuase problems on my website? I am new on asp.net, still learning..
View 1 Replies
Oct 24, 2010
I just converted an ASP.NET Web Site Project to a Web Application Project in VS 2010. After I run the application though it seems that my class polymorphism broke. I don't have a clue as to why this could occur.
So in the following code when I call base.OnLoad(e) I am getting errors in the base class because the variable myString is null. In fact all the variables for the Base class are null. I can do
[code]....
View 1 Replies
Mar 29, 2011
I recently updated my VS2010 website project from .NET 3.5 to 4.0. Everything was working fine in the website project. Today I decided to migrate the website to a web application project as I have learned this is the best way to work in .NET. I split out all my class files into a separate class library and copied all my other content into my new project. Then I updated all the references and web.config.
When I build the class library, everything works great. The problem is happening when I try to build/debug the web application project. It is acting like all the controls are missing and it is also throwing a bunch of compile errors about the public properties I have in my master pages.
Control errors: "The name 'INSERT CONTROL NAME HERE' does not exist in the current context"
Master page errors:'System.Web.UI.MasterPage' does not contain a definition....
It is giving these errors for every single control and master page property in my entire solution.I notice when I add a new web.form to this project, it also adds a filename.aspx.designer.cs file in addition to the .aspx and .aspx.cs file. My existing files do not have these extra files since they were created in a different .NET version.
UPDATE: It seems I was missing the step where I need to right click on the new application folder and select "Convert to web application". I just did that and it seems to be a little bit better...
Now it is choking on Literals that are inside single quotes:
<div class='<asp:Literal ID="CssClassLiteral" runat="server"></asp:Literal>'>
It doesn't see this literal when it does the conversion... Is the above valid code or should I implement that functionality another way?
View 1 Replies
Feb 9, 2010
how to host asp.net website using sql data base. i published sql.mdf file. is it (sql.mdf) possible to place in app_data folder?
View 1 Replies
Oct 6, 2010
I was not able to do unit testing for our existing web site project. I converted the web site project to a web application project. I did some unit testing and changes on the converted web application project. However, my co-worker was doing UI testing on the web site project. We need put UI testing and unit testing to the web application project. Is it possible to move the UI testing code that my co-worker did to the web application project I am working? If so, how do you do it?
View 2 Replies
Jun 20, 2010
I've created a new vs.net project and added all the files from an asp.net website project.
When I compile, it couldn't find a reference to a class.
In the AppCode the class was defined, but without a namespace.
So I added a namespace, and then on the default.aspx.cs (this is where the error was originating) I added the using statement.
The using statement was not picking up the namespace.
View 3 Replies
Jan 28, 2015
I have a website hosted on Azure that is written on ASP.NET
I have registered a domain name and got that domain to redirect to my azure hosted website
How do I get the website to use my domain for its base of its URLs?
(For example how would I make the about page be [URL] ....)
View 4 Replies
Mar 11, 2011
What is the difference between Web Application Project and Web Site Project ?
View 6 Replies
Apr 27, 2010
I need to have a copy of all my pages, bin fold, data folder, etc stored in a folder in the root of project called installation.
Once I have copied the contents of my web site into the installation folder how can I tell the complie/run process to ignore that folder ?
View 1 Replies
Dec 8, 2010
[code]....
I have a folder named mycss and inside the css.Nothing goes green on the page(errors).
But the textbox is not changing appearance.
Note that the css works correctly if i create it inside the default.aspx page, "Style1" css file is with capital S, if it makes a difference.
View 18 Replies