How do I rename paths in webmatrix without editing a config file? - webmatrix

Microsoft Webmatrix 3 requires me to modify applicationhost.config in order to edit the path of a website. When I create a New Website, it automatically defaults its path folder name as EmptySite or EmptySite#, depending on what sites are already in the system according to the config. I do not see a way to fix that, other than modifying the config file directly. Every single site created will have this folder name, and it cannot be changed through the application. The site name does change, but that causes the other problem:
Webmatrix 3 does not delete sites from the config when a site is deleted in the program, so I cannot rename one site "This Site" once, delete it, then try to rename another site to "This Site". It will say a site with that name exists, yet it doesn't, simply because it does according to the config. I haven't found a solution other than to edit that file, which is an action that shouldn't have to be made.

Editing the applicationhost.config file is the only option available to you. If you think WebMatrix should offer better options, post some suggestions: https://webmatrix.uservoice.com/forums/128313-webmatrix-suggestions.
Just don't hold your breath.

Related

Upload a file through a microsoft webtest

I have a .webtest that I am intending to use to load test uploading a file to a website. I am using the webtest framework that is built into visual studio with the intention of running my larger scale tests from azure.
I created a new webtest and recorded the steps, including the file upload. This all recorded correctly, but the problem is that the File Upload Parameter was just recorded the filename (not the bytes). This means that the test needs to have access to the file that will be uploaded during running.
I also added the file to the project and set it to be content.
The problem is that the file isn't getting copied over during running. I found a blog post https://blogs.msdn.microsoft.com/edglas/2008/08/05/how-to-upload-a-file-in-a-web-test/ which appears to answer my question but the visual studio ui has changed and the option is no longer available.
I cannot use an absolute url c:\files\filename.docx because i need to run this from azure.
I also cannot post the file somewhere on the internet because it has to be a path, not a url.
I have posted a queston to the blog post, but it doesn't seem very active and am really at a lose for where to go from here.
TIA,
-Logan
The "Deployment" functionality shown in the last screenshot of Ed Glass's blog is now in the .testsettings files of the solution. (The blog shows a window with a "localtestrun.testrunconfig" file.) If you have more than one .testsettings file then ensure that the context menu of the correct file has the "Active load and web test settings" ticked.
In the deployment section of the .testsettings file, tick "Enable deployment" and add the directory or file(s) to be used in the tests. After running a test you should then find that the items have been copied into a subdirectory of the TestResults\{{name+date+time}} directory, as described in the blog.
New .testsettings files can be added to a solution as follows. From the context menu of the solution (the topmost item in Solution Explorer), select Add => New item => Test settings (from the left hand side of the "Add new item" window), then fill in the forms. New files can also be created via the "Save as" button in the test settings editor, but this requires a file to already be open.
When creating new .testsettings files I recommend changing the "Name" field in the "General" section to match the filename. Not doing so (after using "Save as") has left me confused because two or more files appear to have the same name. I normally have up to three .testsettings file in a solution: One for local use when developing tests. Another (often named "cloud" or "vsts") configured for cloud load testing with VSTS. The third version (often named "agent" or "remote") for use with controllers and agents.

Automatically checking out solution - because new files are in a non-source-controlled folder?

I've recently upgraded to VS 2013, and I'm seeing that my site's solution is automatically being checked out on opening.
I suspect that this is because the site uses Umbraco, and consequently the App_Data folder is often cleared down... Umbraco will then re-populate indexes and config files within that folder when the site is run.
I've believe I've excluded the App_Data source from source control (right-clicking shows an option to Add files to source control), and that therefore new items within that folder shouldn't affect the solution, but is that right?
I know if I create a new file in, say, the images folder in the solution that it will be automatically added to the project (which is quite handy)... is there any chance it's doing the same thing with App_Data? Is there a setting somewhere to alter that behaviour?

Why is Visual Studio no longer letting me open a simple flat website folder?

I've always used VS2010 to open a bunch of flat websites which live on my local disk (File -> Open -> Web site).
e.g Foobar website at:
c:\Projects\Foobar
This traditionally worked fine (whether or not VS2010 is the right tool for editing simple HTML files)
However, I've moved to a new PC and this simple idea of opening a flat website inside VS2010 is all screwed up.
It'll open any folder once but if I try and reopen the website it has thereafter decided that I want my website content in a subfolder. It spawns a subfolder at
c:\Projects\Foobar\Foobar
and is determined to use that for content (of course it's empty, and no, I don't want to adopt that folder structure).
Is there any way to force VS to use my plain old root folder website as it used to on my old machine?
Edit
I can, sort of, get to what I wanted by deleting both the foobar.sln file and the foobar/foobar folder and then reopening. But as soon as I then exit and try to reload the website VS complains:
Unable to open the Web site 'C:\Projects\foobar\foobar
The foobar.sln file is just a simple XML file with a path to every relevant project. Open the site in VS once, then close it and edit the .sln file manually (in Notepad or something similar). Look for the folder path C:\Projects\foobar\foobar and change it just C:\Projects\foobar.

Changing PublishUrl property in csproj file

I need to be able to change the PublishUrl property in my Excel VSTO project's csproj file in order to manage which publish url is used based on the configuration that is set in the configuration manager. This needs to happen regardless of what the developer enters in the Publish Wizard or the project properties window. I really need to control it at the point of publishing, based on the configuration set. I have found no solutions that work and it seems that this would be more common than I am finding.
I think this article will help you. You can create a small script to re-sign the files, and when you do that, you can set the URL. The article shows an example (but w/o the URL -- it's just another option available when using mage).

VS2010 project folder Unable to change Read Only attribute

I have a VS2010 solution file connected to TFS. My Solution contains 3 projects for Data, Business and the Web front end.
I need to copy this solution file and related folders to a network location from where it will be moved to a different source code system.
I tried copying my solution file and related files and it has a read only attribute associated to it. I removed the read only attribute and right click and properties the read only attributes still exists.
I think it is some form of association between the solution file and TFS. Is there a solution remove the read only attribute?

Resources