Our company was glad to see the release of the C# plugins for sonar, and jumped on the first release. However, we seem to be running into an execption reported by the ProjectLinkSensor. Here's what we did:
On a Windows XP machine, we installed the following:
Windows 7 Development kit (to get to FxCop)
Fxcop 10.0
Gallio
Sonar 2.9 RC1 (running the Derby database)
Maven
2.2.1
Then we checked out the solution, and placed the following pom.xml in the directory where the sln file is:
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.rolfje</groupId>
<artifactId>SomeSilverlightProject</artifactId>
<version>1.0-SNAPSHOT</version>
<name>SomeSilverlightProject</name>
<properties>
<sonar.language>cs</sonar.language>
</properties>
<build>
<sourceDirectory>${basedir}</sourceDirectory>
</build>
</project>
In the home directory of the user that's running the maven build we've placed the following settings.xml:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<profiles>
<profile>
<id>dotnet</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<sonar.gallio.mode>skip</sonar.gallio.mode>
<sonar.gallio.installDirectory>C:/Program Files/Gallio</sonar.gallio.installDirectory>
<sonar.fxcop.mode>skip</sonar.fxcop.mode>
<sonar.fxcop.installDirectory>D:/Program Files/Microsoft Fxcop 10.0</sonar.fxcop.installDirectory>
<sonar.partcover.mode>skip</sonar.partcover.mode>
<sonar.partcover.installDirectory>C:/Program Files/PartCover/PartCover .NET 4.0</sonar.partcover.installDirectory>
<sonar.gendarme.mode>skip</sonar.gendarme.mode>
<sonar.gendarme.installDirectory>C:/Program Files/gendarme-2.6-bin</sonar.gendarme.installDirectory>
<sonar.gendarme.mode>skip</sonar.gendarme.mode>
<sonar.stylecop.installDirectory>C:/Program Files/Microsoft StyleCop 4.3.2.1</sonar.stylecop.installDirectory>
<sonar.jdbc.url>jdbc:derby://localhost:1527/sonar</sonar.jdbc.url>
<sonar.jdbc.driver>org.apache.derby.jdbc.ClientDriver</sonar.jdbc.driver>
<sonar.jdbc.username>sonar</sonar.jdbc.username>
<sonar.jdbc.password>sonar</sonar.jdbc.password>
<sonar.host.url>http://localhost:9000</sonar.host.url>
</properties>
</profile>
</profiles>
</settings>
Please note that I put "skip" in front of all modules. I did this one by one, hoping that switching off one of these modules would remove the error and I would be able to give you a clearer bug report. However this did not help.
When I go into the project directory (where the sln file is) and I run the following command:
mvn -e clean sonar:sonar
I see that the maven sonar plugin does analysis, fetches settings from the local sonar instance, and generates the expected output files (target/sonar/stylecop-msbuild.xml for instance). However, these reports do not get uploaded to sonar, and I see the following error being reported by maven:
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Can not execute Sonar
Embedded error: org.sonar.plugins.core.sensors.ProjectLinksSensor has unsatisfied dependency: class org.apache.maven.project.MavenProject among unsatisfiable dependencies: [[class org.apache.maven.project.MavenProject]] where org.sonar.batch.bootstrap.ProjectModule#2c507f:135<I<org.sonar.batch.bootstrap.BatchModule#659812:139<I<org.picocontainer.DefaultPicoContainer#eb1882:44<| was the leaf container being asked for dependencies.
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Can not execute Sonar
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
Aside from the rather unhelpful error (ProjectModule#2c507f doesn't really tell me much), this looks like a nasty bug, which is causing the sonar upload (at least for me) to not work.
Did anybody else have this issue? What is causing this and why is the error reporting so terrible in this case?
Please note taht I've also reported this as a bug on Jira, because I really think the Sonar/C-Sharp plugin ecosystem is leaving me in the dark here. However, it was put into the "Wont't fix" state without additional information. The Jira bug is here: https://jira.codehaus.org/browse/SONARPLUGINS-1264
I don't know if this will solve your problem, but I noticed that you refer to the C drive in all of your <sonar.*.installDirectory> tags, except for <sonar.fxcop.installDirectory>.
Oh, and you could also try to disable the stylecop module since you've accidentally copy-pasted <sonar.gendarme.mode>skip</sonar.gendarme.mode> in front of that module...
I am one of the main developers of sonar for c#.
I did not seen your jira ticket before. I actually agree with Fabrice, you should have send a mail to the user mailing-list.
About your issue, my first guess is that there is an error with your pom.xml file.
If you use "mvn -e clean sonar:sonar", you need to declare in the pom.xml file the "maven-dotnet-plugin" plugin. The "clean" part will be performed by this plugin.
Also, the correct command line would rather be "mvn clean package sonar:sonar", there will not be any assembly to analyse.
For more information on the maven-dotnet-plugin you can check out the documentation on :
http://maven-dotnet-plugin.appspot.com
You will find a pom example here :
http://maven-dotnet-plugin.appspot.com/configuration.html
Hope it helps
Related
I easily configured to get the coverage result for .NET Core Projects in Azure DevOps, but no luck with .NET Framework Projects. So, I would be so grateful to get suggestion on this because coverlet documentation is clearly saying that we can also use it for .NET Framework Projects.
This question is kinda similar to mine but I didn't see any answer there,
Can you use Coverlet to get code coverage data in a .NET Framework project?
Finally, I found a simpler solution. Here it is,
Add <IsTestProject>true</IsTestProject> in test project file.
Run the commend dotnet test/dotnet test /p:CollectCoverage=true being at test project location(where
TestProject.csproj exist)
You might get following error after running the command,
The imported project "C:\Program Files\dotnet\sdk\3.1.100\Microsoft\VisualStudio\v16.0\WebApplications\Microsoft.WebApplication.targets" was not found.
In the project file(which you want to unit test and get code coverage), change following
Import statement
This, <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
To, <Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
This worked for me both locally and with Azure DevOps.
Note: Don't forget to install Coverlet.msbuild in your test project.
Update:
Above approach works only if you don't get ".Microsoft.WebApplication.targets was not found" error. Commenting suggested import statement will make publish fail at the end, which is obvious. So, I ended up using Coverlet.Console and it's working smoothly without any error. But, to use coverlet.console I needed TestProject.dll file instead of project file(.csproj); so I had to add extra build task for test project. Here is the documentation how to install and use Coverlet.console
Hope this will be helpful for the ones who end up landing here.
Yes, you can can code coverage data from a ASP.NET project. And it's simple as #riQQ suggested in this thread.
The following content is for supplements and reproduce #riQQ's answer in above thread.
Prepared a webform app and .net framework unit test, added the coverlet.runsettings file in repo, the content refering Coverlet options supported by VSTest integration:
<?xml version="1.0" encoding="utf-8" ?>
<RunSettings>
<DataCollectionRunSettings>
<DataCollectors>
<DataCollector friendlyName="XPlat code coverage">
<Configuration>
<Format>json,cobertura</Format>
<Exclude>[coverlet.*.tests?]*,[*]Coverlet.Core*</Exclude> <!-- [Assembly-Filter]Type-Filter -->
<Include>[coverlet.*]*,[*]Coverlet.Core*</Include> <!-- [Assembly-Filter]Type-Filter -->
<ExcludeByAttribute>Obsolete,GeneratedCodeAttribute,CompilerGeneratedAttribute</ExcludeByAttribute>
<ExcludeByFile>../dir1/class1.cs,../dir2/*.cs,../dir3/**/*.cs,</ExcludeByFile> <!-- Absolute or relative file paths -->
<IncludeDirectory>../dir1/,../dir2/,</IncludeDirectory>
<SingleHit>false</SingleHit>
<UseSourceLink>true</UseSourceLink>
<IncludeTestAssembly>true</IncludeTestAssembly>
</Configuration>
</DataCollector>
</DataCollectors>
</DataCollectionRunSettings>
</RunSettings>
Configure the VSTest task:
It can generate the coverage file successfully:
Passed TestMethod1
Results File: D:\a\_temp\TestResults\VssAdministrator_fv-az38_2020-03-17_07_53_28.trx
Attachments:
D:\a\_temp\TestResults\*******-****-****-****-**********\VssAdministrator_fv-az38 2020-03-17 07_53_18.coverage
Total tests: 1. Passed: 1. Failed: 0. Skipped: 0.
Test Run Successful.
Note: If you want to run this build on self hosted agent, you might need to make sure the VS Enterprise is installed, refer to "Cannot find CodeCoverage.exe" on self-hosted agent.
First of all please keep in mind that I am just discovering how "things" work in the DevOps world and my knowledge is pretty limited - especially in scripting (PS and C#).
So I have to figure it out how to set up some Javascript unit tests for an app - specifically to get the "Test Results Analyzer" widget up and running on the Jenkins website.
I am currently recycling code from another Jenkins pipeline (def) and using the already existing "run unit tests" stage in the makefile.include of the project which (from what the main Dev of the project told me) it never worked - was never tested - to try and make the tests run.
I thought the best way (without breaking anything on the main app) is to test locally via cygwin.
I have mapped the project as a workspace in Perforce and tried to run the command from the makefile.include
$ make runRoutingPlannerCSTests
Which is working about half way and after it prompts me with some missing files errors which I was not able to find anywhere on my local project folder.
CSC : error CS0006: Metadata file 'D:\src\project\ServicePlanning\BackendAPI\Comtec.Portal.OSPBackend.ApiModel\bin\Release\Comtec.Portnd [D:\src\project\ServicePlanning\Frontend_RoutingPlanner\Comtec.ServicePlanning.Frontend.RoutingPlanner.Tests\Comtec.ServicePlanning
CSC : error CS0006: Metadata file 'D:\src\project\ServicePlanning\Frontend_RoutingPlanner\Comtec.ServicePlanning.Frontend.RoutingPlannngPlanner.dll' could not be found [D:\src\project\ServicePlanning\Frontend_RoutingPlanner\Comtec.ServicePlanning.Frontend.RoutingPlanntingPlanner.Tests.csproj]
CSC : error CS0006: Metadata file 'D:\src\project\ServicePlanning\Frontend_RoutingPlanner\Comtec.ServicePlanning.Frontend.RoutingPlannFrontend.RoutingPlanner.Model.dll' could not be found [D:\src\project\ServicePlanning\Frontend_RoutingPlanner\Comtec.ServicePlanning.Flanning.Frontend.RoutingPlanner.Tests.csproj]
Makefile.include:121: recipe for target `buildRoutingPlannerCSTests' failed
make: *** [buildRoutingPlannerCSTests] Error 1
and also
$ make runTests
Which gets stuck somewhere after running the Specrunner.html
######################################################
# run unit tests
######################################################
runTests: runRoutingPlannerJasmineTests runRoutingPlannerCSTests
runRoutingPlannerJasmineTests:
$(RoutingPlanner_TESTS_UTILITIES_DIR)/bin/phantomjs.exe $(RoutingPlanner_TESTS_DIR)/Scripts/jasmine.js $(RoutingPlanner_TESTS_DIR)/jsTests/SpecRunner.html
buildRoutingPlannerCSTests:
$(MSBUILD) `cygpath -a -w $(RoutingPlanner_TESTS_DIR)/Comtec.ServicePlanning.Frontend.RoutingPlanner.Tests.csproj` $(MSBUILD_OPTIONS) /t:Build /property:Configuration=$(VS_CONFIG) /fileloggerparameters:LogFile=`cygpath -a -w $(RoutingPlanner_TESTS_DIR)/Comtec.ServicePlanning.Tests-Build-$(VS_CONFIG).log`
runRoutingPlannerCSTests: buildRoutingPlannerCSTests
#rm -f '$(shell cygpath -aw '$(RoutingPlanner_TESTS_DIR)/bin/$(VS_CONFIG)/Comtec.ServicePlanning.Frontend.RoutingPlanner.Tests.trx')'
$(DOTNET_UNIT_MSTEST) /nologo '/testcontainer:$(shell cygpath -aw '$(RoutingPlanner_TESTS_DIR)/bin/$(VS_CONFIG)/Comtec.ServicePlanning.Frontend.RoutingPlanner.Tests.dll')' '/resultsfile:$(shell cygpath -aw '$(RoutingPlanner_TESTS_DIR)/bin/$(VS_CONFIG)/Comtec.ServicePlanning.Frontend.RoutingPlanner.Tests.trx')'
This section has an additional section at the begging of the script where the paths have been added.
RoutingPlanner_FRONTEND_API_DIR ?= $(RoutingPlanner_FRONTEND_DIR)/Comtec.ServicePlanning.Frontend.RoutingPlanner
RoutingPlanner_TESTS_DIR = $(RoutingPlanner_FRONTEND_DIR)/Comtec.ServicePlanning.Frontend.RoutingPlanner.Tests
RoutingPlanner_TESTS_UTILITIES_DIR = $(RoutingPlanner_TESTS_DIR)/Utilities/phantomjs-2.0.0-windows
RoutingPlanner_UTILITIES_DIR = $(PREPARESETUPDIR)/RoutingPlannerPortalUtilities
To be honest I am not even sure if I am following the right path to this since the steps I have found on the internet are different from what I found in the project and what I believe should be done.
For example: https://wiki.jenkins.io/display/JENKINS/Test+Results+Analyzer+Plugin
Mainly I believe this might be a simple "wrong path" issue but since my scripting skills are close to zero I am not sure what to modify and where.
I do not expect the solution at hand but I would really like to understand what the issues is or the proper way to actually make this work.
Thank you in advance.
It seems like everything has broken overnight at the same time... sigh.
In a desperate attempt to fix other random problems I need to make a build of our large project only to find that our teamcity build agents can no longer do their job. The error message is below:
[CallTarget] Version (1s)
[Version] MSBuild.ExtensionPack.Framework.AssemblyInfo (1s)
[MSBuild.ExtensionPack.Framework.AssemblyInfo] I:\BuildAgent-DEVTC1\work\e7d35660eba50bd6\build.proj(150, 3): error MSB4018: The "MSBuild.ExtensionPack.Framework.AssemblyInfo" task failed unexpectedly.
System.ArgumentNullException: Value cannot be null.
Parameter name: input
at System.Text.RegularExpressions.Regex.Matches(String input)
at MSBuild.ExtensionPack.Framework.Version.ParseVersion(String version) in D:\Projects\MSBuildExtensionPack\Releases\4.0.3.0\Main\Framework\Framework\AssemblyInfo\Version.cs:line 51
at MSBuild.ExtensionPack.Framework.AssemblyInfo.Execute() in D:\Projects\MSBuildExtensionPack\Releases\4.0.3.0\Main\Framework\Framework\AssemblyInfo\AssemblyInfo.cs:line 1011
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
The proj definition for the Version target is the following where #VersionDefinition is an "inlcude" for all AssemblyInfo.cs files:
<Target Name="Version">
<MSBuild.ExtensionPack.Framework.AssemblyInfo
AssemblyInfoFiles="#(VersionDefinition)"
AssemblyVersion="$(BUILD_NUMBER)"
AssemblyCopyright="Copywrite info here"
AssemblyCompany="Company info here"
AssemblyFileVersion="$(BUILD_NUMBER)"/>
</Target>
I can see that teamcity is correctly passing in BUILD_NUMBER with a valid value too.
Any ideas?
I'm open to suggestions that don't rely on the extension pack to set AssemblyInfo.cs numbers. I have looked into the TeamCity Assembly Info Patcher but I wasn't sure what "standard locations" was referring to in its description.
On a side note, have there been any updates recently to windows or .NET that could have broken everything...everywhere? I have recently had numerous third party libraries start to fail, almost simultaneously.
Thanks
UPDATE
The logs for recent successful build do not even show the Version target being called... which is odd given that that's the only place the correct build number is set and the build created files with the correct number applied.
So I installed a newer version of the ExtensionPack (4.0.13.0) on to the build clients and got a slightly clearer error message that told me which file was at fault.
Examining the AssemblyInfo.cs file mentioned the AssemblyVersion and AssemblyFileVersion values were missing. Adding these solved the issue.
The interesting part here is that the suspect project has not been touched for years so the values had never have been set. A quick scan through our git logs confirms this. Ultimately I'm not sure what triggered this to become a problem but it is no longer.
I have an Azure project in TFS that used to work well.
I've just get the latest version and rebuilt the project and now I get the following version:
Error 131 The XML specification is not valid: The 'schemaVersion' attribute is invalid - The value '2013-10.2.2' is invalid according to its datatype 'http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition:SchemaVersion' - The Enumeration constraint failed. D:\TFS_BOIRA\PROPPOSV3\BACKEND\ServiceLayer.Azure1\ServiceDefinition.csdef 2 125 ServiceLayer.Azure1
The same configuration in another computer works well.
I have checked the version of Azure Tools of both computers and we have different versions.
In my computer (Where I get the error) I have azure tools 2.3, whereas in the other computer where it works well the version is 2.2.
May it be a problem of azure tools versions?
When I add the role to the Azure cloud project, the assemblies:
Microsoft.WindowsAzure.Diagnostics
Microsoft.WindowsAzure.ServiceRuntime
are updated to version 2.3.0.0, and I need them in version 2.2.0.0.
Do I have to reinstall my azure tools to the version 2.2?
Thanks
In addition to Ingrid's answer, you need to get the latest schema version within the ServiceDefinition (.csdef) and ServiceConfiguration (.cscfg) files, and it is not good enough to just change the raw version value (e.g. 2.3), you also need the new version date:
2.3: schemaVersion="2014-01.2.3"
2.4: schemaVersion="2014-06.2.4"
<ServiceConfiguration serviceName="MyCoolCloudProjectName" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="4" osVersion="*" schemaVersion="2014-06.2.4">
<ServiceDefinition name="MyCoolCloudProjectName" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2014-06.2.4">
You need to keep this in sync if you are working on two different machines. Either bring both up to 2.3 or revert. Keep in mind that as part of upgrading it may have changed config files which you haven't checked in yet.
Finally what it worked for me was reverting the version of Azure Tools, as #Steve Newton has said.
How to revert the version it tis explained here:
http://social.msdn.microsoft.com/Forums/en-US/8701b03a-804f-4953-9ea0-01064aa4dc16/downgrade-from-18-tools-to-17?forum=azuretfs.
What I did was:
1.Modify the .ccproj file: the following two tags changing 2.3 to 2.2.
< ProductVersion>2.2< /ProductVersion>
< CloudExtensionsDir Condition=" '$(CloudExtensionsDir)' == '' ">$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Windows Azure Tools\2.2\< /CloudExtensionsDir>
2.Open the files ServiceConfiguration.Cloud.cscfg and ServiceDefinition.csdef and change the version there.
I have the same kind of error
[my config: java/eclipse or jenkins/azure eclipseplugin/azure sdk]
ServiceDefinition.csdef (2, 128): Error CloudServices051 : The XML specification is not valid: The 'schemaVersion' attribute is invalid - The value '2014-06.2.4' is invalid according to its datatype 'http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition:SchemaVersion' - The Enumeration constraint failed.
I had no error on my workstation using Eclipse or console but I got this error on my Jenkins instance. It was maybe a difference between SDK. I updated both ( jenkins and my workstation) with the same SDK version but I keep this error... :(
The only workaround I found to have a success build was to remove this attribute from ServiceDefinition.csdef root element.
<ServiceDefinition xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" name="AzureDeploymentProject">
In my build I keep the following warning but the package is build with success.
ServiceDefinition.csdef: Warning CloudServices040 : The 'schemaVersion' attribute is unspecified. Please set the attribute to avoid this warning.
I'm getting this error when trying to view a page in my localhost. Web site worked before. The code files are not pre-compiled. I've cleaned asp.net temporary folders and gave full control permission to IIS_IUSRS account for wwwroot and Temporary ASP.NET Files folder but no change.
I also get Access Denied error while try to execute
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_regiis.exe -i
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC2000: compiler initialization failed unexpectedly: 0x80070005
Source Error: [No relevant source lines]
Source File: vbc : Fatal Line: 0
Detailed Compiler Output:
c:\windows\system32\inetsrv> "C:\Windows\Microsoft.NET\Framework64\v3.5\vbc.exe" /t:library /utf8output /R:"C:\Windows\assembly\GAC_MSIL\System.ServiceModel.Web\3.5.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.WorkflowServices\3.5.0.0__31bf3856ad364e35\System.WorkflowServices.dll" /R:"C:\Windows\assembly\GAC_64\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Runtime.Serialization\3.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Design\2.0.0.0__b03f5f7f11d50a3a\System.Design.dll" /R:"C:\Windows\assembly\GAC_64\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\Windows\assembly\GAC_64\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.IdentityModel\3.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\edc6d145\6ccb6f45\assembly\dl3\5a446507\0042bc76_16cec701\Intelligencia.UrlRewriter.DLL" /R:"C:\Windows\assembly\GAC_MSIL\System.Core\3.5.0.0__b77a5c561934e089\System.Core.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.ServiceModel\3.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /out:"C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\edc6d145\6ccb6f45\App_SubCode_vb.8xqaf3z2.dll" /D:DEBUG=1 /debug+ /define:_MYTYPE=\"Web\" /imports:Microsoft.VisualBasic,System,System.Collections,System.Collections.Specialized,System.Configuration,System.Text,System.Text.RegularExpressions,System.Web,System.Web.Caching,System.Web.SessionState,System.Web.Security,System.Web.Profile,System.Web.UI,System.Web.UI.WebControls,System.Web.UI.WebControls.WebParts,System.Web.UI.HtmlControls,System.Web.Configuration,System.Data,System.Data.OleDb,System.Globalization /warnaserror- /optionInfer+ "C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\edc6d145\6ccb6f45\App_SubCode_vb.8xqaf3z2.0.vb" "C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\edc6d145\6ccb6f45\App_SubCode_vb.8xqaf3z2.1.vb"
Microsoft (R) Visual Basic Compiler version 9.0.30729.715
Copyright (c) Microsoft Corporation. All rights reserved.
vbc : Fatal error BC2000 : compiler initialization failed unexpectedly: 0x80070005
First, try setting "Enable 32-bit Applications" to True for your website application pool if you are running on x64 machine.
If first option doesn't help, Grant Full Accesses for NETWORK SERVICE and IIS_IUSRS group on C:\Windows\Temp\ and C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\
This happened to me after repairing / upgrading my VS 2013 Express
I first tried adding "IIS_IUSRS" and "NETWORK SERVICE" with Modify to the following:
C:\Users\[username]\AppData\Local\Temp\Temporary ASP.NET Files
C:\local\path\to\NET_App
C:\Windows\Temp
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files
Those did not work. But then I removed the optimizeCompilations="true" from the compilation tag under system.web and everything worked great.
<compilation debug="true" targetFramework="4.5.1" batch="false" optimizeCompilations="false" />
I got the same error when i add .ascx and use it in .aspx, but src path was wrong, add:
tagPrefix="uc" src="~/Signup**d**/UserControls/CreditCheck.ascx" tagName="CreditCheck"
My solution was to Grant Full Accesses for NETWORK SERVICE user and Modify Rights for the IIS_IUSERS to your ASP.NET root application folder.
The issue was caused by web.config transformation. It needs to create a temp file in the root application folder.
The line zero behaviour is generally caused by compiling with optimizations turned on (eg inlining). Try unchecking "Optimize code" under your project's Properties - Build tab. Then Source Error will show the offending code with line numbers.
I faced same issue.
My Symptom: it was working find on local but was failing on dev/stage.
Reason I found: There was an appvariable used in aspx.cs (as following) which was missing in web.config
public static String myKey = ConfigurationManager.AppSettings["myKey"].ToString();
Reason it took long for me to figure out issue was, i was not expecting this type of error message on line 0 (may be because my developer defined this variable as static so it was throwing line 0 error)
We converted our webapps to 64 bit quite some time ago and I still see this error jumping between old solutions. However, suddenly none of the standard good answers found on this thread worked.
Here is what ended up fixing my case. In Visual Studio 2019 in the project properties, on the application tab, where you choose the framework, there is an option to "Install other frameworks..." It will link you to here https://dotnet.microsoft.com/en-us/download/visual-studio-sdks?cid=getdotnetsdk . I downloaded and reinstalled, by choosing the repair option, the .Net Framework 4.8.1 Developer Pack and all is well now.
The only possible explanation why mine went bad is a Windows Update, maybe.