Web Configuration option in Visual studio 2013 - asp.net

I have installed visual studio 2013 and I'm trying to configure asp.net web to allow or deny permissions to certain set of pages in website that I have created through visual studio, but I can't see any option to configure as in previous versions of Visual studios. I have researched and tried some steps provided in this LINK in stackoverflow without any luck.
I can revert back to Visual studio 2010/2012, but why is it that I have to revert back ? There could be a reason why Microsoft has removed this option to configure or for any other commercial reasons ?
Anyway, my main priority here is how to get a fix for the issue I am facing or is there any alternative ways to achieve it? I heard that configuring membership now involves cloud 2.0 Membership - source -> COMMENT FROM OTHER USER IN STACKOVERFLOW
I have registered IISEXPRESS with this command:
"C:\Program Files\IIS Express\iisexpress.exe"
/path:c:\windows\Microsoft.NET\Framework\v4.0.30319\ASP.NETWebAdminFiles
/vpath:"/asp.netwebadminfiles" /port:8089 /clr:4.0 /ntlm
and when I try to open the url: http://localhost:8089/asp.netwebadminfiles/default.aspx?applicationPhysicalPath=[C:\Users\kiriti\Documents\Visual Studio 2013\Projects\WebSite1]\&applicationUrl=/
I get an error saying:
The following message may help in diagnosing the problem: System.ArgumentException: The parameter 'PhysicalDirectory' is invalid. Parameter name: PhysicalDirectory at System.Web.Configuration.VirtualDirectoryMapping..ctor(VirtualPath virtualDirectory, String physicalDirectory, Boolean isAppRoot, String configFileBaseName) at System.Web.Configuration.VirtualDirectoryMapping..ctor(String physicalDirectory, Boolean isAppRoot) at System.Web.Administration.WebAdminPage.OpenWebConfiguration(String path, String appPhysPath, Boolean getWebConfigForSubDir) at System.Web.Administration.WebAdminPage.VerifyAppValid()
Please help!

remove '[' and ']' from your application physical path

Try to Copy your project to somewhere else like C:\MyProject\
According to this Link it could be either the directory of the project too deep or it had illegal Character(s)
I had this problem before and this solution solved it.

I have encountered the same error and I found the solution to the problem.
Make sure that your application path uses the backslash and not the forward slash.
e.g. http://localhost:8080/asp.netwebadminfiles/default.aspx?applicationPhysicalPath=c:\MyProject\MySite&applicationUrl=/

The reason this usually happens is because, the name of the folder under projects is Website1 and the same time if you check the directory, there should be a file named Website1.sln (*sln extension). Basically .sln file is clashing with your project folder name. Solution: Change the name of .sln file to something else.
Secondly, remove [] brackets. You don't need them.
I hope this helps.
Thanks.

Related

Could not transform licenses file into a binary resource

I have my old Web Applicatoin, developed in .Net Framework 2.0. Now i am trying to open it in VS2012 and it give me below error..
Could not transform licenses file into a binary resource. (1) : error LC0004 :
Exception occurred creating type 'Infragistics.WebUI.WebDataInput.WebDateTimeEdit,
Infragistics.WebUI.WebDataInput.v5.1, Version=5.1.20051.37, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb System.ComponentModel.LicenseException:
Unable to locate license assembly.at System.ComponentModel.LicenseManager.CreateWithContext(Type type, LicenseContext creationContext, Object[] args)
at System.Tools.LicenseCompiler.GenerateLicenses(String fileContents, String targetPE, ITypeResolutionService resolver, DesigntimeLicenseContext ctx)'
Good afternoon,
This happened for me when we had branched a solution (svn) to be used to patch production should the need arise. When I built the solution from the branch, it gave me a similar error, talking about index based (zero) blah blah blah.. it turns out there was a blank line on my .licx file which was causing the error. Deleting the blank line fixed the issue.
Just posting in case this helps anyone else.
Update 2022-11-11: This no longer works for me in VS 2022. I now have to open the solution in VS 2019, empty the contents of that file and rebuild the solution, put the contents back and rebuild again. After doing that, I'm able to do a "Rebuild" in VS 2022. Please let me know if anyone finds a better solution to this, as I don't intend to keep VS 2019 on my machine forever =)
Regards,
I have deleted the licenses file, and it worked for me
Removed the extra line but it did not work.
I deleted the \BIN folder and did a "rebuild". All is working now.
I cut all the lines from licenses.licx and compiled the project, then I pasted the previously cut content into licenses.linx and recompiled the project and it works fine now.

Visual Studio 2013 Web Deploy fails

I just installed VS 2013, upgrading from VS 2010. Creating a web deployment package zip file used to work in 2010. using VS 2013's Publish Web feature to publish to a Web Deploy Package, I getting the following error:
Web deployment task failed. (Object of type 'manifest' and path
'D:\dev\DMWeb\DMWebClient\obj\Test\Package\DMWebClient.SourceManifest.xml'
cannot be created. Learn more at:
http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_EXCEPTION_WHILE_CREATING_OBJECT.)
The details in the Web Publish Activity tab shows the following:
Transformed Web.config using D:\dev\DMWeb\DMWebClient\Web.Test.config
into obj\Test\TransformWebConfig\transformed\Web.config.
Auto ConnectionString Transformed Views\Web.config into
obj\Test\CSAutoParameterize\transformed\Views\Web.config.
Auto ConnectionString Transformed obj\Test\TransformWebConfig\transformed\Web.config into
obj\Test\CSAutoParameterize\transformed\Web.config.
Copying all files to temporary location below for package/publish: obj\Test\Package\PackageTmp.
Packaging into D:\dev\DMWeb\DMWebClient\obj\Test\Package\DMWebClient.zip.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets(3883,5):
Error ERROR_EXCEPTION_WHILE_CREATING_OBJECT: Web deployment task failed. (Object of type 'manifest' and path
'D:\dev\DMWeb\DMWebClient\obj\Test\Package\DMWebClient.SourceManifest.xml' cannot be created.
Learn more at:
http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_EXCEPTION_WHILE_CREATING_OBJECT.)
Package failed.
In VS 2010, I've had to run it as Administrator for deploy to work, and I'm doing so here as well. I've also tried giving Full Control permissions to the project folder to NETWORK SERVICE, LOCAL SERVICE, Authenticated Users, and myself.
In the Package folder, there is the PackageTmp folder (which looks good), and the DMWebClient.SourceManifest.xml file, and that's it. In VS 2010, there's more files there.
DMWebClient.SourceManifest.xml contains:
<?xml version="1.0" encoding="utf-8"?>
<sitemanifest>
<IisApp path="D:\dev\DMWeb\DMWebClient\obj\Test\Package\PackageTmp" />
<setAcl path="D:\dev\DMWeb\DMWebClient\obj\Test\Package\PackageTmp" setAclResourceType="Directory" />
<setAcl path="D:\dev\DMWeb\DMWebClient\obj\Test\Package\PackageTmp" setAclUser="anonymousAuthenticationUser" setAclResourceType="Directory" />
<setAcl path="D:\dev\DMWeb\DMWebClient\obj\Test\Package\PackageTmp\App_Data" setAclResourceType="Directory" setAclAccess="Write" />
<setAcl path="D:\dev\DMWeb\DMWebClient\obj\Test\Package\PackageTmp/DMWeb.config" setAclResourceType="File" setAclAccess="Read,Write" />
</sitemanifest>
In VS 2010, the last line containing DMWeb.config doesn't exist. On top of that, the path to it is wrong. It should be under the App_Data folder.
DMWeb.config is specified in Web.config like this:
<appSettings file="DMWeb.config">
Any help would be greatly appreciated.
This can also happen if there are any files in your project that have been moved, deleted, or renamed from the file system such that Visual Studio doesn't know where to find them.
My error was allmost identical:
C:\Program Files
(x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets
(3883): Web deployment task failed. (Object of type 'manifest' and
path
'D:\B\280\Binaries_PublishedWebsites\ProjectName\ProjectName.SourceManifest.xml'
cannot be created. Learn more at:
http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_EXCEPTION_WHILE_CREATING_OBJECT.)
The reason I found out is in the ProjectName.SourceManifest.xml file.
There is a line: <appHostConfig path="Default Web Site/ProjectName" />
If this webapp and site does NOT exist on the buildmachine, the error occurs. Once I created a dummy webapp site with the same name on the same site, it built!
And solved by removing that section with MsBuild parameters: /p:IncludeIisSettings=false /p:IncludeAppPool=false (i had those 2 to true, so only applies when you have them true)
Found out that I had an old .wpp.targets file from VS 2010, it was called ~DMWebClient.wpp.targets. In VS 2010, by renaming it, it would ignore it and not apply it. It seems like VS 2013 applies any .wpp.targets files regardless of the file name.
By removing that file, web deploy works again.
Thought I would add as none of the other answers fixed my problem, though perhaps more related to Lightswitch Web Deploy than ASP.NET Web Deploy (though OP doesn't specify which).
There are three projects within a standard Lightswitch Template solution. Two of them might be named lightswitchapp.HTMLClient and lightswitchapp.Server. Neither of these should be deployed! You should deploy the third project lightswitchapp.
I had been getting errors like this, which led me to this page.
Web deployment task failed. (Object of type 'manifest' and path 'manifest xml hidden' cannot be created. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_EXCEPTION_WHILE_CREATING_OBJECT.)
Great answer above, regarding the Lightswitch Web Deploy...couldn't find anything about it anywhere...kept thinking MS broke this on purpose because they don't want to support LightSwitch anymore...
In any case, once you go through the steps on publishing the main project from the LightSwitch template, a new problem arises, regarding the publish params if you push to a local IIS.
For all of you struggling with that...first install
httpPlatformHandler_amd64.msi
WebDeploy_amd64_en-US.msi
then, make sure "Web Deployment Agent Service" is running as a service
then, in Visual Studio (I am on VS2015 community), on the Publish Settings tab in the wizard, make sure you have something like this:
Service URL:
http://localhost/MSDEPLOYAGENTSERVICE
Site/Application:
Default Web Site\trax01
where trax01 is the name of your web app that runs under Default Web Site (please notice the back-slash before "trax01" compared to the forward-slash in the label for the setting.
Hope it helps somebody else, because this thing ate my liver! :)
The same exception can still happen in Visual Studio 2019. Additional detail for me was Object of type 'manifest' and path 'manifest xml hidden' cannot be created.
In my case the problem was a MsDeployDeclareParameters item in the {ProjectName}.wpp.targets file. It was attempting to set ACL permissions for the downloads folder, but the folder didn't contain any files so it wasn't present in the staging area.
Adding a file to the downloads folder resolved the problem (as would removing the MsDeployDeclareParameters entry from the {ProjectName}.wpp.targets file).
I tried many Solution by updating security to TLS 1.2 (X)
Removed * or special character from variables and password.
But later I found that, we have * in the password of connectionString in web.config.
I changed my password and it started working for me.

"Parser Error Message: Could not load type" in Global.asax

I'm working on an MVC3 project and receive the following error:
Parser Error Message: Could not load type 'GodsCreationTaxidermy.MvcApplication'.
Source Error:
Line 1: <%# Application Codebehind="Global.asax.cs" Inherits="GodsCreationTaxidermy.Core.MvcApplication" Language="C#" %>
The error I get is cannot load GodsCreationTaxidermy.Core.MvcApplication but in this screen shot the Core part isn't displaying in the error:
Does anyone have any ideas or a solution to this error?
Check that the project output path (project properties / Build) is set to bin and not bin\Release or bin\Debug
For some reason IIS (VS development Server or Local IIS) always accesses the libraries from the bin directory (and won't look up for subdirectories)
Your local web server is running different code than what you're actually working on. Ensure you have stopped debugging, stop your local web server, clean and rebuild as Peter suggested, double-check your global.asax and global.asax.cs, and try again.
If this doesn't work and you are using local IIS, try removing the site in IIS Manager and recreating it manually.
Try modifying your global.asax file (simple add a space somewhere) and re-run. this will force the built in webserver to refresh and recompile the global.asax file.
Also do a clean and rebuild - should fix the problem
This happens sometimes if you change namespace information (project or class level) after the global.asax is generated.
Right click on the Global.asax file and select "Open With" and then select "XML (Text) Editor with Encoding" (other editors may work as well, but this is what I use).
Then edit the "Inherits" section in the XML directive
<%# Application Codebehind="Global.asax.cs" Inherits="GodsCreationTaxidermy.MvcApplication" Language="C#" %>)
so that it matches the actual full name of your Application class. And that's it.
Another option is to copy off all your code from Global.asax.cs and then delete and create another Global.asax file (and then copy the code back into Global.asax.cs).
I closed and reopened visual studio and it worked.
I had to go to BUILD -> CONFIGURATION MANAGER and -- ahem -- check the box next to my project to ensure it actually gets built.
I had this issue today, and it took me a while to find the cause.
Basically, my main VS2015 project was including a sub-project which had been built using a higher version of .Net Framework.
Bizarrely, when you have this problem, VS2015 will happily report that the solution has built okay, but when you try and run the website, it just gives you that misleading error, suggesting that your Global.asax.cs file is wrong.
So, if you see this error, and Cleaning/Rebuilding doesn't help, open your Project's References tree, and check for exclamation marks.
Also, check your Output window for messages like this:
The primary reference "C:\Projects\Business Objects 4\bin\Release\BusinessObjects.dll"
could not be resolved because it was built against
the ".NETFramework,Version=v4.5" framework.
This is a higher version than the currently targeted framework
".NETFramework,Version=v4.0".
The solution, of course, is to right-click on your main project, select the top tab, "Application", and change the Target Framework version to a higher version which matches your sub-project.
It's annoying that Visual Studio 2015 will let you fully build and run Solutions which quietly contain this problem. It's asking for trouble..!
"BUILD -> CONFIGURATION MANAGER and -- ahem -- check the box next to my project to ensure it actually gets built."
That and going to the project folder in windows explorer, pressing options and unchecking the "Read only" checkbox helped.
I just encountered this on an MVC5 application and nothing was working for me. This happened right after I had tried to do an SVN revert to an older version of the project.
I had to delete global.asax.cs and then added a new one by right clicking Project -> Add New Item -> Global.asax and THAT finally fixed it.
Just thought it might help someone.
I was working on an older 'folder based' ASP.NET web project (which I loathe) - and found this to be my fix:
Create an App_Code folder (if you didn't have one already)
Move the Global.asax.vb file into the App_Code folder
The markup in Global.asax can leave out any namespaces (at least, for this style of project, afaik):
<%# Application Codebehind="Global.asax.vb" Inherits="MyApp" Language="VB" %>
...where "MyApp" is the name of the class being defined in Global.asax.vb
Delete the .vs directory from the solution root. Clean. Rebuild.
This issue drives me bonkers once in awhile and I inevitably end up here paging through answers. I suspect there are multiple causes that can produce this exception, this once works for me.
You can also check your site's properties in IIS. (In IIS, right-click the site and choose Properties.) Make sure the Physical Path setting is pointing to the correct path for your application not some other application. (That fixed this error for me.)
Empty the bin folder. Build all the dependent class libraries and refer them in the main project, and build the complete solution.
Source
I have to report that I tried at least 4 suggestions from this post. None of them worked. Yet I am happy to report that I recovered by retrieving from back up. Only had to update my last code changes from log file. Took less then 10 minutes. Spent 3 times that reading this post and trying other suggestions. Sorry.
It was a very weird error. Good luck to anyone else encountering this gremlin.
I have same problem when I have 2 instance of Visual Studio running same project. So I closed both Visual Studio and opened only one instance and It works fine now!
This issue I was solved by giving right permission of the folder as well as check from IIS.
I was given permission to everyone as I am testing in my local environment. But in publish mode I think we give only permission to ASP.Net user.
I too faced the same problem. Despite of following every Answer it didnt work.
Then I changed the "Inherits=namespace.class" to "Inherits=fully qualified assemble name" i.e "Inherits=namespace.class,assemblyname, Version=, Culture=, PublicKeyToken="
Hope it helps.
This can also happen if you accidentally forget to set your VS solution to "Multiple Startup Projects" if you are running a Web and WebApi from the same solution.
You can check this by right-clicking on Solution in the Solution Explorer and select 'Properties". Then look for 'Startup Projects'.
I spent multiple days on this issue. I finally got it resolved with the following combination of suggestions from this post.
Change platform target to Any CPU. I did not have this configuration currently, so I had to go to the Configuration Manager and add it. I was specifically compiling for x64. This alone did not resolve the error.
Change the output path to bin\ instead of bin\x64\Debug. I had tried this several times already before I changed the platform target. It never made a difference other than getting an error that it failed to load the assembly because of an invalid format.
To be clear, I had to do both of these before it started working. I had tried them individually multiple times but it never fixed it until I did both.
If I change either one of these settings back to the original, I get the same error again, despite having run Clean Solution, and manually deleting everything in the bin directory.
The solution for me wasn't any of the above.
I had to delete (and not recreate) Global.asax and Global.asax.cs.
These files existed in the folder, even though they weren't referenced in the project.
Apparently the build still saw them.
Since I use OWIN with Startup.cs, the Global.asax file was obsolete and there was no issue with deleting it.
Yes, I read all the answers. However, if you are me and have been pulling out all of what's left of your hair, then try checking the \bin folder. Like most proj files might have several configurations grouped under the XML element PropertyGroup, then I changed the OutputPath value from 'bin\Debug' to remove the '\Debug' part and Rebuild. This placed the files in the \bin folder allowing the Express IIS to find and load the build. I am left wondering what is the correct way to manage these different builds so that a local debug deploy is able to find and load the target environment.
I also got the same error...check the name of the Application you developed properly ie. the namespace and the assembly name alloted and also try physically changing the name of the folder created for the application, all of this should be same as the name in the above namespace present in the file global.asax
I also got the same error...check the IIS Configuration of your Virtual Directory and be sure that Properties - ASP.NET - ASP.NET Version is the same of Project Properties - Application - Target Framework. (That fixed this error for me.)
My app was built in an older version of VS, and didn't have a bin folder. I had upgraded it to a newer version, and had a nightmare getting it to deploy. I finally tracked this error down to the Project > Properties > Application. The Target Framework was set to 2.0; changing it on the server to match in the IIS Manager/App Pool solved the issue for me.
I found that changing the Namespace on the project, without refactoring that across the whole solution was my problem. Check your project Properties and see what your namespace is, ensure that lines up, across the board.
The problem for me is that I didn't include global.asax.cs in my project. And because I was copying files from a .net 4.5 to a 4.0 I didn't comment out lines that are not needed in 4.0. Because it was not included visual studio compiled it anyway without issues. But when I included it, it highlighted the lines that cause problems.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
//using System.Web.Http;
using System.Web.Mvc;
//using System.Web.Optimization;
using System.Web.Routing;
namespace YourNameSpace
{
public class WebApiApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
//GlobalConfiguration.Configure(WebApiConfig.Register);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
//BundleConfig.RegisterBundles(BundleTable.Bundles);
}
}
}
I spent literally a day trying to resolve this.
The only thing that worked was deleting the .sln file, creating a new one, and adding the projects back in one by one.
¯\_(ツ)_/¯ - Programming - ¯\_(ツ)_/¯
For my case, the web assembly was part of GAC... so after build, it need to installed in GAC and it worked.
I encountered this error message and eventually discovered that the error message was misleading. In my case there appears to have been a routing issue in IIS which caused the global.asax from another site on the web server to be read thus generating the error.
In IIS, my site was bound to http:*80:webservices.local and contained an application called MyAPI. I received the dreaded message when calling the MyAPI application using the web server's ip address.
In order to successfully call my application I had to add a host file entry for webservices.local on all of the machines that called the MyAPI application. Then all of my requests had to be prefixed with http://webservices.local/MyAPI/ in order to route correctly.
I tried absolutely everything here and nothing worked. My project was in VS 2013. I have since upgraded to VS 2015 and have been creating all of my new applications in 2015 but loading, compiling, building etc all of my old apps that were built in 2013 in that version.
I ended up just loading the solution in 2015 and it resolved it for me.

What is the process involved in viewing a webservice in a browser from within visual studio?

I have created a new VS2008 ASP.Net Web service project, with the default name WebService1. If I right click on the Service1.asmx file and select 'View in Browser' what are the processes that go on to make this happen? I am asking because I have a situation where when I run this from a visual studio project started in our development shell (which sets up a common build environment) I cannot get the web service to show up in the browser.
It starts the asp.net development server and creates a single file:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c43ddc22\268ae91b\hash\hash.web
but when I start it from a stand alone project i get a whole slew of files in here:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\edad4eee\d198cf0e\App_Web_defaultwsdlhelpgenerator.aspx.cdcab7d2.vicgkf94.dll
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\edad4eee\d198cf0e\service1.asmx.cdcab7d2.compiled
etc etc
I am trying to debug this but not really getting anywhere. i have inspected the output from VS but the only option I get is for the build output, which is basic and doesn't really contain any information that is useful. I have tried running both versions with DebugView running but no output there either.
I would like to know if there are any log files I could look at, or if anyone has any suggestions on how I might be able to debug what is going wrong here?
For completeness the output I get when it doesn't work is:
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not create type 'WebService1.Service1'.
Source Error:
Line 1:
Source File: /Service1.asmx Line: 1
Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3082
Ok, not sure that its perfect but I found a resolution to this issue. the problems seems to be that the development shell redirects the <OutputPath> of the projects visual studio is building, and this was causing problems as, although the dependencies of the web service project were being copied into the $(ProjectDir)Bin\ directory, the actual webservice dll itself was not. The solution (workaround?) seems to be to add this to the post build event command line:
xcopy /y "$(TargetPath)" "$(ProjectDir)Bin\"
Then i am able to right click on the .asmx file and select view in browser and everything works as expected.
Hope this might help someone else in the future. or maybe even me in another place and time.

Visual Studio 2008 Generation of Designer File Failed (Cannot use a leading .. to exit above the top directory)

It seems the universe is against me this week. I have been happily coding away on my ASP.Net application for weeks now without issues. Today I tried to add a textbox to a form, and on saving the form, I received the following error:
Generation of designer file failed: Cannot use a leading .. to exit above the top directory
I googled, but with no luck. I did find a blog post that shows how to add a key into the registry so that Visual Studio logs more detail about these errors, and the following is what shows up in the generated log file:
-------------------------------------------------------------
C:\[path to aspx file]\PageName.aspx
Generation of designer file failed: Cannot use a leading .. to exit above the top directory.
-------------------------------------------------------------
System.Web.HttpException: Cannot use a leading .. to exit above the top directory.
at System.Web.Util.UrlPath.ReduceVirtualPath(String path)
at System.Web.Util.UrlPath.Reduce(String path)
at System.Web.Util.UrlPath.Combine(String appPath, String basepath, String relative)
at System.Web.VirtualPath.Combine(VirtualPath relativePath)
at System.Web.VirtualPath.Combine(VirtualPath v1, VirtualPath v2)
at System.Web.VirtualPathUtility.Combine(String basePath, String relativePath)
at Microsoft.VisualStudio.Web.Application.Parser.BeginParse(String virtualPath, String text)
at Microsoft.VisualStudio.Web.Application.Generator.UpdateDesignerClass(String document, String codeBehind, String codeBehindFile, String[] publicFields, UDC_Flags flags)
-------------------------------------------------------------
And, of course this means that there is no way I can reference the newly added text box from the code behind.
I thought it might be just this page giving the issue, but I have tried three other pages with the same result. I haven't changed the environment for weeks, so I am not sure how this happens.
Any ideas out there?
Thanks in advance
Hamish
For anyone that has the same problem in the future, here is what caused it...
When debugging the application, instead of using VS's built in web server, I was using IIS. For some reason, this caused the above error. I changed the app to use the built in web server, ran it, and then reverted it back to the IIS settings, and all was good.
Not sure why it happened, perhaps something went a little haywire in the plumbing. I'm just glad its back and working.
Generation of designer file failed:
Cannot use a leading .. to exit above
the top directory.
What a wonderful error message!
I had this problem when I clicked on the designer view of a web user control in VS 2010.
In my case I noticed that the ascx file icon was showing a blue mark in the bottom left corner.
I clicked on the properties and found that the files (ascx, ascx.cs and ascx.cs.designer.cs) were not in the project path but on my desktop.(I don't know how that happened)
This seemed to line up with the usual cryptic MS error message relating to directory.
To fix this I removed the files from the project (ascx, ascx.cs and ascx.cs.designer.cs) then added a new Web User Control to the project with the required name and copied the contents back in from the files on my desktop.
So check your file paths if you see
this error message.
Change the solution configuration from Release to Debug.
It's working now for me.
Check the output of the Web project based on your configuration (Release, Debug, ..) and platform (Any CPU, x86, ..).
In my case, this output folder was set to bin/ and after adding a new configuration for x86 platforms this option was set to bin/x86/Debug or bin/x86/Release. And these errors started to appear when adding new files to project.

Resources