MOSS 2010 virtual path to ASP.NET - asp.net

I am attempting to host an ASP.NET application inside of my SharePoint site. I want to host a full-application so I'm hoping to run it as a virtual path application.
Following instructions mentioned in other areas around the web, which said that I could go into ISS and create a virtual path inside of my SharePoint site to run the application.
Link (page 4)
After finishing this portion I began getting asked for credentials. I got rid of the credentials request, by browsing to the folder containing my Virtual Path and changing security settings to allow iUSR_ account. I no longer get credentials, but I now get a blank page.
I don't know how to get passed this blank page issue, any help is greatly appreciated.
Background: I realize that I can run an application in the layouts folder, but it doesn't seem to work the same as it references .cs files that should be in the code-behind.
-Update-
The blank page issue is solved if I convert the virtual path to an application. However, it seems that I can't piggy-back off of the SharePoint's user credentials when it's an application.

Have you checked that the AppPool for the MVC site is running as the same user as the sharepoint webapp?

Related

Multiple websites inside asp .net website

Hi I am creating an application where user wants to create and upload multiple websites inside asp .net website.
like
www.mywebsite.com/Websites/Website1
www.mywebsite.com/Websites/Website2
www.mywebsite.com/Websites/Website3
www.mywebsite.com/Websites/Website4
If I upload static website(No database connectivity) to Website1,Website2,Website3 folder it is working fine but If upload website have database in App_Data folder and connection string in web.config folder it is giving me error like : It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Does anyone knows how to solve this issue???
Thanks.
For this Just add virtual directory and put web.config and aspnet_client in that folder and then browse virtual directory..
Thanks all for your suggestions and comments... Few more requirements added to project and goal changed... Now How I am doing (Thought it would be helpful for someone else):
1) Now I am using single Master page for my main website and for multiple websites.
2) Now using single web.config for all the websites(main as well as sub-websites). Because as I have mentioned in my question... static websites are working fine but only problem in database driven websites.
I am not sure that this is the best practice(Who cares when you have no choice :p) but .. It has solved my problem
Last but not Least Thanks #Douglas Thomas and #Shirish ... I have tried this convert to application method on my local IIS and it worked perfectly but now as I have accomplished by other way ... I do not need to contact hosting company [ Some times they made me Angry ] every single time I upload new sub website.

Getting You do not currently have a default Web page established for your users. when running VS2008 solution

I have website in VS2008. Created the Virtual directory in IIS 5.1. When I try and run the site to debug from Visual Studio I keep on getting:
Your Web service is now running.
You do not currently have a default Web page established for your users. Any users attempting to connect to your Web site from another machine are currently receiving an Under Construction page. Your Web server lists the following files as possible default Web pages: default.htm,default.asp,index.htm,iisstart.asp. Currently, only iisstart.asp exists.
To add documents to your default Web site, save files in c:\inetpub\wwwroot.
I have no idea why this is happening.
Can anyone help me?
If I understand correctly, it may be as simple as this:
In Solution Explorer, right-click on the page you want to be the default page and click "Set as Start Page".

Configure IIS 6 web application on a personal server

A group of us wrote a .NET web application for our University class and in order to let our prof test with it I am setting it up on my webserver at home. Here is what I have done so far:
I created a new account on my domain, I then granted that account Read, write access to the folder where the app is stored. I have setup an application pool that uses this new account as its identity and created a new site that uses the new application pool.
I initially was receiving the Service unavailable error message, so I realized I had to add my account to the IIS_WPG account. So now I am stuck at the "page cannot be found". The website is pointing to the correct folder (I can see the aspx page list from within the IIS browser) but when browsing the site either in IIS, on a browser on the server or on a browser within my network I keep getting Page cannot be found. The home directory is pointing to default.aspx which is what our app uses.
The app of course works just fine when running from within the IDE, but now that I am trying to get it to work it doesn't want to.
Any thoughts?
Thanks.
you should give error details first.
for now, I suggest you check the 'network service' account's permission.this is the ASP.NET's account.
then publish your site to *.aspx file and *.dll file. to see if there is any errors.
So I found the issue. What I didn't know is that by default, IIS 6 does not turn on support of active server pages and .NET pages in Web Service Extensions. Once I had turned this on the site began to work just fine.

Getting 404 error in IIS when calling asp page

I have a problem with my asp.net 4.0 application. When I call it on the server, it works, but when I call it from outside the server, it gives me a 404 error.
The link I call the asp.net application from is the good one. Other asp.net 4.0 applications are working fine when called from outside the server. The other applications are in another folder though, but I do not see why it would work under a folder and not another one. There is no IP restrictions on the applications.
Anyone got that error int eh past?
Thanks
EDIT:
The app is configured as an asp.net 4.0 application. it is stored in a virtual directory.
This link works:
http://localhost/Phonebook/PhoneBook/default-defaut.aspx
this link does not : https://www.test.com/Phonebook/PhoneBook/default-defaut.aspx
A coworker and me found the answer. It's because the server I called on my url was supposed to have a rule redirecting the browser to the right url. So IIS7 on my test server was setted up right.
Theres several things to check.
That test.com is even going to your server. Put a file in the root directory 'test.txt' that IIS lists as the root folder for your site. ensure you can get to it.
Once you verify your root site folder WORKS for ex., www.test.com/test.txt then ensure you have a virtual directory /phonebook that contains a folder phonebook within it.
Seems overkill to be having to folders named phonebook. Try taking one of them out and pointing your web application to your
c:\whatever\phonebook\phonebook folder.
Make sure port 443 is bound to your app if you're using https, that could be your problem.

ASP.NET MVC - Website paths

I am using a 3rd party component which creates settings files based on hard-coded file paths i.e. they are compiled into the DLL e.g.
%APPDATA%\Vendor\Settings.ini
I have created a few console/service applications that use this and work very well. However, I am now trying to use a similar approach via my ASP.NET MVC web application and the settings file never seems to write out!
Usually if the application is running under my acconut for example the file would be written to somewhere like:
C:\Documents and Settings\James\Application Data\Vendor\Settings.ini
So I thought if the website AppPool was running under the same account the file would be saved to the same place....However, it never appears. The account is an admin account running under Windows server 2003.
Any ideas?
Thanks.
Have you checked to see if the settings file is created in the App_Data folder in the web application? If not, could you put an existing settings file there and see if it uses it?
It's not about the webpool account, it's about guest user's account.
Go to the properties of your site in IIS, Directory Security and in the anonymous access click on the Edit button, there you'll see wich account is been used when someone access your site.
Couldn't find a solution to this, so I decided to develop a local WCF service (which would create the settings file in the correct directory path) and just accessed it via my web application.

Resources