I ran the wizard to create an .asmx web service from my BizTalk 2010 orchestration. It ran and created a solution in the C:\inetpub\wwwroot\myproject directory on disk. It created a .sln file and under App_Code it created a couple of .cs files. But there is no .csproj file. When I open the .sln file it says: "One or more projects were not loaded correctly. Please see the Output Window for details."
The output window says:
http://localhost/AppName_Proxy : error : Unable to open the Web site 'http://localhost/AppName_Proxy'. The Web site 'http://localhost/AppName_Proxy' does not exist.
I'm working on getting the app to open in IE browser as well; Not sure why .sln wouldn't load because of this, but I consider that a separate issue.
My question is why isn't there a .csproj file in the solution?
With .asmx projects the website itself takes the place of the .csproj.
The problem was that SharePoint was on the machine, and it takes over Port 80. A co-worker had created a "Service Website" for our BizTalk services that runs on Port 9000.
So I edited the .sln file to add the port 9000 as shown below..
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "http://localhost:9000/AppName_Proxy/", "http://localhost:9000/AppName_Proxy", "{D147E9B1-6794-424F-B187-F3262F5A4D07}"
EndProject
... remainder of .sln file not included here.
Earlier today I had tried putting the website under Sharepoint, and unblocking .asmx, but other issues beyond scope of this question.
Related
I have an ASP.NET Web Application (.NET Framework) that was created in the default location of C:\Users\mcarr\source\repos\ It loads fine from this location.
I was asked by my manager to keep projects out on a mapped network drive. So I created the source and repos folders on the mapped drive and copied the entire project to the new location.
It won't load from here. I get an error message stating that the creation of the virtual directory https://localhost:XXXXX/ failed. Cannot read configuration file. You will need to manually create this virtual directory in IIS before you can open this project.
I have researched with no luck...
Cannot read configuration file due to insufficient permissions
Visual Studio - Cannot Read Configuration File
I did try the suggestion of removing the URL from IISUrl in the project file.
Thinking that it may be some other configuration file, I even created another new project in VS2019 and changed the location to the repos directory on the mapped drive from the Configure your new project window of VS2019, and saved the newly created project directly there. Even this new test project, created in place, gives the same error message.
Any ideas?
Full environmental disclosure:
VisualStudio 2019 Enterprise with Jetbrains Resharper installed.
64-bit Windows 10 Version 21H2 Build 19044.1826
Open Enterprise Server (OES) network. (Used to be known as Novell) (I suspect this is the root of the problem)
Turns out that OES and Windows don't play well together. I have several mapped drives available for me to store projects on. Some are on OES servers and others are on Windows servers. A help desk guy told me that when copying files from an OES drive to a Windows box he has to put them in C:\temp first, then move them from the temp folder to the desired folder. Windows doesn't trust files from an OES share.
So I moved my project to a mapped drive on a Windows box and the IIS Express error is gone.
I'm a programmer, not a network admin, and this was new to me.
But, problem solved.
I am using Visual Studio 2017 to develop and publish an ASP.NET web app using Web Deploy against IIS. My web app assembly is signed, so my project contains a .snk file in the root folder. When I deploy the web app to the server, the .snk file is sent over as well.
I imagine this is not a good idea, as the .snk contains a private key that must be kept secure. I don't like the idea of having copies of my .snk file scattered over various web servers. As far as I understand, Visual Studio should use this file to sign my assembly when the solution is built, and not deploy it to the server.
Am I correct? If so, how can I stop Visual Studio from deploying this file to the server?
I had a similar issue when publishing in Visual Studio 2019 but found that the SNK file had been added to the web project with a build action of "Content".
Simply editing the SNK file properties and changing the "Build Action" from "Content" to "None" prevented it from including the Strong Name Key file in the published folder.
Unless specified otherwise, an SNK file is not served by IIS as a valid MIME type. When someone types the url to the file in the browser they will get a 404.
If you do not want it send to the server in the first place you can also delete it from Visual Studio Explorer, but still keep the file in the folder (note that VS will delete the file also, so you need to copy it to the folder again manually in Windows Explorer).
A cleaner solution would be to create a wpp.targets file and specify the files/folders for exclusion in the publish.
https://learn.microsoft.com/en-us/aspnet/web-forms/overview/deployment/advanced-enterprise-web-deployment/excluding-files-and-folders-from-deployment
In your case the file would look something like this: MyProject.wpp.targets
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ExcludeFromPackageFiles Include="MyFile.snk">
<FromTarget>MyProject.wpp.targets</FromTarget>
</ExcludeFromPackageFiles>
</ItemGroup>
</Project>
My (C# Asp.net) website works locally, but when I publish it to Azure, it is missing a dll (OpenXML SDK).
After extensive googling, I found that I should set the Copy Local property to True. The thing is though, there is no references node in my solution explorer. Even if I create a new project, and add a few references, there is no references node there. (MS Visual Studio Express 2013 for Web)
Here is the error:
Parser Error Message: Could not load file or assembly [...] The
system cannot find the file specified.
The error is caused by this line (in my Web.config file):
<add assembly="DocumentFormat.OpenXml, Version=2.5.5631.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
Please help me to either:
display the references node
or manually upload the needed dll (feels odd)
or add some magic command to my Web.config to make it automatically upload the used dll-s.
The references node was missing from my Solution Explorer because I chose to create a Web Site, not a Web Application. For Web Sites, the actual physical folder structure is what gets synced to the server. It doesn't have a References node (and, by the looks of it, many other things are missing, since the basic idea is bit different - see this discussion for more details).
There were two solutions for the problem:
Converting my Web Site project into a Web Application project (instructions here)
Adding a Bin folder in my project folder (that is the folder with the project name, the on that has my .aspx files in it), and including the necessary dll in that folder
I chose the latter. After publishing the site again, Visual Studio automatically uploaded the Bin folder with the dll inside it, and it worked like a charm.
So I have taken over an ASP site.
I have copied the solution directory to my local machine.
When I go to open the solution, 9 out of 10 of projects open fine except for the web project.
The following error is in the out put window
error : Unable to open the Web site 'C:\Users\john.smith\Documents\Visual Studio 2010\WebSites\xxx'. 'The Web site C:\Users\john.smith\Documents\Visual Studio 2010\WebSites\xxx' does not exist.
Should this be the case?
Should the source sode need to refer to the websites directory?
Thanks!
In earler Visual Studio versions web sites have been split up into two directories. You need to copy the second directory as well, yes.
I have an ASP.net that I built in VS2010 running in iis7 however when I go back into VS and make updates to the code behind file and re-publish the application still acts as it has before I made the changes. I have tried deleting and republishing all the files and restarting the app pool but it still doesn't affect how the application behaves.
project-->Property's--> Package / product web--> Items to deploy --> All files in this project folders
now publish your project.
your new files also added in publish folder. . .
DO NOT publish your vb and cs file on there server unless you feel like having your source code potentially exposed. There have been multiple vulnerabilities that have allowed code download.
Publish the application to a folder via the visual studio publish menu.
On the server, go into your temporary aspnet folder for example:
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
and find your app and delete it. If you cannot delete the files stop the worker process (w3wp.exe) or restart iis.
Republish and all should be good. If you are in doubt if that version is getting executed then add some logging in the new version or trace information.
There are two options for publishing an ASP.NET site to a server:
Copy the .aspx AND aspx.vb (or .aspx.cs) files to the server. The first user to hit the server causes compilation so it takes a little bit of extra time for them. Once that's done, subsequent hits should not be impacted.
Copy just the .aspx files - and a compiled DLL to the server. The DLL contains the compiled code so it doesn't exist on the webserver. The first user does not have to wait for compilation and the VB or C# source code is not on the server, potentially accessible to hackers.
It sounds like you've compiled the site to a DLL but that DLL isn't getting published to the server when you re-publish. Have you recompiled the site before publishing?
I faced similar issue with WPF single file exe publish.
while debugging from VS my changes were visible.
But when I pasted the exe to deployment folder, the changes weren't there.
I had to change the version number to see my changes when I run the exe from the deployment folder.
I may have to do with how single file exes are handled. The extracted cache may not be getting updated.