Could not find a part of the path … bin\roslyn\csc.exe error
Problem ve çözümü aşağıdadır.
‘C:\Users\PC\Source\Repos\project\Castle.project.Samples\bin\roslyn\csc.exe’ yolunun bir parçası bulunamadı.‘/’ Uygulamasında Sunucu Hatası.
‘C:\Users\PC\Source\Repos\project\Castle.project.Samples\bin\roslyn\csc.exe’ yolunun bir parçası bulunamadı.
Açıklama: Geçerli web isteği yürütülürken işlenmemiş özel durum oluştu. Lütfen hata ve kod içinde kaynaklandığı yer hakkında daha fazla bilgi almak için yığın izlemesini gözden geçirin.
Özel Durum Ayrıntıları: System.IO.DirectoryNotFoundException: ‘C:\Users\PC\Source\Repos\project\Castle.project.Samples\bin\roslyn\csc.exe’ yolunun bir parçası bulunamadı.
Kaynak Hatası:
Geçerli web isteği yürütülürken işlenmeyen bir özel durum üretildi. Özel durumun kaynağı ve konumuna ilişkin bilgiler aşağıdaki özel durum yığını izlemesi kullanılarak belirlenebilir. |
Yığın İzleme:
[DirectoryNotFoundException: 'C:\Users\PC\Source\Repos\project\Castle.project.Samples\bin\roslyn\csc.exe' yolunun bir parçası bulunamadı.]
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +373
System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +738
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) +68
Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.get_CompilerName() +91
Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.FromFileBatch(CompilerParameters options, String[] fileNames) +658
Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.CompileAssemblyFromFileBatch(CompilerParameters options, String[] fileNames) +186
System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromFile(CompilerParameters options, String[] fileNames) +25
System.Web.Compilation.AssemblyBuilder.Compile() +985
System.Web.Compilation.BuildProvidersCompiler.PerformBuild() +10230754
System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp) +10119830
System.Web.Compilation.BuildManager.CompileGlobalAsax() +47
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +274
[HttpException (0x80004005): 'C:\Users\PC\Source\Repos\project\Castle.project.Samples\bin\roslyn\csc.exe' yolunun bir parçası bulunamadı.]
System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +65
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +458
System.Web.Compilation.BuildManager.CallAppInitializeMethod() +35
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +605
[HttpException (0x80004005): 'C:\Users\PC\Source\Repos\project\Castle.project.Samples\bin\roslyn\csc.exe' yolunun bir parçası bulunamadı.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +10086640
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +99
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +263
|
Sürüm Bilgisi: Microsoft .NET Framework Sürümü:4.0.30319; ASP.NET Sürümü:4.8.4250.0Çözümü
Visual Studionun güncel versiyonlarını kullanıyorsanız eski sürümlerle oluşturulmuş projelerde karşınıza çıkacak problemdir.
Aşağıdaki kodu ilgili projenin .csproj dosyasının en altına ekleyin:
<Target Name="CopyRoslynFiles" AfterTargets="AfterBuild" Condition="!$(Disable_CopyWebApplication) And '$(OutDir)' != '$(OutputPath)'">
<ItemGroup>
<RoslynFiles Include="$(CscToolPath)\*" />
</ItemGroup>
<MakeDir Directories="$(WebProjectOutputDir)\bin\roslyn" />
<Copy SourceFiles="@(RoslynFiles)" DestinationFolder="$(WebProjectOutputDir)\bin\roslyn" SkipUnchangedFiles="true" Retries="$(CopyRetryCount)" RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)" />
</Target>
Sorununuz düzelmiş olmalıdır.
Bir yanıt yazın