Error deploying visual web part to SharePoint 2013 (Activate Features) - c#

I'm trying to deploy a simple web part to SharePoint 2013 using Visual Studio 2013 and I am getting the following error:
Error occurred in deployment step 'Activate Features': Feature with Id
'....' is not installed in this farm, and cannot be added to this
scope.
Spent a long time trying to find a solution to this. Several blogs and forums talking about it and giving different solutions (none worked for me).
Feature scope is set to site, and solution is not set to sandbox.
Deployment works if I select the option to skip activation. But then when I go to Site settings and look at features I cannot find it. (I looked at both Site Features and Site Collection Features).
I have tried to change permissions in several different places. I made the user the site owner as well as the site collection administrator (tried both primary and secondary), but it didn't seem to make a difference.
I'm new to the whole complicated world of SharePoint, so bare with my lack of exact terms. Before going for this farm solution I tried with sandbox and everything worked fine: I was able to debug and deploy.
I know there's a way to deploy using PowerShell but I don't think that's the ideal solution here.
Any suggestions? Thanks!

if you skip activation you should deploy feature by script.
Steps to deploy a webpart
1 - in the project settings go sharepoint and select "No Activation" for "Active Deployment Configuration"
2 - Deploy the project
3 - Run the code below in management shell (Run as administrator the management shell)
install-spfeature "yourProjectName_FeatureName" /*exp: TEST.Webparts_Feature1*/
4 - Deactivate - activate fature in "Site Collection Features"

Related

I get a deployment Error when trying to publish a solution to Azure

Template deployment failed. Deployment operation statuses: Failed: /subscriptions/7696ec04-ba92-4f74-99ad-27808b065cfe/resourceGroups/BookService20211123165113ResourceGroup/deployments/website_deployment_20211124144346 (exception)
error (SubscriptionIsOverQuotaForSku): This region has quota of 0 instances for your subscription. Try selecting different region or SKU.
There is currently (as of the time of this writing) an issue with creating a new Azure App Service directly from the 'Publish...' feature in Visual Studio for 'Free' Azure accounts. I do not believe Mohammad's answer is the best route since you are definitely allowed to use App Services under the 'Free' subscription in Azure and you should not have to upgrade your subscription to 'Pay as you go'.
To resolve this and avoid upgrading your subscription:
Open Azure portal online
Search for 'App Service'
Pick 'Create app service'
Pick your Subscription and Resource Group
Give it a Name
Fill in your appropriate parameters, such as: Code, .NET 6, Windows, EAST US, etc.
Pick your Windows Plan
Your 'Sku' should still say 'Free F1'
Zone redundancy will probably be greyed out
Press 'Review + create'
Press 'Create'
Wait for the deployment to finish and make sure you can see it in App Services.
Go back to Visual Studio and pick 'Select Existing' instead of 'Create New'
Open the folder structure all the way and pick the item your created
(It will probably be right above 'Deployment Slots', but if nothing shows up, then the only solution I have for you is to upgrade to Visual Studio 2022 or open it in another version of Visual Studio and select 'Publish' again. That worked for me.)
Press OK
The exact steps may vary as Microsoft changes things, but the concept is that currently for Free accounts you have to to create the App Service in the Azure Portal first, instead of creating it through 'Publish' in Visual Studio.
I was using a trial subscription.
I upgrade my subscription pay as you go (Basic).
Now it works for me.

ASP.NET Application Not being accessed by web.config Writing permissions

2 Situations here of permissions and access:
Cannot Read Configuration File due to Insufficient permissions
This has happening on every single VM instance of Windows Server V. 2019 standard Build 17763.rs5
Solution One by many obfuscated answers in this website: change the Application Pool settings in Advance settings, Identity to LocalSystem: Server responds to provide the basic pages, But no layouts, css, no images, Nothing, Pure HTML served at the end and Modules not even signalled (thank you VS Debugger for telling me this 10 times in a row)
Solution deux Use Windows Security ownership and add the role of the IIS and the other variants that server other roles, NOPE, nothing. also probably security risk.
Situation 2
My Workstation had replicated same deployment process from ASP.NET MVC template from visual studio 2019 and application ran fine. Once.
I had a deployed WebApp in my local machine workstation with the Default template for ASP.NET in Framework (not core, I see you there dude), and the IIS module built, worked fine, did it is purpose. and Only worked in my workstation and my final goal is to be it deployable on other machines... UNTIL:
Cannot add modules to Website Templates made in ASP.NET (Framework)
After that IIS does not allow me to do anything,some Roslyn something in some answers but that didn't work, but were mostly manual removal of it to make it work, which doesn't fit to make a deployment to many computers at once in few clicks (not my choice).
Did my VS updated something? or IIS? Why my regular setup worked just few days ago and now Nothing, even from scratch cant do it's purpose,
Any Ideas? Questions to my questions?

Visual Studio 2013 - IIS Express not serving aspx files

I was compelled by work to upgrade from Visual Studio 2010 to Visual Studio 2013. In VS 2010, I used the built-in host for viewing .net apps locally and everything worked just fine. Visual Studio 2013 dropped support for the built-in host and compels everyone to use IIS Express.
My trouble is that IIS Express won't serve up "[anything].aspx" no matter where in the folder tree of the project it resides. I created two test files in the root of the project: HelloWorld.html and HelloWorld.aspx (c#) and made both to simply show a page saying "Hi" with the asp.net file showing the current date and time. I then copied these two test files into an arbitrary folder in the project. After building the project (unnecessary, I know), I did a "View in Browser" for all test files. In all cases, the HTML files displayed properly. The aspx files cause a "HTTP 400 Bad Request" / "The webpage cannot be found" error.
I've prowled Stack Overflow and Google and read about some near-misses but ultimately came up empty for this specific problem. I'm hoping this is a simple configuration issue, but the answer so far eludes me. Thanks in advance for your kind assistance!
Edit:
Thanks to Lex Li's suggestion of using the Jexus Manager to see what's going on with the IIS Express configuration, it shows that zero apps are assigned to any of the default application pools. Correspondingly, when clicking on the home of the website in the Jexus Manager, the .Net section of the website is absent.
Edit #2:
The web app is assigned to one of the default IIS Express app pools: Clr4ClassicAppPool.
Sound weird, did you try open the iis express xml applicationhost.config and check there the mime type or the application pool settings?

Using C# within IIS7

I'm very new to IIS7 and somewhat new to C#. My project right now is to use C# and IIS7 to create an interactive website with various clickable items and features. The C# programs are written and working properly, however I honestly do not know much about IIS7 despite trying to research it for a good amount of time.
My question is, how do I integrate C# scripts into ISS7 so that the website can be hosted with said scripts running smoothly within it? In other words, how do I combine the powers of ISS7 and my C# code to make a website? What must I do within ISS7 to utilize my C# code?
I've already "created" my new site within IIS7 and given it the appropriate bindings. I'm just not sure where to go from here.
I realize this may be a broad question/answer, so pointing me to where information on this topic can be found would also be greatly appreciated. I've searched through the official IIS website without much luck. Thank you.
It depends on what kind of code you want to run. The best start might be a straight forward web project, and not web services/web api.
Create a new web site project in visual studio, and hook it up with IIS in project properties-> web -> uncheck "Use IIS Express" and click "Create Virtual Directory". When you build the solution next time, it will be "deployed" to your local IIS.
A virtual directory maps to a physical directory on a computer. The web application will be running on your machine. If you have IIS on a web server that is not your development machine, then you have to deploy your web application to this server.
You might find this usefull: How to: Create IIS Virtual Directories in Visual Studio
The relationship between Visual Studio and IIS is that you can create virtual directories from Visual Studio. This means that when you visit localhost/MvcApplication1, IIS serves you the web application that is mapped in C:\Users\<Username>\Documents\Visual Studio 2012\Projects\MvcApplication1

Deploying an N-Layered ASP.NET Webforms Application In A Shared Hosting

I Have a solution that containts 4 layers (3 Class Libraries and 1 Web Application). I Need to deploy this solution to my shared hosting account. I've read a little about deployment and I hope I could perform a 'Precompiled Deployment' because as far as I know, It gives a better experience for the first time users as it's already compliled.
I don't see the "Publish Application" or whatever under the 'Build' menu, I setuped Microsoft Website Copy Tool. and I have on my shared account the Deployment Tool. I'm using Visual Studio 2010 Pro.
..Any one can help with details to deploy my first website on the internet !? :)
Right click on your web application the solution explorer. Select 'publish' from there or is it disabled?

Categories

Resources