Showing posts with label machine. Show all posts
Showing posts with label machine. Show all posts

Monday, March 26, 2012

Trouble opening a asp.net project

Hello,

I've inherited an vs2003 asp.net project from a fellow that had Windows
2000 advanced server as his development machine. As a result he mapped
the project to a web site (mapped to a non-standard port, 87 I think)
instead of mapping it to a virtual directory.

My dev machine is winxppro and my IIS doesn't allow me to create new web
sites. I've tried various techniques to be able to map it to a virtual
directory, but to no avail. I keep getting the error that "The file
path '[Physical Project Path]' does not correspond to the URL '[Project
URL]'. The two need to map to the same server location. HTTP Error 404:
File Not Found."

Is there a definitive guide somewhere that can walk me through the
process of moving the project to a state where I can work on it in
Windows XP?

Or any other advice would also be highly appreciated.

Regards,
RobertLook into the solution and project files and manually change the paths
within each.
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

"Frank Rizzo" <none@.none.com> wrote in message
news:%230xUfbMjGHA.1324@.TK2MSFTNGP04.phx.gbl...
> Hello,
> I've inherited an vs2003 asp.net project from a fellow that had Windows
> 2000 advanced server as his development machine. As a result he mapped
> the project to a web site (mapped to a non-standard port, 87 I think)
> instead of mapping it to a virtual directory.
> My dev machine is winxppro and my IIS doesn't allow me to create new web
> sites. I've tried various techniques to be able to map it to a virtual
> directory, but to no avail. I keep getting the error that "The file path
> '[Physical Project Path]' does not correspond to the URL '[Project URL]'.
> The two need to map to the same server location. HTTP Error 404: File Not
> Found."
> Is there a definitive guide somewhere that can walk me through the process
> of moving the project to a state where I can work on it in Windows XP?
> Or any other advice would also be highly appreciated.
> Regards,
> Robert

Trouble opening a asp.net project

Hello,
I've inherited an vs2003 asp.net project from a fellow that had Windows
2000 advanced server as his development machine. As a result he mapped
the project to a web site (mapped to a non-standard port, 87 I think)
instead of mapping it to a virtual directory.
My dev machine is winxppro and my IIS doesn't allow me to create new web
sites. I've tried various techniques to be able to map it to a virtual
directory, but to no avail. I keep getting the error that "The file
path '[Physical Project Path]' does not correspond to the URL '[Project
URL]'. The two need to map to the same server location. HTTP Error 404:
File Not Found."
Is there a definitive guide somewhere that can walk me through the
process of moving the project to a state where I can work on it in
Windows XP?
Or any other advice would also be highly appreciated.
Regards,
RobertLook into the solution and project files and manually change the paths
within each.
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."
"Frank Rizzo" <none@.none.com> wrote in message
news:%230xUfbMjGHA.1324@.TK2MSFTNGP04.phx.gbl...
> Hello,
> I've inherited an vs2003 asp.net project from a fellow that had Windows
> 2000 advanced server as his development machine. As a result he mapped
> the project to a web site (mapped to a non-standard port, 87 I think)
> instead of mapping it to a virtual directory.
> My dev machine is winxppro and my IIS doesn't allow me to create new web
> sites. I've tried various techniques to be able to map it to a virtual
> directory, but to no avail. I keep getting the error that "The file path
> '[Physical Project Path]' does not correspond to the URL '[Project URL]'.
> The two need to map to the same server location. HTTP Error 404: File Not
> Found."
> Is there a definitive guide somewhere that can walk me through the process
> of moving the project to a state where I can work on it in Windows XP?
> Or any other advice would also be highly appreciated.
> Regards,
> Robert

Saturday, March 24, 2012

Trouble with ASP.NET trust levels on IIS 6.0

I just upgraded my Win2k Server machine to Windows 2003 Server and IIS 6. Everything worked fine. I then installed Windows Sharepoint Services and now none of my apps will run, some throw an ASP.NET error that says "Debugging is not supported under current trust level settings" and some can't be found by the browser at all. Any ideas on what could be going on? After the upgrade IIS was running in IIS 5 Isolation mode, but Sharepoint Services made me uncheck that. Now I can't get anything to work except sharepoint and I am getting frustrated. Any ideas? Thanks!

-JoshWindows Sharepoint Services and regular ASP.NET cannot coexist on the same web site. They can be on the same server, but you have to have separate sites for them. Two different virtual directories won't do, they actually have to be on different sites.

The reason you get this specific error is that WSS switches its site to a reduced trust level for ASP.NET. At this level, debugging is not supported.

There are other things WSS does as well, which won't play well with your site. WSS removes a lot of the modules typically used in an ASP.NET app, like session state, and also installs a filter that may rewrite your site's URLs (because, in WSS, most pages actually come from the database rather than from the filesystem).
Thank you so much for you answer! It was driving me crazy, because each time I uninstalled/re-installed WSS my website would work/stop working. I wonder if that is in the readme? Very good to know!
Thank you so much as well! I had the same problem!

The trouble is, the code I am going to develop I want to use it on the sharepoint site (via web part)... this limitation just makes the development more difficult.

Thursday, March 22, 2012

Trouble with File Paths

Hi,

On my development machine I am using VB/ASP .net 2.0, IIS 5.1 , Windows XP Pro. The test server has Windows Server 2003, IIS 6.0.

I am trying to access my config settings located in an .xml file I created (SQLMessageSettings.xml).
The physical location is: C:\VB.Net 2.0 Projects\SQLMessageViewer\SQLMessageViewer\SQLMessageSettings.xml

When I run the application it runs from IIS (not VS Development Server) as a virtual IIS application.

I thought that to access the "SQLMessageSettings.xml" file I can use the file path "/SQLMessageViewer/SQLMessageSettings.xml" and it would start at the root of my website and find the file.
Instead I get an error "Could not find a part of the path 'C:\SQLMessageViewer\SQLMessageSettings.xml'."
If I remove the initial "/" the error is "Could not find a part of the path 'C:\WINDOWS\system32\SQLMessageViewer\SQLMessageSettings.xml'."
The only way it works is if I put the entire file path in (C:\VB.Net 2.0 Projects\SQLMessageViewer\SQLMessageViewer\SQLMessageSettings.xml).

When I changed the app to run from the VS Development Server it worked with only "SQLMessageViewer/SQLMessageSettings.xml"

I know I am missing something here. Part of the problem is that I don't fully understand all the architechture of IIS as to how a Website, Virtual Application and Virtual Directory all relate to each other.

How can set it up so I don't have to put the entire physical file path?
Would the tilde, "~", help me in anyway?
Also is there a way to do it so that I won't have to change the file path reference when I move it to the test server even though the physical location of the files are different?

Thank You,

Oran

As far as I know, you always have to use the full path to access a file on the server using the filesystem object. But, you can MAP the path from your current app. I think this should work

Dim FilePath as string = Server.MapPath("./SQLMessageViewer/SQLMessageSettings.xml")


Hi,

I think ~ should help you to solve the problem. ~ points to the root folder of your web application and then you can specify the path as you require.

Hope this helps to solve the problem

Good LuckYes

Regards

Vineed


Thanks for the suggestion but when I tried the "~",

"~/SQLMessageViewer/SQLMessageSettings.xml"

I got this:

Could not find a part of the path 'C:\VB.Net 2.0 Projects\SQLMessageViewer\~\SQLMessageViewer\SQLMessageSettings.xml'.

That is the right file path except for the "~."

I decided to get rid of the extra "SQLMessageViewer" folder and put everything where the .sln file is and it didn't help.

I tried this:

"~/SQLMessageSettings.xml"

and got this:

Could not find a part of the path 'C:\WINDOWS\system32\~\SQLMessageSettings.xml'.

Thanks,

Oran


Hi Oran,

Try usingRequest.ApplicationPath. This property returns the Virtual path of the Web applications Root folder. To this path you can add the path of your file as required. If you are not comfortable using the Virtual Path then you can also try using theRequest.PhysicalApplicationPath. This would return the Physical Path of the Web Application's root folder. You can again add the path of the file as required.

Hope this helps to solve your problem

Good LuckYes

Regards

Vineed


Try this

Server.MapPath("~/SQLMessageViewer/SQLMessageSettings.xml")

Assumption is that SQLMessageViewer is a folder inside your website


Hi,

My team has built a configuration component based on the provider model allowing the developer to store the config settings wherever he wants (database, .config file, .xml file ...). The component is a class library compiled to a dll (CommonConfig.dll). The dll is meant to serve both windows apps and web apps. The code in the commonconfig.dll that loads the xml file looks like this:

xd =New XmlDocument()
xd.Load(MyBase.Location)

The location (file path, database connection) of the config settings is stored in the web.config (or app.config) file like this:

<ConfigSettingslocation="~/SQLMessageSettings.xml"type="Common.Config.CommonConfig.XmlCommonConfigProvider"/>

Does "server.mappath" work in a windows app? Is it only a matter of importing the right namespace (which one?)? We can make 2 versions of the CommonConfig.dll one for web and one for windows, but we would like to avoid that if possible.

I was hoping that there was a way to locate the file with only the file path (and without having to write out the entire path). It could be there is no better solution, but it is strange that when I changed the app to run from the VS Development Server it worked fine with "SQLMessageViewer/SQLMessageSettings.xml" (See original post).

Thanks,

Oran


System.Web.HttpContext.Current.Server.MapPath is the fully qualified name . Well in your config dll, you can check if the httpContext.Current is empty .. if so then its not a web app so with this check your config dll can decide how to pull the config file


Thanks Jeev! Your solution works for both windows and web (on both servers).

I don't understand why the tilde doesn't work on its own without server.mappath?

Oran