Creating directories from a web site - asp.net-mvc-3

I am using .NET MVC3 to create a website. which will be used to make some file operations at server machine. Right now I am in development process so i didn't have it on IIS. I am working on Visual studio 2010's development server. I am having trouble with creating a directory in App_Data folder. Users need to be able to create folders in App_Data(or somewhere appropriate) and upload files in those folders. all users will be my friends so there is no security problem. But it says access denied :/ and i can't seem to find to grant related permissions. When i looked for it i found that granting "aspnet machine" user with read/write permissions would do it, but i don't have that user on my computer I don't know why:/ Should I move my application to IIS to make it? or is there any other thing that I don't know? By the way all my files in my pc are read only and i can't seem to change them neither:/ maybe it's because of that. But anyways i need a workaround for this issue.
Any help is appreciated. Thanks in advance ;)

Scenario: when you debugging your asp.net application from VS, your project running under "ASP.NET Development Server" tool (It means that tool has the same permissions as Visual Studio, also you may find it in tray);
Scenario: You may use FileMon from Sysinternals and see filesystem activities;
Scenario: Deploy to IIS and create new AppPool with your own user (grand permissions to App_Data directory).
Best Regards.

Related

Cannot read configuration file in visual studio, can this be fixed

I trying to use Visual Studio as I required to learn .NET and visual studio as part of new job. Normally I program everything in Notepad++ (PHP/javascript) because it just works fine for me.
I have been on for three days trying to install Visual Studio, finally got it to install with the components required, as you can imagine my experience so far of Visual Studio is not too great.
Sound cliche but following a nice simple tutorial to get the basics out of the way, as you do.
When I click to debug or the IIS Express button I am greeted with this error.
I have tried restarting the project
I have tried restarting Visual Studio
No matter how many projects I create I get the same error.
I have been trying to fix this for hours now, I have turned on IIS in windows features. I am missing something, do I need to un intall wampp (which isnt actually running)?
The folder I create has no permissions and is accessible however the read only box is always ticked even if I uncheck this and apply settings.
I have tried manually creating a site in IIS manager, and again I get this error on authorization.
The server is configured to use pass-through authentication with a
built-in account to access the specified physical path. However, IIS
Manager cannot verify whether the built-in account has access. Make
sure that the application pool identity has Read access to the
physical path. If this server is joined to a domain, and the
application pool identity is NetworkService or LocalSystem, verify
that \$ has Read access to the physical path.
Then test these settings again.
Any help would be amazing as I'm pulling my hair out here.
This is likely due to file rights. I have run into this when I am trying to run my code that lives on a network share, or more commonly when it is living on the host and I am running Windows in a Virtual Machine. I would confirm that you have sufficient disk space, the code is living on a local drive, that the folder is not read-only and that the running user has rights to write to that folder.
It looks like you are running from a folder on your Desktop folder. This should be fine. If you got that code from a Git server sometimes the files come down as read-only. I would confirm that the "Current Work" folder is not read-only nor are any of its children. I would also go into the Security tab of the folder's properties in Explorer and grant "Everyone" full control (probably safe since this is just a developer environment). Test after each of these.

Remove nested Web Site in Visual Studio

I'm trying to get DotNetNuke set up. I had to update the ActiveDirectory authentication module, so at one point I had it publish to my DotNetNuke solution. I've since changed my mind on how I want to do that, but I can't seem to get rid of it!
How can I delete the ActiveDirectory 'Web Site' below? It doesn't exist on file or in the solution, and I don't see anything obvious in IIS, but it won't go away. I'm using Visual Studio 2013.
I would think that it exists as a Virtual Directory in IIS, if you expand that folder (authentication services) do you see the ActiveDirectory folder with a different icon than the other folders in IIS?
If that's not it, you might open up the SLN file itself in Notepad and search for that ActiveDirectory folder, see if it is listed there.
You really shouldn't be opening the DNN website anyways, I highly recommend if you're doing DNN development you ditch the "website" model and run the Web Application Project model for development. Start with this tutorial http://www.christoc.com/Tutorials/All-Tutorials/aid/1
edit: After you have your development environment setup with DNN running at DNNDEV.ME you would then install visual studio templates -> http://www.christoc.com/Tutorials/All-Tutorials/aid/2

Resharper and other settings shared between workstations

How do i share resharper settings and other between workstations like home and work?
is there an easy solution?
If you have ReSharper 6.1 or above, you can share the settings file using Dropbox, Google drive, etc.
Read this post to learn more.
i have a solution on sharing resharper between workstations (home,work,laptop).
all relevant files are located on : C:\Users[username]\AppData\Roaming\JetBrains\ReSharper or even C:\Users[username]\AppData\Roaming\JetBrains\
using a tool named "junction link magic" i create a junction on this folder that points to a folder in my skydrive synced folder (or dropbox).
every workstation that has skydrive has only to point to this path as described below. this way everything in that folder gets synced (plugins!!!!)
This actualy work for many thinks like: Visual Studio, Sql management studio, and other tools...

IIS Express on a shared development machine (rdp)

I have a problem which I thought could be common, searched the web for it but found nothing.
We're using a shared development machine, and every developer connects through RDP and has his own profile, desktop, etc.
The problem I am encountering is with IIS express. Since it is configured at user level (applicationhost.config inside documents/iisexpress/config) and the port configured must match the one declared in the .csproj file, two developers can't possibily run on the same port, as it gives the error "the port is already in use".
So to make it work we have to manually change the port both on the csproj and in the applicationhost.config for every developer, but it's only a temporary fix as when we commit our changes to SVN, the csproj file gets merged, so we have to do this process every time someone commits/updates.
My question is: is there a clean way to use IIS express with Visual Studio 2010 on a shared development machine?
Thanks.
Partially tested answer. Not sure how it'll work on a multi-user workstation. It might give you, or someone else here, a jumpstart to a proper solution that works best in your existing environment.
It appears that Visual Studio stores all the web configuration in the csproj/vbproj and IISExpress stores its configuration in %userprofile%\Documents\IISExpress\config\ApplicationHost.Config.
Normally, we store the csproj files in source control, but ignore the csproj.user file so that each person may have some unique settings, such as the web configuration.
Each user who signs into the box must have their own profile.
Each profile must have their own copy of the source code.
Each user's copy of the source will contain their own csproj.user file.
Ignore .**proj.user* files in your source control.
Copy the web settings into the csproj.user by unchecking the option Apply server settings to all users and then commit to source control.
Each user who pulls a copy of the source will have to configure their web settings, use a unique port that the others users are not using, and uncheck the box above so that their configuration is not passed on to the other users.
Doing this, Each profile will have their own IIS Express ApplicationHost.Config configured with a port that is different from the other profiles. Each user's copy of the source will have a csproj.user that is configured with the same port in their profile's IIS Express configuration.
For reference:
I've tried changing IIS Express's ApplicationHost.Config to use a different port than what Visual Studio expects and Visual Studio is unable to connect the debugger to IIS Express.
How IIS Express's configuration works: http://msdn.microsoft.com/en-us/library/ms178109.aspx
The best option you can use is to take advantage of the Import functionality built into MSBuild.
Essentially, you would create a seperate build target for each user. You can then import this target from this referenced file directly. I would then recommend creating this file on the server (for each user), but leaving it outside of source control.
This should allow each user to have a custom IIS port without conflicting with others.
I think you can create subdomains for each user and implement the required changes and do the testing. In this way each user can his own subdomain and port and hence work independently on the shared IIS Express.
You probably won't like my answer but here's my thoughts:
As you noticed, the configurations are tied to the user profile and not the server; this is because IIS Express is not intended to be used as a shared development server. You should be using full IIS.
I do not see any benefit or reason to use the same physical box for development. Admittedly, I don't know all the details of your scenario with licensing or workstation resources, but it doesn't seem like you gain much from having everyone RDP into the box to use Visual Studio - each person still needs a license, performance will be slower, and you shouldn't be working on the same project instance.
You should seriously consider your entire setup for development:
Each developer should use Visual Studio on their workstation, and debug/test there using IIS Express (configured with the same ports and settings across all machines - very easy).
From there, your developers should check their code into source control, and examine conflicts that may or may not arise. I'm not sure about SVN but the MSBuild automation available in TFS can be use to setup a continuous build policy that deploys to a common IIS installation so that your merged code is tested and usable from the full IIS installation mentioned above.
Anything else would be a workaround/hack that will bite you in the butt later.

VS 2003 Reports "unable to get the project file from the web server" when opening a solution from VSS

When attempting to open a project from source control on a newly formatted pc, I receive an "unable to get the project file from the web server" after getting the sln file from VSS. If I attempt to open the sln file from explorer, I also receive the same error.
Any pointers or ideas?
Thanks!
This question is very old so you have probably solved the issue, but just in case: Does the project file use IIS? If so then it is probably trying to read the project file from IIS and the virtual directory does not exist on the newly formatted computer. Also, there should be more detail about the message in the Output window when you open the solution which should help you find the cause. With VS2003, you also need to add your user account to the "Debugger Users" and "VS Developers" and possibly the account that is running the AppPool (possibly Network Server, ASPNET, or IUSER_xxx). This may depend on the type of authentication you are using as well. Occasionally I had to add those group permissions the the virtual directory location as well. It's been a while since I have used VS2003 with web projects though.
Try deleting the .csproj files (back them up first though).
Is there anything odd in your sln file? Have you opened it with a text editor to see if it is linking to a remote resource?

Resources